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

feat: get api tokens by name #4507

Merged
merged 3 commits into from
Aug 16, 2023
Merged

feat: get api tokens by name #4507

merged 3 commits into from
Aug 16, 2023

Conversation

kwasniew
Copy link
Contributor

@kwasniew kwasniew commented Aug 16, 2023

About the changes

  • Get API tokens by name
  • There can be 0, 1 or many tokens. I decided to always return 200 with either empty list, one element list, multi-element list. It feels the most idiomatic approach with a list returned. Originally the plan was to return 404 when the token doesn't exist but for the list/collection based APIs this feels wrong.
  • Current I'm adding in-memory filtering so that we don't have to over-invest in DB access code. Once the capability is found to be useful we can follow-up with more perf optimized solution.
  • Also the existing code for tokens was mostly implemented in the controller layer instead of the service layer. I don't want to do massive refactoring and move everything to the service layer in this PR

Important files

Discussion points

@vercel
Copy link

vercel bot commented Aug 16, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
unleash-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 16, 2023 9:24am
unleash-monorepo-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 16, 2023 9:24am

Copy link
Contributor

@thomasheartman thomasheartman left a comment

Choose a reason for hiding this comment

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

Looks good to me 😄

src/lib/routes/admin-api/api-token.ts Outdated Show resolved Hide resolved
Co-authored-by: Thomas Heartman <thomas@getunleash.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants