[PR #550] refactor: some clean-up in OIDC service and controller (1.0) #740

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

Original Pull Request: https://github.com/pocket-id/pocket-id/pull/550

State: closed
Merged: Yes


As I started working on #361, I wanted to split out a small initial refactor/code cleanup, so the upcoming main PR wouldn't contain irrelevant refactorings.

  • In OidcService, CreateToken and all the functions it calls now accept a struct and return a struct. This avoids passing up to 5 arguments and having up to 5 return values (some functions did not use all input args and did not return all 5 outputs).
  • Define constants for the grant types, including urn:ietf:params:oauth:grant-type:device_code
  • When verifying client credentials, if the user passed a client secret we always validate it, even for public clients (before, we entirely skipped the validation if the client was public, which was not the ideal behavior (if the client does pass a credential, it should be validated or rejected)
**Original Pull Request:** https://github.com/pocket-id/pocket-id/pull/550 **State:** closed **Merged:** Yes --- As I started working on #361, I wanted to split out a small initial refactor/code cleanup, so the upcoming main PR wouldn't contain irrelevant refactorings. - In `OidcService`, `CreateToken` and all the functions it calls now accept a struct and return a struct. This avoids passing up to 5 arguments and having up to 5 return values (some functions did not use all input args and did not return all 5 outputs). - Define constants for the grant types, including `urn:ietf:params:oauth:grant-type:device_code` - When verifying client credentials, if the user passed a client secret we always validate it, even for public clients (before, we entirely skipped the validation if the client was public, which was not the ideal behavior (if the client does pass a credential, it should be validated or rejected)
OVERLORD added the pull-request label 2025-10-07 00:21:34 +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#740