Skip to content

Conversation

aaldebs99
Copy link
Contributor

@aaldebs99 aaldebs99 commented Oct 18, 2025

Summary

Attempt 2!

This PR aims to implement optional API tokens used to access the API when basic or OIDC auth is enabled.

Example configuration:

security:
  api:
    tokens:
      - "my-secret-token-123"
      - "${API_TOKEN_FROM_ENV}"
      - "my-secret-token-2

This allows you to provide one of those tokens to API calls with the Authorization header:

curl http://localhost:8080/api/v1/config
{"announcements":[],"authenticated":false,"oidc":false}⏎

curl http://localhost:8080/api/v1/config -H "Authorization: Bearer my-secret-token-123"
{"announcements":[],"authenticated":true,"oidc":false}⏎

curl http://localhost:8080/api/v1/config -H "Authorization: Bearer my-secret-token-2"
{"announcements":[],"authenticated":true,"oidc":false}

Checklist

  • Tested and/or added tests to validate that the changes work as intended, if applicable.
  • Updated documentation in README.md, if applicable.

@github-actions github-actions bot added the feature New feature or request label Oct 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant