feat: generic OAuth infrastructure + plugin/tooling refactors (72f..5fe)#125
feat: generic OAuth infrastructure + plugin/tooling refactors (72f..5fe)#125
Conversation
…types) Assisted-by: droid:kimi-k2.6
Assisted-by: droid:kimi-k2.6
…plugins Assisted-by: droid:kimi-k2.6
Assisted-by: droid:kimi-k2.6
Assisted-by: pi:gpt-5.4
869d628 to
5fe712a
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5fe712aea7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if s.oauthRegistry != nil { | ||
| credSvc.SetRegistry(s.oauthRegistry) | ||
| credSvc.SetProviderPluginIDs(s.providerPluginIDs) |
There was a problem hiding this comment.
Wire OAuth registry into pool manager
This setup only applies the manifest OAuth registry to credSvc, but never to s.poolManager before SetVaultEnvLoader is called. After this commit, session env sources are oauth.*, and injectSessionEnv resolves them through TokenManager.GetOAuthToken, which now returns an error when no registry is set. As a result, runner sessions will silently skip injecting GH_TOKEN/Lark OAuth env vars, so authenticated tool invocations in sandboxes lose credentials.
Useful? React with 👍 / 👎.
| _ = s.InvalidateUser(userID) | ||
| } | ||
| return toFlowStatus(status), completed, nil | ||
| broker, err := s.getBroker(ctx, provider, "") |
There was a problem hiding this comment.
Poll OAuth flows with the correct flow broker type
PollFlow always calls getBroker(..., ""), and getBroker falls back to the first configured flow when no type is requested. For providers that expose both authorization_code and device_code (like builtin GitHub), this selects the auth-code broker during polling even when StartFlow started a device flow. When the flow reaches authorized, the *DeviceCodeBroker branch is skipped, so the token is never completed/saved before the flow is deleted.
Useful? React with 👍 / 👎.
| clientID, _ := state.Config["client_id"].(string) | ||
| clientSecret, _ := state.Config["client_secret"].(string) | ||
| if clientID == "" || clientSecret == "" { | ||
| return nil, fmt.Errorf("github OAuth app is not configured (set client_id and client_secret in tool/gh plugin)") | ||
| return nil, fmt.Errorf("%s OAuth app is not configured (set client_id and client_secret in %s plugin)", providerID, pluginID) |
There was a problem hiding this comment.
Use Lark plugin credential keys that actually exist
The generic broker now hardcodes client_id/client_secret for all providers, but the tool/lark-cli plugin configuration schema still uses app_id/app_secret. With this mismatch, Lark provider status/start flow will report OAuth app not configured even when users filled the plugin form correctly, effectively breaking Lark OAuth connections.
Useful? React with 👍 / 👎.
📊 Coverage ReportTotal coverage: 44.3% Per-package breakdown |
Remove the Go-registered gh plugin so GitHub CLI is manifest-only, uses the public GitHub CLI OAuth device-flow client, and no longer needs admin config or prompt injection. Assisted-by: pi:gpt-5.4
78fa02c to
8a2d8dc
Compare
Show manifest-backed tools and hooks only in their semantic plugin tabs, add manifest badges, add install editing, and provide an Add CLI tool flow that writes plugins.yaml and syncs automatically. Keep Lark CLI OAuth brand/provider alignment and request-origin redirect defaults. Assisted-by: pi:gpt-5.4
8a2d8dc to
eb48a33
Compare
Summary
This PR applies the OAuth/tooling refactor series on top of
mainat76d32fa7...and restores the intended ordering:72f6720dadd generic OAuth infrastructure (bundle/registry/brokers/types)c77e6293add manifest OAuth provider parsing and validation788bdf40wire generic OAuth registry into service, admin, runner, and plugins3d51e0b3remove legacy OAuth bundle types and dead code5fe712aesimplify embedded tool management (removes old embedded tool manifest/download/registry flow)Resulting change set
docs/content/docs/plugins/*,internal/*,plugins/tools/*)Commit count
5 commits
Notes
This branch now contains
72f6720das the first commit in the PR and5fe712aeas tip.