Skip to content

Conversation

@mcucchi9
Copy link
Collaborator

@mcucchi9 mcucchi9 commented Aug 28, 2025

This PR implements a mechanism to allow unauthenticated requests for specific endpoints, and allows unauthenticated requests for apply_constraints and estimate_cost endpoints.

Details
Endpoints with forbidden unauthenticated requests requires an authentication header to be sent, otherwise return a PermissionDenied error.
Endpoints with allowed unauthenticated requests doesn't require an authentication header to be sent, and in this case set the internal user_uid variable to unauthenticated.

Also, the Referer endpoint is now used to help determine the request origin in case the request is not authenticated: if it is present, the request origin is set to ui, otherwise it is set to api.

Why it's useful
Before, apply_constraints and estimate_cost didn't required authentication, so they already allowed unauthenticated requests. For https://jira.ecmwf.int/secure/RapidBoard.jspa?rapidView=401&view=detail&selectedIssue=COPDS-2811&quickFilter=1278# and #257, though, we need a mechanism for:

  • trace users making requests;
  • allow for unauthenticated requests, tracing their rate;

@mcucchi9 mcucchi9 requested a review from keul August 28, 2025 13:49
@mcucchi9 mcucchi9 self-assigned this Aug 28, 2025
@mcucchi9 mcucchi9 merged commit 44a6603 into main Aug 28, 2025
9 checks passed
@mcucchi9 mcucchi9 deleted the COPDS-2811-auth branch August 28, 2025 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant