[PR #291] [MERGED] feat: api key authentication #887

Closed
opened 2025-10-07 00:24:05 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/pocket-id/pocket-id/pull/291
Author: @kmendell
Created: 3/3/2025
Status: Merged
Merged: 3/11/2025
Merged by: @stonith404

Base: mainHead: api-keys


📝 Commits (10+)

  • 449f555 add api-key backend logic
  • 20a02a6 add api key frontend, and add middleware in backend
  • a921e90 add db migrations, and fix dialog import
  • 1d4c2f1 fix expire date issues, and make sure jwt respects the api key
  • b99723c fix api key table layout
  • 13f3cf9 fix jwt and api key conflicts
  • e54d59d fix psql migrations
  • 8c24987 Merge branch 'main' into api-keys
  • 3db9a0b add e2e tests WIP
  • e754881 remove dropdown from api-keys table, and fix e2e tests

📊 Changes

58 files changed (+2162 additions, -180 deletions)

View changed files

📝 backend/internal/bootstrap/router_bootstrap.go (+10 -9)
📝 backend/internal/common/errors.go (+24 -0)
backend/internal/controller/api_key_controller.go (+125 -0)
📝 backend/internal/controller/app_config_controller.go (+112 -8)
📝 backend/internal/controller/audit_log_controller.go (+19 -5)
📝 backend/internal/controller/custom_claim_controller.go (+47 -6)
📝 backend/internal/controller/oidc_controller.go (+234 -33)
📝 backend/internal/controller/user_controller.go (+159 -31)
📝 backend/internal/controller/user_group_controller.go (+82 -11)
📝 backend/internal/controller/webauthn_controller.go (+7 -7)
📝 backend/internal/controller/well_known_controller.go (+17 -0)
backend/internal/dto/api_key_dto.go (+25 -0)
📝 backend/internal/dto/oidc_dto.go (+4 -8)
backend/internal/dto/pagination_dto.go (+10 -0)
backend/internal/middleware/api_key_auth.go (+50 -0)
backend/internal/middleware/auth_middleware.go (+89 -0)
📝 backend/internal/middleware/jwt_auth.go (+33 -34)
backend/internal/model/api_key.go (+18 -0)
📝 backend/internal/model/base.go (+4 -4)
backend/internal/service/api_key_service.go (+102 -0)

...and 38 more files

📄 Description

Fixes: https://github.com/pocket-id/pocket-id/issues/62


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/pocket-id/pocket-id/pull/291 **Author:** [@kmendell](https://github.com/kmendell) **Created:** 3/3/2025 **Status:** ✅ Merged **Merged:** 3/11/2025 **Merged by:** [@stonith404](https://github.com/stonith404) **Base:** `main` ← **Head:** `api-keys` --- ### 📝 Commits (10+) - [`449f555`](https://github.com/pocket-id/pocket-id/commit/449f55531232d08ca225cc6bb11a3e4bd02404ab) add api-key backend logic - [`20a02a6`](https://github.com/pocket-id/pocket-id/commit/20a02a606721e085f7b6a3a48a2fb93de77294cb) add api key frontend, and add middleware in backend - [`a921e90`](https://github.com/pocket-id/pocket-id/commit/a921e90780d863c580852e4ab7592814909f5a2f) add db migrations, and fix dialog import - [`1d4c2f1`](https://github.com/pocket-id/pocket-id/commit/1d4c2f174a3f68f5a6c0250291f8eb9f19634877) fix expire date issues, and make sure jwt respects the api key - [`b99723c`](https://github.com/pocket-id/pocket-id/commit/b99723c644f3b014534e840793b06c393a8ef7f7) fix api key table layout - [`13f3cf9`](https://github.com/pocket-id/pocket-id/commit/13f3cf903db2d146e6594d458204fbc45c6442a7) fix jwt and api key conflicts - [`e54d59d`](https://github.com/pocket-id/pocket-id/commit/e54d59de4d0fc4132ca3e165cf3d5f26809e866b) fix psql migrations - [`8c24987`](https://github.com/pocket-id/pocket-id/commit/8c2498778d425e1803e07975beaf6b0523ca9239) Merge branch 'main' into api-keys - [`3db9a0b`](https://github.com/pocket-id/pocket-id/commit/3db9a0b75a56a10ae50160d916aa80df4ac0c6a1) add e2e tests WIP - [`e754881`](https://github.com/pocket-id/pocket-id/commit/e754881c517eb0889d786515ac2ec20047ecac18) remove dropdown from api-keys table, and fix e2e tests ### 📊 Changes **58 files changed** (+2162 additions, -180 deletions) <details> <summary>View changed files</summary> 📝 `backend/internal/bootstrap/router_bootstrap.go` (+10 -9) 📝 `backend/internal/common/errors.go` (+24 -0) ➕ `backend/internal/controller/api_key_controller.go` (+125 -0) 📝 `backend/internal/controller/app_config_controller.go` (+112 -8) 📝 `backend/internal/controller/audit_log_controller.go` (+19 -5) 📝 `backend/internal/controller/custom_claim_controller.go` (+47 -6) 📝 `backend/internal/controller/oidc_controller.go` (+234 -33) 📝 `backend/internal/controller/user_controller.go` (+159 -31) 📝 `backend/internal/controller/user_group_controller.go` (+82 -11) 📝 `backend/internal/controller/webauthn_controller.go` (+7 -7) 📝 `backend/internal/controller/well_known_controller.go` (+17 -0) ➕ `backend/internal/dto/api_key_dto.go` (+25 -0) 📝 `backend/internal/dto/oidc_dto.go` (+4 -8) ➕ `backend/internal/dto/pagination_dto.go` (+10 -0) ➕ `backend/internal/middleware/api_key_auth.go` (+50 -0) ➕ `backend/internal/middleware/auth_middleware.go` (+89 -0) 📝 `backend/internal/middleware/jwt_auth.go` (+33 -34) ➕ `backend/internal/model/api_key.go` (+18 -0) 📝 `backend/internal/model/base.go` (+4 -4) ➕ `backend/internal/service/api_key_service.go` (+102 -0) _...and 38 more files_ </details> ### 📄 Description Fixes: https://github.com/pocket-id/pocket-id/issues/62 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2025-10-07 00:24:06 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pocket-id#887