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

Ada: improve bearer token validation #19

Open
onnozweers opened this issue Aug 30, 2024 · 0 comments
Open

Ada: improve bearer token validation #19

onnozweers opened this issue Aug 30, 2024 · 0 comments

Comments

@onnozweers
Copy link
Contributor

onnozweers commented Aug 30, 2024

Currently, bearer token validation is not very solid. There are a few things that can be improved:

  • Only Macaroon tokens are checked. But dCache also supports OIDC tokens. It would be nice to check them too.
  • For checking, the external command view-macaroon is used (if it can be found). It would be nice to reduce external dependencies. Decoding tokens should be fairly easy to implement (something like split & base64 decode)
  • Currently, only the expiration date of the macaroon is checked. We could consider checking also a few extra things, like: if you try to stage, does the macaroon have the required "UPDATE_METADATA" permission?

Such improved validation would be helpful to speed up troubleshooting for users, and reduce the number of helpdesk support requests. It might be extra helpful with bulk requests, because those are often accepted at first and only checked during processing. Some basic checks up front and failing early when needed, will save some time.

Relevant piece of code:

check_macaroon "$token" || exit 1

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

No branches or pull requests

1 participant