Project

General

Profile

Actions

action #159384

closed

coordination #154768: [saga][epic][ux] State-of-art user experience for openQA

coordination #159570: [epic] Better integration with other tooling

Add CORS headers size:S

Added by ph03nix 7 months ago. Updated 6 months ago.

Status:
Resolved
Priority:
Low
Assignee:
Category:
Feature requests
Target version:
Start date:
2024-04-22
Due date:
% Done:

0%

Estimated time:

Description

User story

Let's allow other web applications to use the openQA API.

Currently, web applications refuse to use the openQA API, because the CORS Access-Control-Allow-Origin header is not set. See https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors/CORSMissingAllowOrigin

Acceptance criteria

Suggestion

Further details

Actions #1

Updated by okurz 7 months ago

  • Category set to Feature requests
  • Target version set to Ready
Actions #2

Updated by okurz 7 months ago

  • Parent task set to #159570
Actions #3

Updated by okurz 7 months ago

  • Status changed from New to Feedback
  • Assignee set to okurz

Literally just a handful of days after our last workshop session with the topic 'What are "acceptance criteria" - hint: they are not tasks' you come up with this AC which is not an AC :D

Please update the ticket description with an actual acceptance criterion, examples of where this triggers problems so that we know what we can check with and a use case.

Actions #4

Updated by ph03nix 7 months ago

  • Description updated (diff)

Updated the description accordingly.

Actions #5

Updated by ph03nix 7 months ago

okurz wrote in #note-3:

Please update the ticket description with an actual acceptance criterion, examples of where this triggers problems so that we know what we can check with and a use case.

If you really need a formalized check you need to write a custom Web application that will fetch resources from within the browser. This currently fails due to https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors/CORSMissingAllowOrigin.

Actions #6

Updated by okurz 7 months ago

  • Description updated (diff)
  • Status changed from Feedback to New
  • Assignee deleted (okurz)
  • Priority changed from Normal to Low

Rephrased "Acceptance criteria" to be a checkable criterion, not a task: "Web-Applications can access the openQA API from web browsers, e.g. accessing https://openqa.suse.de/api/v1/jobs/14165616". I hope that still catches what you would like to see.

Actions #7

Updated by ph03nix 7 months ago

okurz wrote in #note-6:

Rephrased "Acceptance criteria" to be a checkable criterion, not a task: "Web-Applications can access the openQA API from web browsers, e.g. accessing https://openqa.suse.de/api/v1/jobs/14165616". I hope that still catches what you would like to see.

ack.

Actions #8

Updated by okurz 7 months ago

  • Subject changed from Add CORS headers to Add CORS headers size:S
  • Description updated (diff)
  • Status changed from New to Workable
Actions #9

Updated by mkittler 7 months ago

  • Status changed from Workable to In Progress
  • Assignee set to mkittler
Actions #10

Updated by mkittler 7 months ago

  • Status changed from In Progress to Feedback

Ask the OP what "other web applications" don't work

I asked on Slack.


Implement it in the mojo web app follow https://docs.mojolicious.org/Mojo/Headers#access_control_allow_origin

Draft PP: https://github.com/os-autoinst/openQA/pull/5613

Actions #11

Updated by mkittler 7 months ago

I got the feedback that this is about http://container-dashboard.qe.suse.de and concerns OSD and o3.

The draft is now also ready to be merged.

Actions #12

Updated by mkittler 6 months ago ยท Edited

  • Status changed from Feedback to In Progress

The PR has been merged. When trying to configure it I've noticed that one can only configure a single origin or *. So I guess we need to extend the feature so it'll set the origin depending on the requesting origin.

I nevertheless created a draft for the configuration on OSD: https://gitlab.suse.de/openqa/salt-states-openqa/-/merge_requests/1175

Actions #13

Updated by mkittler 6 months ago

PR for specifying multiple origins: https://github.com/os-autoinst/openQA/pull/5626

Actions #14

Updated by mkittler 6 months ago

The change is deployed/configured on o3 and OSD so you can try it out. Note that I so far only added http://container-dashboard.qe.suse.de. You can add more allowed origins (e.g. https://container-dashboard.qe.suse.de) by creating a MR similar to https://gitlab.suse.de/openqa/salt-states-openqa/-/merge_requests/1175 and configuring things on ariel manually. (Additionally allowed origins need to be separated via a comma.)

Actions #15

Updated by mkittler 6 months ago

  • Status changed from In Progress to Feedback
Actions #16

Updated by mkittler 6 months ago

  • Status changed from Feedback to Resolved

Probably it is not worth keeping this ticket open until @ph03nix finds time to test it out. So I'm considering this resolved.

@ph03nix You can re-open the ticket if it doesn't work after all. If you just need another host added you can also just ask on the chat (or follow #159384#note-14 yourself).

Actions #17

Updated by ph03nix 6 months ago

mkittler wrote in #note-16:

Probably it is not worth keeping this ticket open until @ph03nix finds time to test it out. So I'm considering this resolved.

@ph03nix You can re-open the ticket if it doesn't work after all. If you just need another host added you can also just ask on the chat (or follow #159384#note-14 yourself).

Thank you Marius, I'll try to run a simple test this week.

Actions

Also available in: Atom PDF