imporve oauth provider UI/UX - #2983
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughThis PR adds OAuth provider icons, per-provider access control policies, and OpenID Connect discovery capabilities. Backend changes introduce access policy validation/evaluation logic, a discovery fetch endpoint, and new model fields. Frontend updates enable provider icon display, OAuth configuration UI with discovery workflow, and access policy templating. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Client as Web Client
participant Controller as CustomOAuth Controller
participant HTTP as HTTP Fetch
participant DB as Database
User->>Client: Click "Fetch Discovery"
Client->>Controller: POST /custom-oauth-provider/discovery<br/>(issuerURL or wellKnownURL)
Controller->>HTTP: Fetch OpenID Config<br/>from .well-known/openid-config
HTTP-->>Controller: Discovery Doc<br/>(endpoints, scopes, claims)
Controller->>Client: Return parsed endpoints<br/>& metadata
Client->>Client: Auto-fill form fields<br/>(authorization_endpoint,<br/>token_endpoint, etc.)
Client->>User: Show Discovery banner<br/>with populated fields
sequenceDiagram
participant User as OAuth User
participant Client as Web Client
participant Provider as Generic OAuth<br/>Provider
participant PolicyEval as Policy<br/>Evaluator
participant Controller as OAuth<br/>Controller
User->>Client: Click Custom OAuth Login
Client->>Provider: GetUserInfo + Token
Provider->>PolicyEval: Evaluate AccessPolicy<br/>against user claims
alt Policy Passes
PolicyEval-->>Provider: Allow
Provider-->>Controller: User Info
Controller-->>Client: Login Success
else Policy Fails
PolicyEval-->>Provider: Deny
Provider->>Provider: Render AccessDeniedMessage
Provider-->>Controller: AccessDeniedError
Controller-->>Client: Error + Custom Message
end
Client-->>User: Show access denied or redirect
sequenceDiagram
participant User
participant Settings as Settings UI
participant Controller as Custom OAuth<br/>Controller
participant DB as Database
User->>Settings: Configure Custom OAuth
User->>Settings: Set Icon, Policies, etc.
Settings->>Settings: Validate AccessPolicy<br/>(recursive structure)
User->>Settings: Click Save
Settings->>Controller: POST/PUT with Icon,<br/>AccessPolicy,<br/>AccessDeniedMessage
Controller->>DB: Create/Update CustomOAuthProvider
DB-->>Controller: Saved
Controller-->>Settings: Response with new fields
Settings-->>User: Success confirmation
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches
🧪 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 |
From upstream: imporve oauth provider UI/UX (QuantumNous#2983)
* feat: imporve UI/UX * fix: stabilize provider enabled toggle and polish custom OAuth settings UX * fix: add access policy/message templates and persist advanced fields reliably * fix: move template fill actions below fields and keep advanced form flow cleaner
Summary by CodeRabbit
Release Notes
New Features
Enhancements