Skip to content

feat(oauth): expose provider OAuth metadata + template scopes for white-label partners#401

Merged
angel-manuel merged 2 commits into
devfrom
feat/oauth-provider-metadata-and-template-scopes
Jun 15, 2026
Merged

feat(oauth): expose provider OAuth metadata + template scopes for white-label partners#401
angel-manuel merged 2 commits into
devfrom
feat/oauth-provider-metadata-and-template-scopes

Conversation

@angel-manuel

Copy link
Copy Markdown
Contributor

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/import the 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 from oauth_provider::get_by_key. WriteAcl (mirrors the sibling list GET /v1/oauth-providers).
  • TemplateDetail.scopes (templates.rs) — union of every action's required_scopes (same as platform_services::template_action_scopes), added to GET /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-api clean (offline).

🤖 Generated with Claude Code

…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>
@vercel

vercel Bot commented Jun 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
overslash Ready Ready Preview, Comment Jun 15, 2026 3:58pm

Request Review

@codecov

codecov Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@angel-manuel angel-manuel marked this pull request as ready for review June 15, 2026 14:56
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>
@angel-manuel angel-manuel merged commit b50e4f9 into dev Jun 15, 2026
15 checks passed
@angel-manuel angel-manuel deleted the feat/oauth-provider-metadata-and-template-scopes branch June 15, 2026 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant