Repository navigation
feat(auth): add typed sign-in results and account checks for auth providers - #34
Conversation
…viders AuthenticateResponse gains typed identity fields (issuer, username, email_verified, groups, picture, managed role), opaque refresh_state and a typed denial. A separate AuthProviderChecks service adds TestConnection, CheckAccount and EndSessionUrl, registered with WithAuthProviderChecks, and WithConfigure delivers Runtime.Configure entries to ServeManifest plugins. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 🧰 Additional context used📚 Code guidelines (3)No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (3)
📒 Files selected for processing (13)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe SDK adds auth-provider protocol fields and a separate checks service. Manifest validation now checks auth modes and connection-test metadata. Runtime options support configuration callbacks and checks-service registration, with compatibility tests and documentation for the new behavior. ChangesAuth provider support
Priority: ⬇️ Low Estimated code review effort: 4 (Complex) | ~45 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant PluginAuthor
participant ServeManifestWithOptions
participant AuthProviderChecksClient
participant AuthProviderChecksServer
PluginAuthor->>ServeManifestWithOptions: Configure WithAuthProviderChecks and WithConfigure
ServeManifestWithOptions->>AuthProviderChecksServer: Register resolved checks service
AuthProviderChecksClient->>AuthProviderChecksServer: Call TestConnection, CheckAccount, or EndSessionUrl
Merge Risk: ⚪ Minimal · up to No actionable issue remains on the supplied evidence; the change is mergeable after normal checks. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The changes preserve existing interfaces and specify compatibility and recovery behavior. No introduced vulnerability was established, but authorization, role assignment, and refresh-token recovery still require validation in the consuming server and providers. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 43.48% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 46 functions across 7 files. (6 skipped: 6 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@macroscope-app review |
|
Manual reviews triggered for commit All prior checks · these links stay valid even if you push more commits. |
|
Review started; results will be posted as check runs. |
|
CodeRabbit's docstring-coverage warning doesn't need a change. Every exported function and option this PR adds ( Kody and Macroscope found no issues, and |
Summary
Extends the auth-provider SDK so plugins can return structured sign-in results, expose connection diagnostics, re-check accounts without user interaction, and provide logout URLs—all without adding methods to the existing
AuthProviderServerinterface.Changes
AuthenticateResponse. Adds typed denial reasons for invalid credentials, access restrictions, disabled accounts, expired passwords, and provider unavailability, with separate operator-facing details.promptandlogin_hintto authorization requests.AuthProviderChecksservice:TestConnectionaccepts staged settings and returns ordered diagnostic steps.CheckAccountreturns a typed account status, updated identity details, and rotated refresh state.EndSessionUrlreturns a provider logout URL using the account’s stored state and requested return URL.WithAuthProviderChecksregistration. Explicit registration takes precedence; otherwise, the runtime automatically registers checks when the auth-provider server implements them. AddsWithConfigureso plugins using the default manifest runtime can receive saved settings and propagate configuration errors.connection_testmetadata while continuing to accept unknown non-empty modes. Prevents startup when connection testing is advertised but no checks service is registered.Compatibility and Coverage
Preserves the existing auth-provider interface and public runtime struct layouts. Documents the distinction between unset and explicitly false email verification, and between unset and explicitly empty refresh state.
Adds tests for legacy responses and servers, serialization and field presence, stable enum values, manifest validation, configuration callbacks, service-registration precedence, RPC round trips, and
Unimplementedresponses when checks are unavailable. Expands the release smoke-build check to reference the new public APIs from an external consumer.