Skip to content
New issue

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

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

Already on GitHub? # to your account

fix: api keys authentication does not work #1511 #1512

Merged
merged 2 commits into from
Nov 20, 2024

Conversation

Meierschlumpf
Copy link
Member

@Meierschlumpf Meierschlumpf commented Nov 20, 2024


Homarr

Thank you for your contribution. Please ensure that your pull request meets the following pull request:

  • Builds without warnings or errors (pnpm buid, autofix with pnpm format:fix)
  • Pull request targets dev branch
  • Commits follow the conventional commits guideline
  • No shorthand variable names are used (eg. x, y, i or any abbrevation)

Changes:

  • API Keys issued now are in the following format: <id>.<token>
  • This allows us to query the key by id and then comparing it's token with the salt and hash of the one in the database

Closes #1511

Added logs:
Postman: @homarr/nextjs:dev: 2024-11-20T20:10:32.064Z warn: An attempt to authenticate over API has failed due to invalid API key format ip='::1' userAgent='PostmanRuntime/7.37.3'
Swagger: @homarr/nextjs:dev: 2024-11-20T20:10:52.024Z warn: An attempt to authenticate over API has failed due to invalid API key format ip='::1' userAgent='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36'

@Meierschlumpf Meierschlumpf added the bug Something isn't working label Nov 20, 2024
@Meierschlumpf Meierschlumpf self-assigned this Nov 20, 2024
@Meierschlumpf Meierschlumpf requested a review from a team as a code owner November 20, 2024 18:51
Copy link

deepsource-io bot commented Nov 20, 2024

Here's the code health analysis summary for commits ed74604..9e7deb7. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource JavaScript LogoJavaScript✅ SuccessView Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

Copy link

github-actions bot commented Nov 20, 2024

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 22% 6434 / 29238
🔵 Statements 22% 6434 / 29238
🔵 Functions 24.03% 248 / 1032
🔵 Branches 60.62% 782 / 1290
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
apps/nextjs/src/app/[locale]/manage/tools/api/components/api-keys.tsx 0% 0% 0% 0% 1-78
apps/nextjs/src/app/api/[...trpc]/route.ts 0% 0% 0% 0% 1-83
packages/api/src/router/apiKeys.ts 0% 0% 0% 0% 1-42
Generated in workflow #3775 for commit 9e7deb7 by the Vitest Coverage Report Action

manuel-rw
manuel-rw previously approved these changes Nov 20, 2024
@Meierschlumpf Meierschlumpf merged commit 72eda1f into dev Nov 20, 2024
11 checks passed
@Meierschlumpf Meierschlumpf deleted the fix-api-keys-not-working branch November 20, 2024 20:55
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: api keys authentication does not work
2 participants