[PR #270] [MERGED] feat: device authorization endpoint #906

Closed
opened 2025-10-08 00:19:25 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/pocket-id/pocket-id/pull/270
Author: @kmendell
Created: 2/25/2025
Status: Merged
Merged: 4/25/2025
Merged by: @kmendell

Base: mainHead: device-code-grant


📝 Commits (10+)

  • 42d010b feat: device authorization endpoint
  • bcc2ff2 remove my testing
  • 69b1c29 add device auth endpoint to .well-known controller
  • df0cfd2 fix duplicate device code db issue
  • 26b4559 Merge branch 'main' into device-code-grant
  • 444486d fix device code token logic, fix audit log args, add new audit log event types
  • 70b93ad add allowedUserGroup checks
  • c42a93f remove checkbox from form and set device code to enabled by default
  • ad36ff5 remove un-needed debug logs from testing
  • 2230d6a add scope sharing confirmation, device auth page match exsisting layouts, add return to device message

📊 Changes

26 files changed (+777 additions, -79 deletions)

View changed files

📝 backend/internal/common/errors.go (+48 -0)
📝 backend/internal/controller/oidc_controller.go (+84 -19)
📝 backend/internal/controller/well_known_controller.go (+2 -1)
📝 backend/internal/dto/oidc_dto.go (+30 -0)
📝 backend/internal/model/audit_log.go (+6 -4)
📝 backend/internal/model/oidc.go (+14 -0)
📝 backend/internal/service/oidc_service.go (+255 -49)
backend/resources/migrations/postgres/20250421221059_add_device_codes.down.sql (+1 -0)
backend/resources/migrations/postgres/20250421221059_add_device_codes.up.sql (+12 -0)
backend/resources/migrations/sqlite/20250421221059_add_device_codes.down.sql (+1 -0)
backend/resources/migrations/sqlite/20250421221059_add_device_codes.up.sql (+12 -0)
📝 frontend/messages/en-US.json (+5 -1)
📝 frontend/src/hooks.server.ts (+1 -1)
📝 frontend/src/lib/components/header/header.svelte (+1 -1)
📝 frontend/src/lib/components/scope-item.svelte (+0 -0)
frontend/src/lib/components/scope-list.svelte (+27 -0)
📝 frontend/src/lib/services/oidc-service.ts (+11 -0)
📝 frontend/src/lib/types/oidc.type.ts (+6 -0)
📝 frontend/src/routes/authorize/+page.svelte (+1 -1)
frontend/src/routes/device/+page.server.ts (+9 -0)

...and 6 more files

📄 Description

This took me awhile to figure out but it does work as far as i can see. More of a base layout for the feature as this was my first attempt. It follows the OIDC Spec as well.

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


���� 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/270 **Author:** [@kmendell](https://github.com/kmendell) **Created:** 2/25/2025 **Status:** ✅ Merged **Merged:** 4/25/2025 **Merged by:** [@kmendell](https://github.com/kmendell) **Base:** `main` ← **Head:** `device-code-grant` --- ### 📝 Commits (10+) - [`42d010b`](https://github.com/pocket-id/pocket-id/commit/42d010bdc78a9051c38c2fd42b12542f341b120d) feat: device authorization endpoint - [`bcc2ff2`](https://github.com/pocket-id/pocket-id/commit/bcc2ff219073f6a0d19e8cc36296c804fe8dc19d) remove my testing - [`69b1c29`](https://github.com/pocket-id/pocket-id/commit/69b1c29e36f89968dfc017dbd633a0bb54f583ee) add device auth endpoint to .well-known controller - [`df0cfd2`](https://github.com/pocket-id/pocket-id/commit/df0cfd2175a9b460ced36be8311bce82c3c761e1) fix duplicate device code db issue - [`26b4559`](https://github.com/pocket-id/pocket-id/commit/26b4559297461b748c9facd501ed857decddd392) Merge branch 'main' into device-code-grant - [`444486d`](https://github.com/pocket-id/pocket-id/commit/444486df4565b872119f2f6f6fbfee17873cfd3d) fix device code token logic, fix audit log args, add new audit log event types - [`70b93ad`](https://github.com/pocket-id/pocket-id/commit/70b93ad96d9e0b2f0d18fd5d67bb91b58e71e37b) add allowedUserGroup checks - [`c42a93f`](https://github.com/pocket-id/pocket-id/commit/c42a93ff25314ad7561afd4b43ca5660483b5a0c) remove checkbox from form and set device code to enabled by default - [`ad36ff5`](https://github.com/pocket-id/pocket-id/commit/ad36ff5ae26afab7c12ea9a82d98ff6c40d96414) remove un-needed debug logs from testing - [`2230d6a`](https://github.com/pocket-id/pocket-id/commit/2230d6a70370bce025690f57fa8fe3529b7aeaea) add scope sharing confirmation, device auth page match exsisting layouts, add return to device message ### 📊 Changes **26 files changed** (+777 additions, -79 deletions) <details> <summary>View changed files</summary> 📝 `backend/internal/common/errors.go` (+48 -0) 📝 `backend/internal/controller/oidc_controller.go` (+84 -19) 📝 `backend/internal/controller/well_known_controller.go` (+2 -1) 📝 `backend/internal/dto/oidc_dto.go` (+30 -0) 📝 `backend/internal/model/audit_log.go` (+6 -4) 📝 `backend/internal/model/oidc.go` (+14 -0) 📝 `backend/internal/service/oidc_service.go` (+255 -49) ➕ `backend/resources/migrations/postgres/20250421221059_add_device_codes.down.sql` (+1 -0) ➕ `backend/resources/migrations/postgres/20250421221059_add_device_codes.up.sql` (+12 -0) ➕ `backend/resources/migrations/sqlite/20250421221059_add_device_codes.down.sql` (+1 -0) ➕ `backend/resources/migrations/sqlite/20250421221059_add_device_codes.up.sql` (+12 -0) 📝 `frontend/messages/en-US.json` (+5 -1) 📝 `frontend/src/hooks.server.ts` (+1 -1) 📝 `frontend/src/lib/components/header/header.svelte` (+1 -1) 📝 `frontend/src/lib/components/scope-item.svelte` (+0 -0) ➕ `frontend/src/lib/components/scope-list.svelte` (+27 -0) 📝 `frontend/src/lib/services/oidc-service.ts` (+11 -0) 📝 `frontend/src/lib/types/oidc.type.ts` (+6 -0) 📝 `frontend/src/routes/authorize/+page.svelte` (+1 -1) ➕ `frontend/src/routes/device/+page.server.ts` (+9 -0) _...and 6 more files_ </details> ### 📄 Description This took me awhile to figure out but it does work as far as i can see. More of a base layout for the feature as this was my first attempt. It follows the OIDC Spec as well. Fixes: https://github.com/pocket-id/pocket-id/issues/112 --- <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-08 00:19:26 +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-pocket-id-1#906