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

fix: Remove API Tokens from User APIs #4985

Merged
merged 3 commits into from
Jan 29, 2025

Conversation

michael-genson
Copy link
Collaborator

What this PR does / why we need it:

(REQUIRED)

Removes tokens from all APIs other than the create API (since you need the token exactly once, upon creation).

Which issue(s) this PR fixes:

(REQUIRED)

Fixes #4981

Special notes for your reviewer:

(fill-in or delete this section)

The API still returns a list of all user tokens to the admin due to how our models are set up. We should probably stop doing this, but now that the actual token string isn't being returned it's not a security risk (and it's restricted to admins). Removing the tokens from this API will take some more effort/investigation since that endpoint is used in several places in the app.

Testing

(fill-in or delete this section)

Tested the frontend locally (to make sure you can still copy the token, etc.) and added backend tests to assert that the token is private.

@hay-kot hay-kot enabled auto-merge (squash) January 29, 2025 19:43
@hay-kot hay-kot merged commit cb05ade into mealie-recipes:mealie-next Jan 29, 2025
13 checks passed
@disconn3ct
Copy link

FWIW I would not have reported if it was only names 👍 so this works for me. Thanks!

@michael-genson michael-genson deleted the fix/exposed-tokens branch January 30, 2025 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Security] Email to follow
3 participants