Skip to content

Conversation

@max-zilla
Copy link
Contributor

@max-zilla max-zilla commented Mar 29, 2023

Implements a basic functioning example of an endpoint to generate API keys and a wrapper on existing auth that lets a request use either tokens (as before) or x-api-key header.

Currently this works by:

  • having a secret instance key in Clowder config.
  • generating a JSON object with username + randomized token and hashing that with the instance key = the key the user receives
  • when user proves the key, we use instance key to decode it back to username + token object, and lookup that in mongo to check creation time to expire if needed (defaults to 30 mins)

@max-zilla max-zilla marked this pull request as ready for review March 31, 2023 13:23
@tcnichol tcnichol self-requested a review March 31, 2023 19:15
Copy link
Contributor

@tcnichol tcnichol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. Will mark approved and we can save improvements for later issues. We can also revisit how this will work with extractors.

@max-zilla max-zilla merged commit f3260ae into main Apr 4, 2023
@max-zilla max-zilla deleted the user-API-keys branch April 4, 2023 13:56
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.

3 participants