feat(32.2-01): administrator-only MCP grants and a configurable consent handoff

- pact: MCPGrant.Subject with MCPGrantSubjectBackend, MCPSubject.ScopeLimited
- pier: a backend-subject grant resolves straight to a scope-limited backend
  subject bound to oauth:backend:<client>:<admin>, no link lookup, no ceiling
- pier: the backend guard scope-limits ScopeLimited subjects like g15_ tokens
- wristband: Options.ConsentPath and Options.DefaultScopes; defaults unchanged
- smoke tests TestBackendSubjectSmoke (Postgres) and TestConsentPathSmoke
This commit is contained in:
Jakub Zych
2026-11-21 00:06:19 +01:00
parent 45eb34e5c4
commit c63bfa3ef2
12 changed files with 506 additions and 33 deletions

View File

@@ -90,6 +90,21 @@ type Options struct {
// from issuance (PHP OAuthCodeManager::REFRESH_TTL_DAYS, D-03). PHP
// default: 30 days.
RefreshTokenTTL time.Duration
// ConsentPath is appended to Issuer for the MCP authorize handoff: the
// page the browser is sent to with ?request=<id> after a valid
// authorize request. Empty or unset means "/connect", the PHP handoff,
// so the redirect bytes stay identical to the PHP server. A host whose
// consent page lives elsewhere on the same origin (for example under
// the admin prefix) sets the path here. The OIDC flavour ignores it.
ConsentPath string
// DefaultScopes is what an MCP authorize request gets when it names no
// data scope (an absent, empty or identity-only scope value). Only the
// names the server accepts (ScopesSupported, resolved) are kept; empty
// or unset, or empty after that filter, means the PHP default ["read"].
// The OIDC flavour ignores it.
DefaultScopes []string
}
// DefaultOptions returns PHP-parity defaults for every metadata option