Repository navigation
Add generic apiKey security-scheme support alongside OAuth - #74
Merged
Merged
Conversation
added 3 commits
September 16, 2026 16:26
Clockify (and other static-key APIs) have no OAuth2 login, only a personal secret sent as a declared header/query parameter. The proxy previously assumed every catalog platform was OAuth2, from the consent-page provider gate through credential storage to how a proxied request's Authorization header was built. Add ApiKeyScheme/SecurityScheme (providers.rs) resolved generically from a platform's composed OpenAPI securitySchemes, a Catalog::security_scheme accessor, a browser-submitted-key branch in connect.rs's consent/authorize flow that completes the existing PKCE handoff without any third-party redirect, and a StoredCredential enum (unifying the previously duplicated OAuth credential struct in oauth.rs/proxy.rs) so proxy.rs::forward can inject a static key via its declared header/query name instead of always assuming Authorization: Bearer. No platform-specific behavior was added here; Clockify's own catalog entry belongs in localthought/overlays.
Missed from the previous commit: proves security_scheme()/allows()/ required_headers() resolve a real composed apiKey document correctly, mirroring this file's existing pinned-fixture test pattern.
# Conflicts: # src/proxy.rs # src/templates.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ApiKeyScheme/SecurityScheme(providers.rs), resolved generically from a platform's composed OpenAPIsecuritySchemes— no platform-specific behavior, per AGENTS.md.connect.rs's consent/authorize flow completes the existing PKCE handoff without any third-party redirect.oauth.rs/proxy.rs) into oneStoredCredentialenum, soproxy.rs::forwardcan inject a static key via its declared header/query name instead of always assumingAuthorization: Bearer.localthought/overlays; see companion PRs there and inlocalthought/openapi-directory.Test plan
cargo fmt --all -- --checkcargo clippy --all-targets --all-features -- -D warningscargo test -- --include-ignoredagainst a local Postgres (114/114 passing), including two new end-to-end tests exercising the full apiKey consent→authorize→redeem→forward flow