feat(oauth): expose provider OAuth metadata + template scopes for white-label partners#401
Merged
angel-manuel merged 2 commits intoJun 15, 2026
Conversation
…te-label partners
Two read-only additions a white-label partner (Overfolder) needs to run the
token-vault flow generically (PR400 made it the token vault; partners run the
OAuth dance themselves):
- GET /v1/oauth-providers/{key}: full OAuth metadata for one provider
(authorization_endpoint, token_endpoint, userinfo_endpoint, supports_pkce,
supports_refresh, token_auth_method, extra_auth_params,
default_identity_scopes) — straight from the oauth_providers row, so partners
build authorize URLs + exchange codes without hardcoding per-provider config.
- TemplateDetail.scopes: union of every action's required_scopes, so partners
request exactly the scopes a service needs on the authorize URL.
Both are read-only; secrets stay on the partner side. WriteAcl on the provider
endpoint (mirrors the sibling list /v1/oauth-providers).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
PR #401 added GET /v1/oauth-providers/{key} and TemplateDetail.scopes with no tests, failing codecov/patch. Add integration coverage: - oauth_provider_detail_exposes_full_metadata: asserts the metadata fields (endpoints, flags, token_auth_method, identity scopes) and that no client secrets leak through the catalog endpoint. - oauth_provider_detail_unknown_key_404: unknown key -> 404. - test_global_template_detail_includes_scopes: google_calendar's required-scope union surfaces on the global detail (get_template path). - test_org_template_detail_includes_scopes: DB-tier template detail carries the scopes array (db_row_to_detail path). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Context
Pairs with Overfolder's white-label token-vault migration (PR400 / Overfolder PR #437). PR400 made white-label OAuth a token vault — partners (Overfolder) run the OAuth authorize + code-exchange dance themselves and
POST /v1/connections/importthe tokens. To do that generically (not hardcoding per-provider endpoints/params), the partner needs to read provider OAuth metadata and per-template scopes from Overslash. This PR exposes both — read-only, data that already exists.Changes
GET /v1/oauth-providers/{key}(oauth_providers.rs) — full OAuth metadata for one provider:authorization_endpoint,token_endpoint,userinfo_endpoint,supports_pkce,supports_refresh,token_auth_method,extra_auth_params,default_identity_scopes. Straight fromoauth_provider::get_by_key.WriteAcl(mirrors the sibling listGET /v1/oauth-providers).TemplateDetail.scopes(templates.rs) — union of every action'srequired_scopes(same asplatform_services::template_action_scopes), added toGET /v1/templates/{key}for both DB and global templates. So a partner requests exactly the scopes a service needs on the authorize URL.Secrets (client_id/secret) stay on the partner side; these endpoints return only catalog metadata.
Verification
cargo check -p overslash-api+cargo clippy -p overslash-apiclean (offline).🤖 Generated with Claude Code