Skip to content

Add authentication to the queue - #86

Open
jacob-williamson wants to merge 21 commits into
mainfrom
2_auth
Open

Add authentication to the queue#86
jacob-williamson wants to merge 21 commits into
mainfrom
2_auth

Conversation

@jacob-williamson

@jacob-williamson jacob-williamson commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Fixes #2

Adds authentication to the queue. Another ticket should be created to improve authorisation, taking account what visits users have access to etc. For now we just have a whitelist of approved fedIDs.

  • If no OIDC config is provided, the queue will not authenticate users.
  • If no whitelist is provided in config, anyone who has authenticated can use any endpoint.
  • Providing a whitelist with no OIDC config doesn't make much sense and the whitelist wouldn't be used.

The user who queued a task is now also added to the task object, so this can now be displayed in the UI.

Instructions on how to test:

  • Start up a local queue with config that adds authentication: daq-queuing-service --config tests/system_tests/config_with_auth.yaml -p 8001 --dev
  • Go to the docs page
  • Confirm you can't use any of the endpoints other than healthz and get_queue_state, and the message not authenticated is returned
  • Retrieve a valid token:
  • Click the authorise button in the docs page, paste in the token
  • Confirm the endpoints now work

Testing authorisation:

  • Go to tests/system_tests/config_with_auth.yaml
  • Add the following at the bottom of the file:
authorisation_whitelist:
  - "somebody"
  • Restart the local queue and try the endpoints
  • Confirm that for any endpoints other than get_config, you get a not authorised error.
  • Add your fed ID to the authorisation_whitelist
  • Restart the queue and confirm you can now use all the endpoints

@jacob-williamson
jacob-williamson marked this pull request as draft August 12, 2026 08:59
@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.87%. Comparing base (016ac31) to head (86effdf).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #86      +/-   ##
==========================================
+ Coverage   98.76%   98.87%   +0.11%     
==========================================
  Files          18       20       +2     
  Lines         889      979      +90     
==========================================
+ Hits          878      968      +90     
  Misses         11       11              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jacob-williamson
jacob-williamson marked this pull request as ready for review August 14, 2026 11:51
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.

Add auth to the queuing service

1 participant