Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DIG-1652: Remove use of OPA_SERVICE_TOKEN and OPA_ROOT_TOKEN #62

Merged
merged 5 commits into from
May 27, 2024

Conversation

daisieh
Copy link
Member

@daisieh daisieh commented May 23, 2024

Instead of using special tokens, we split up the use cases in these three ways:

  1. For the opa-runner container, to make sure that it is the only one that can access/store its own vault token, we create a secret for its own use on initialization, and make sure that the token passed in with calls to v1/data/store_token is the same as that internal secret.
  2. For site admins, we can check that the token belongs to a user listed as having the site_role admin. Those users can access any of Opa's paths.
  3. For the authx library (and other microservices), authenticated users can access information about their own user's authorizations. These include the authorized datasets, whether or not they're a site admin, and what their user ID is. These should be available as long as the bearer token matches the body token and is verified with one of Opa's known IdPs.

All previous tests that required passing in OPA_ROOT_TOKEN or OPA_SERVICE_TOKEN for the X-Opa header should now work correctly without that header, since they were one of the above use cases. Run make clean-opa; make docker-volumes; make build-opa; make compose-opa and then run integration tests. They should pass as before.

@kcranston
Copy link
Member

Can you update the description of service tokens in the readme to reflect these changes?

@daisieh
Copy link
Member Author

daisieh commented May 27, 2024

Done

@daisieh daisieh merged commit 44ae995 into develop May 27, 2024
2 checks passed
@daisieh daisieh deleted the daisieh/vault-secret branch May 27, 2024 18:32
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.

2 participants