Skip to content

feat(stack): let stacklets sign in through an OIDC provider - #123

Merged
arthware-dev merged 2 commits into
mainfrom
feat/oidc-contract
Sep 23, 2026
Merged

arthware-dev merged 2 commits into
mainfrom
feat/oidc-contract

Conversation

@arthware-dev

@arthware-dev arthware-dev commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Stacklets can sign in through another stacklet that provides OpenID Connect, without either naming the other. A client declares [oidc] and reads {oidc_issuer}, {oidc_client_id} and {oidc_client_secret}; a provider declares [oidc_provider] and registers clients through ctx.stack.oidc_clients() and ctx.stack.store_oidc_client(). Credentials stay in the provider's secret namespace, so destroying the provider switches every client back to its own login. stack doctor warns about a running client the provider has not registered, and about a second provider that is ignored.
  • Paperless shows "Sign in with family account" once a provider has registered the docs stacklet. Without a provider the login is unchanged. New accounts join the all_documents group.
  • Two commits that each stand alone: merge with rebase, not squash.

A stacklet can now use single sign-on from another stacklet without
either one naming the other.

- A client declares `[oidc]` (name, callbacks) and reads
  `{oidc_issuer}`, `{oidc_client_id}` and `{oidc_client_secret}`. All
  three stay empty until a provider has registered it, so the service
  keeps its own login until then.
- A provider declares `[oidc_provider]`. Its hooks list the clients
  with `ctx.stack.oidc_clients()` and store what the identity service
  issued with `ctx.stack.store_oidc_client()`.
- `stack doctor` warns about a running client that the running
  provider has not registered, and about a second provider that is
  ignored.

Credentials live in the provider's secret namespace, so destroying the
provider switches every client back to its own login.
When a stacklet that provides OpenID Connect is installed and has
registered the docs stacklet, Paperless shows a "Sign in with family
account" button next to the password form. Without a provider the
login is unchanged.

- A first login creates the Paperless account; an existing account is
  linked by verified email.
- New accounts join the `all_documents` group, which sees and edits the
  whole archive. The group and a one-time grant over existing documents
  are set up on the next `./stack up docs` after the provider exists.
- The provider entry keeps the id `pocketid`, which Paperless stores on
  every linked account. A second entry for the same client breaks the
  signup step in allauth, so there is exactly one.
@arthware-dev
arthware-dev merged commit f182b44 into main Sep 23, 2026
2 checks passed
@arthware-dev
arthware-dev deleted the feat/oidc-contract branch September 23, 2026 16:35
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