mirror of
https://github.com/turnstonelabs/turnstone.git
synced 2026-08-12 23:12:23 -06:00
docs(mcp): align token-encryption + mint docstrings with oauth_obo
Startup key-enforcement counts ALL user-scoped auth types (oauth_user and oauth_obo, per is_user_scoped_auth), and the entra mint leg always carries scope=<audience>/.default (per-server oauth_scopes is ignored on that leg). The docstrings named only oauth_user / left the scope behavior ambiguous. Comment-only; no behavior change.
This commit is contained in:
@@ -8,8 +8,9 @@ BRIEFING.md ("Verified wire shapes") — every mock asserts the EXACT form
|
||||
payload posted to the IdP token endpoint (body-inspecting, not
|
||||
call-counting):
|
||||
|
||||
- entra: ONE refresh-token grant carrying ``scope=<audience>/.default``
|
||||
(or the per-server ``oauth_scopes`` override verbatim);
|
||||
- entra: ONE refresh-token grant always carrying
|
||||
``scope=<audience>/.default`` (per-server ``oauth_scopes`` is ignored
|
||||
on this leg — a bare scope list would drop the audience);
|
||||
- rfc8693: a refresh grant (NO scope key) for a subject token, then a
|
||||
token-exchange grant with ``audience=<server oauth_audience>`` and the
|
||||
per-server scope only when configured.
|
||||
|
||||
@@ -596,13 +596,14 @@ def initialize_mcp_crypto_state(app_state: object, *, node_id: str = "") -> None
|
||||
1. ``load_mcp_token_cipher_config()`` — wrapped in try/except. Raises
|
||||
:class:`SystemExit(1)` on :class:`MCPTokenKeyConfigError` after
|
||||
logging.
|
||||
2. Counts ``mcp_servers`` rows with ``auth_type='oauth_user'``. If
|
||||
2. Counts ``mcp_servers`` rows with a user-scoped ``auth_type``
|
||||
(``oauth_user`` or ``oauth_obo``; see ``is_user_scoped_auth``). If
|
||||
any exist AND no key is configured, raises ``SystemExit(1)``.
|
||||
Same enforcement when ``[oidc] capture_user_credential`` is
|
||||
enabled (the captured IdP credential must be encrypted at rest).
|
||||
3. On success, sets ``app_state.mcp_token_cipher`` and
|
||||
``app_state.mcp_token_store`` (both possibly ``None`` when no
|
||||
key + no oauth_user rows).
|
||||
key + no user-scoped rows).
|
||||
|
||||
The helper is shared by ``turnstone/server.py:_lifespan`` and
|
||||
``turnstone/console/server.py:_lifespan``. A separate
|
||||
|
||||
Reference in New Issue
Block a user