Repository navigation
Delegated sign-in and app-minted sessions - #2
Merged
Merged
Conversation
- POST /v1/apps/self/users/{subject}/sessions: a trust_email linked app mints an
ordinary cvs_ session for one of its users (201 {token, user_id, expires_at},
Cache-Control: no-store). 404 unknown_subject, 403 account_disabled /
trust_email_required, per-app limit limits.app_sessions_per_minute (default 60),
audit app.user.session, metrics app_sessions_created_total /
app_sessions_rate_limited_total. /v1/info features gain app_sessions.
- [[delegated_sign_in]] {id, name, start_url}: validated at load, listed after
[[oidc]] in /v1/info auth.oidc and GET /v1/auth/oidc with kind "delegated";
OIDC entries gain kind "oidc". GET /v1/auth/oidc/{id}/start checks
redirect_uri (same origin as public_url, no fragment) and redirects to
start_url?redirect_uri=..., so the browser protocol is the same as OIDC.
/account renders them as buttons; doctor lists sign-in providers.
- Docs: auth.md (Delegated sign-in), apps.md, configuration.md, operations.md,
security.md, architecture.md, OpenAPI, CHANGELOG.
This was referenced Oct 20, 2026
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.
Lets another site act as a sign-in provider for canvas-cloud, and lets a linked app mint a session for one of its users.
Endpoint
POST /v1/apps/self/users/{subject}/sessions(app key alone, optional{}body) →201 {token: "cvs_…", user_id, expires_at}, withCache-Control: no-store.create_sessionpath, table and 30-day sliding expiry as login and OIDC.X-Canvas-User→ 400trust_email→403 trust_email_required404 unknown_subject403 account_disabledlimits.app_sessions_per_minute(default 60, envCANVAS_CLOUD_LIMITS__APP_SESSIONS_PER_MINUTE) →429 rate_limitedapp.user.session, detail{subject}, never the token) and metricsapp_sessions_created_total/app_sessions_rate_limited_total./v1/infoaddsapp_sessionstofeaturesandapp_sessions_per_minutetolimits.Config
[[oidc]]inGET /v1/auth/oidc→providersand in/v1/info→auth.oidc(still an array). Each entry is{id, name, start: "/v1/auth/oidc/{id}/start", kind: "delegated", start_url}.kind: "oidc". This is additive.GET /v1/auth/oidc/{id}/start?redirect_uri=Xfor a delegated id:public_url, with no fragment or credentials; otherwise400 redirect_uri_not_allowed;302tostart_url?…&redirect_uri=X(no-store,Referrer-Policy: no-referrer, no cookie or state).X#token=cvs_…orX#error=…, so the browser protocol is the same as OIDC. Clients (canvas-appparseProviders,/account) work unchanged becausestartstays server-relative.canvas-cloud doctorprints onesign-inline per provider.Docs
OidcProvider.kind/start_url,AppSession.Tests
apps/tests/sessions.rs: mint, expiry, user agent, audit; the token works as the user; every refusal; per-app rate limit.accounts/tests/delegated.rs: listing with kind; the start redirect keeps the existing query; badredirect_uricases.canvas-cloud/tests/app.rs: listing → start → provision → mint →/v1/auth/me→ logout.cargo fmt --check, clippy-D warningsand the full workspace test suite pass locally (268 tests). Also smoke-tested on a real server withdoctor,/v1/info, start, mint and/auth/me.