You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
llm: extract shared OIDC config, move business logic to pkg/llm, add E2E tests (#5049)
* llm: extract shared OIDC config, move business logic to pkg/llm, add E2E tests
Three follow-up cleanups from the #5029 review (#5048):
1. Extract shared OIDC config type into pkg/oidc.ClientConfig. Both
config.RegistryOAuthConfig and llm.OIDCConfig are now type aliases for
this type, so field additions and validation changes apply to both
authentication flows without drift.
2. Move business logic from the CLI layer into pkg/llm per the cli-commands
convention. The config-set mutation/validation branch, the config-show
text formatter, and the cached-token deletion logic all live in pkg/llm
now. The CLI commands are thin wrappers that parse flags and delegate.
3. Add E2E tests for thv llm config set/show/reset, covering happy-path
round-trips, HTTPS enforcement, incremental configuration, the
not-configured message, and post-reset state.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* llm: fix errcheck lint failures in Show method
Show now returns an error and uses a writef closure to propagate the
first write failure rather than ignoring io.Writer errors. The CLI
caller is updated to return the error directly.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* llm: skip token deletion for providers that can't list or delete
Providers like the environment provider are read-only and cannot hold
cached tokens, so calling ListSecrets on them would always produce a
spurious warning during thv llm config reset. Check CanList/CanDelete
capabilities first and treat non-capable providers as a no-op.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* llm: add unit tests for SetFields, DeleteCachedTokens, and Show
Covers the business logic introduced in manage.go:
- SetFields: field mutation, partial vs full validation branching,
invalid-value rejection
- DeleteCachedTokens: capability no-ops (no CanList/CanDelete),
empty-scope no-op, scoped deletion, error propagation
- Show: not-configured message, required-field output, conditional
audience line, configured-tools section
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* test(e2e): configure environment secrets provider in llm config tests
Mirrors the pattern from cli_secrets_scoped_test.go to ensure the test
suite never opens the user's real keychain or 1Password. The environment
provider is non-interactive and read-only, so DeleteCachedTokens is a
no-op, keeping the tests fully hermetic.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: taskbot <taskbot@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
0 commit comments