Project

General

Profile

action #159384

Updated by okurz 16 days ago

## 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 

 * **AC1:** Web-Applications can access the openQA API from web browsers, e.g. accessing https://openqa.suse.de/api/v1/jobs/14165616 

 ## Suggestion 
 * Add `Access-Control-Allow-Origin: *` (or more restrictive) to the http header 
   * Possibly at the nginx/Apache level 
   * On OSD just add it with https://ubiq.co/tech-blog/set-access-control-allow-origin-cors-headers-apache/ and ask fniederwanger for confirmation 
   * Implement it in the mojo web app follow https://docs.mojolicious.org/Mojo/Headers#access_control_allow_origin 
 * Ask the OP what "other web applications" don't work 

 ## Further details 
 * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors/CORSMissingAllowOrigin

Back