Skip to content

feat(auth): support an auth management key for disabled auth methods - #135

Open
itaihanski wants to merge 3 commits into
mainfrom
feat/auth-management-key
Open

feat(auth): support an auth management key for disabled auth methods#135
itaihanski wants to merge 3 commits into
mainfrom
feat/auth-management-key

Conversation

@itaihanski

Copy link
Copy Markdown
Member

Related Issues

https://github.com/descope/etc/issues/8683

Description

  • Add an optional authManagementKey to the SDK config, sent with every authentication request so that methods whose public access has been disabled can still be used, similar to the other Descope server SDKs

Must

  • Tests
  • Documentation

@shuni-bot

shuni-bot Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

🐕 Review complete — View session on Shuni Portal 🐾

@shuni-bot

shuni-bot Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

🐕 Suggested Reviewers

This PR adds auth management key support to the PHP SDK configuration. The changes span configuration files (.env.example), documentation (README.md), test infrastructure (phpunit.xml), and core SDK logic (src/SDK/API.php, src/SDK/DescopeSDK.php, and new test file).

The review assignment strategy prioritizes contributors with the broadest file coverage and specific expertise in the modified areas: gaokevin1 brings extensive experience across all affected file types including configuration and documentation; dorsha provides targeted expertise in README updates and core API implementation; omercnet offers additional validation on SDK API changes. Together, these reviewers provide comprehensive coverage of configuration management, documentation accuracy, API implementation details, and test quality.

Reviewer Reason
gaokevin1 gaokevin1 has the most extensive commit history (21 commits) across all file types modified in this PR (.env.example, README.md, phpunit.xml, and SDK files). Their broad experience makes them ideal for verifying the overall consistency and impact of adding authManagementKey across config, documentation, and core SDK components.
dorsha dorsha has 8 commits specifically across README.md, phpunit.xml, and src/SDK/API.php — three of the most critical files in this PR. Their expertise in API implementation and documentation updates directly aligns with this feature's core changes.
omercnet omercnet brings additional validation with 7 commits across README.md, phpunit.xml, and src/SDK/API.php. Their familiarity with SDK API implementation patterns ensures the authManagementKey integration follows established conventions and doesn't introduce inconsistencies.

Suggested by Shuni based on git history and PR context. Names are not @-mentioned to avoid notifying anyone — request a review from whoever fits best.

@shuni-bot shuni-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐕 Shuni's Review

Adds an optional authManagementKey that is appended to the bearer token on authentication requests (and kept off management requests), wired from SDK config with docs and a dedicated test file.

Sniffed out 1 issue:

  • 1 🟢 LOW: the "never sent on management requests" invariant has one narrow hole for direct $sdk->api callers

Good bones — the guard in getAuthToken, the default-to-empty handling, and the auth/management split all check out, and no in-SDK call site can leak the key onto a management endpoint. Woof!


Declared coverage: FULL — 6/6 changed files reviewed.

Comment thread src/SDK/API.php Outdated
@shuni-bot

shuni-bot Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

🐕 Review complete — View session on Shuni Portal 🐾

@shuni-bot shuni-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐕 Shuni's Review

Re-reviewed the push (9c19ec2), which reworks getAuthToken so the key is chosen from the management flag instead of an early return, and passes $useManagementKey straight through from doPost/doPatch/doGet.

Sniffed out 0 new issues — and my earlier 🟢 finding is fixed.

I walked every in-SDK call site: the new one-liner is behavior-identical to main for all of them (project:mgmtKey for management, project[:token][:authMgmtKey] for auth), the empty-key and null-flag edges land where the new tests say, and StaticStateIsolationTest's Bearer project:mgmt-key assertion still holds. Nice clean-up — good bones! Woof!

Note: I replied to the prior thread but couldn't resolve it (resolve is denied to my token) — needs a manual resolve. The four unchanged files here were covered in the previous review.

⚠️ Review follow-up issue: Request failed due to following response errors:

  • Resource not accessible by integration Not every prior review finding was resolved or marked unfixed.

Declared coverage: PARTIAL — 2/6 changed files reviewed.

@itaihanski
itaihanski requested review from dorsha and gaokevin1 August 11, 2026 14:13
@itaihanski
itaihanski enabled auto-merge (squash) August 11, 2026 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant