Portiko

module
v0.0.0-...-effd219 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2026 License: MIT

README

Portiko

A passkey-first identity provider you run yourself, and the libraries that sign people in to your sites.

The entrance column of Kolonnade, spelled with a K for keys: the door it fronts opens with a passkey, never a password.

Go and PostgreSQL, built on zitadel/oidc so the OAuth and OpenID Connect machinery comes from a maintained implementation rather than from us.

Status: early. The provider and the relying-party library are here and running a private deployment, but nothing is tagged and the API is still moving. Treat main as a preview and pin a commit if you depend on it.

What it does

  • Passkeys, and nothing to remember. Enrollment, sign-in and recovery, with the credential-flag and sign-count rules synced passkeys actually need.
  • Passkey management. People list, rename and revoke their own passkeys; the last one cannot be removed. See docs/passkeys.md.
  • One sign-in across your sites, whether they share a domain or not. No third-party cookies.
  • Several signed-in accounts at once, numbered from 0 the way people expect, with each site signed in as whichever account the person picked for it.
  • Sign-out that arrives, through OpenID Connect Back-Channel Logout, and profile changes pushed to sites as Shared Signals events instead of waiting for the next token refresh.
  • Apps as well as websites. OpenID Connect Native SSO, so a family of apps on one device share a sign-in without sharing a refresh token, plus native passkey ceremonies. Swift first, in portiko-swift; Android later.
  • Extension points where your product differs. The profile — display name, avatar, whatever your product means by it — is an interface with a default implementation, not something baked in.
  • Conformance as a release gate, not an aspiration: the OpenID Foundation's suite runs before a release goes out.

What it will not do

Portiko answers who is this person. It never answers what may they do — no roles, no permissions, no admin flags in the provider or in its tokens. Authorization belongs to your application, which is the only thing that knows what its own data means.

Documentation

Written ahead of the code, so the implementation has something to be checked against:

  • Opinions — the positions that shape the API
  • Several signed-in accounts — the session model, and how sites, single-page apps and native apps each say which account they mean
  • Registration — who may create an account: the REGISTRATION and BOOTSTRAP_CODE settings, and enrolling the first one
  • Recovery — losing a passkey, an email, or both: the ladder and the rules every path follows
  • Key rotation — how the signing key is stored, and the three-step rotation an operator drives
  • Conformance runs — the release gate: which OpenID plans, where they run, and the harness that signs the suite in with a virtual passkey
  • Email addresses — backup addresses: adding one, making it primary, removing one, and the MAX_EMAILS limit
  • Site sessions — keeping a site's sessions in PostgreSQL with rp/session/pgstore, sealed at rest, so a deploy does not sign everyone out
  • Rate limits — what is limited, and the TRUSTED_PROXIES setting a deployment behind a proxy needs
  • Test mail domains — the TEST_MAIL_DOMAINS setting, which writes sign-in codes for reserved test domains to the log so an end-to-end test can sign up
  • Serving under a path — an ISSUER with a path (https://host/id), how to mount Handler(), and the cookie that results

Packages

  • provider — run the identity provider.
  • rp — sign a site in with it.
  • rp/session — server-side sessions for that site.
  • rp/session/pgstore — those sessions in PostgreSQL, sealed at rest, so they survive a restart (docs).
  • verify — check Portiko tokens on an API: access tokens, logout and event tokens, with a cached key set.
  • verify/verifytest — mint test tokens against an in-process key, no provider needed.

To run the provider inside your own program: call provider.Migrate before provider.New (it is safe on every start), register your own sites with (*Provider).RegisterClient, and pass Options.Mailer to send mail some other way than SMTP, Options.RegistrationPolicy to decide at runtime who may create an account (see docs/registration.md), and Options.OnSignInEvent to watch each stage of sign-in as a funnel (see docs/sign-in-events.md). The portiko command does the same with portiko migrate and portiko register-client.

Import these; don't copy them. If you need something under internal/, open an issue asking for a public API.

When there is something to use

go get github.com/Kolonnade/Portiko

Until then, watching this repository for Releases is the way to hear about the first one.

Security

Report vulnerabilities privately — see the security policy. Never in a public issue.

License

MIT, once the code lands.

Directories

Path Synopsis
cmd
portiko command
Command portiko runs a Portiko identity provider with the built-in extension points: a display name and emoji avatar for the profile, and email by SMTP.
Command portiko runs a Portiko identity provider with the built-in extension points: a display name and emoji avatar for the profile, and email by SMTP.
internal
accounts
Package accounts implements the three WebAuthn ceremonies — registration, login and recovery — over Postgres.
Package accounts implements the three WebAuthn ceremonies — registration, login and recovery — over Postgres.
config
Package config loads runtime configuration from the environment.
Package config loads runtime configuration from the environment.
keys
Package keys manages the ES256 signing keys and the key set derived from them.
Package keys manages the ES256 signing keys and the key set derived from them.
localpath
Package localpath decides whether a return address is a path on this site.
Package localpath decides whether a return address is a path on this site.
mailer
Package mailer delivers the provider's messages to an account holder.
Package mailer delivers the provider's messages to an account holder.
passkey
Package passkey wraps go-webauthn with this service's registration policy and the credential handling rules that WebAuthn gets wrong by default.
Package passkey wraps go-webauthn with this service's registration policy and the credential handling rules that WebAuthn gets wrong by default.
store
Package store is Portiko's persistence: accounts, passkeys, ceremonies, browser sessions, clients, authorization requests and refresh tokens, all in PostgreSQL so a deployment can run more than one replica and survive a restart mid-sign-in.
Package store is Portiko's persistence: accounts, passkeys, ceremonies, browser sessions, clients, authorization requests and refresh tokens, all in PostgreSQL so a deployment can run more than one replica and survive a restart mid-sign-in.
Package migrations holds Portiko's schema as ordered SQL files, in the golang-migrate naming scheme (NNNNNN_name.up.sql / .down.sql).
Package migrations holds Portiko's schema as ordered SQL files, in the golang-migrate naming scheme (NNNNNN_name.up.sql / .down.sql).
Package profile holds what an account holder chooses to be shown as: a display name and one of a fixed set of emoji avatars.
Package profile holds what an account holder chooses to be shown as: a display name and one of a fixed set of emoji avatars.
Package protocol defines the wire contract shared by the accounts service and every relying party: the protocol version, how versions are negotiated, the discovery documents, and the claim and error names.
Package protocol defines the wire contract shared by the accounts service and every relying party: the protocol version, how versions are negotiated, the discovery documents, and the claim and error names.
Package provider is Portiko's identity provider: passkey ceremonies, a set of signed-in accounts per browser, and an OpenID Connect provider built on zitadel/oidc that issues audience-scoped tokens to every site.
Package provider is Portiko's identity provider: passkey ceremonies, a set of signed-in accounts per browser, and an OpenID Connect provider built on zitadel/oidc that issues audience-scoped tokens to every site.
rp
Package rp is the relying-party half of Portiko: everything a website needs to sign people in against a Portiko provider.
Package rp is the relying-party half of Portiko: everything a website needs to sign people in against a Portiko provider.
session
Package session holds the relying party's own session: the server-side record of a signed-in browser, plus the cookie that points at it.
Package session holds the relying party's own session: the server-side record of a signed-in browser, plus the cookie that points at it.
session/pgstore
Package pgstore is a session.Store in PostgreSQL, so a site's sessions survive a restart and are shared by every replica.
Package pgstore is a session.Store in PostgreSQL, so a site's sessions survive a restart and are shared by every replica.
Package server is the Portiko command: it runs the provider and the operator commands that register the sites allowed to sign people in.
Package server is the Portiko command: it runs the provider and the operator commands that register the sites allowed to sign people in.
Package verify checks Portiko tokens wherever they arrive from the network: at a relying party (back-channel logout tokens, pushed security events) and at a resource-server API (bearer access tokens).
Package verify checks Portiko tokens wherever they arrive from the network: at a relying party (back-channel logout tokens, pushed security events) and at a resource-server API (bearer access tokens).
verifytest
Package verifytest mints Portiko-shaped tokens against an in-process key, so an API's tests can exercise verify without running a provider.
Package verifytest mints Portiko-shaped tokens against an in-process key, so an API's tests can exercise verify without running a provider.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL