Repository navigation
Releases
v0.21.0 (forfait v0.1.4, mcpauth v0.3.2)
Tags: v0.21.0 and forfait/v0.1.4 on 65b282d, mcpauth/v0.3.2 on 895704c. directory stays at v0.5.0. Additive, apart from the security fix. No migration, no route, CSRF or pg.Schema change, and no change to the notice Registre sends.
Upgrade note. Only an app that sets OIDC_CLAIMS_SCOPE sees a behaviour change: a role the
provider no longer confirms is dropped within one ClaimsTTL (five minutes) and stays dropped
until the person signs in again. See Security.
Security
-
A revoked role survived until the session expired, up to thirty days.
oidc.Kit.Attach
kept the cached roles on every refresh failure and stamped them fresh. Three paths led there,
and each is reproduced by a test that fails on v0.20.2:- the provider refused the refresh with
invalid_grant(a revoked grant, a disabled account); - the last role was revoked. Registre leaves the
rolesclaim out of an ID token for a person
with no role, and the refresh read a missing claim as a provider fault, as the login
callback does; - the stored access token was still valid.
oauth2's token source then returns it without
calling the provider, so no ID token arrived and roles were only ever re-read after the
access token expired, one hour with Registre's default.
A row with no refresh token (after a failed profile sync cleared it, or an account created by
bearer provisioning) took the first path too.
Now the refresh always spends the refresh token; a response with no
rolesclaim means no
roles;invalid_grantor a missing refresh token clears the roles on the identity and on the
row. A provider that cannot be reached, a 5xx or an ID token that does not verify keeps the
cached roles and stamps the attempt, as before, so an outage costs one token call per person
perClaimsTTLand locks nobody out. The table is indocs/configuration.md.This is the Go side of porte-rs issue 6. The suggested "do not stamp on a transient failure"
was not taken: without the stamp every request of every signed-in person calls the token
endpoint for as long as the provider is down.Two things keep the stricter rule from dropping roles by accident. One refresh per identity
runs at a time in a process (singleflight), because Registre rotates the refresh token on
every use and refuses the second spender. And after aninvalid_grantthe row is read again:
if it holds another refresh token, a second replica or a new sign-in rotated it, and that
row's roles are used. The refresh runs on a context the request cannot cancel, 30 seconds at
most, and saves the rotated tokens even when the ID token is unusable, so a closed tab cannot
strand a rotated token. - the provider refused the refresh with
Known limits
- Clearing the roles after a refusal is a read then a
Saveof the whole row, because
IdentityStorehas no narrower write for roles and adding a method would break every app
that implements the interface. A sign-in that lands between the two is overwritten: the
person then holds no roles and signs in once more. - A profile sync that fails for any reason, a network error included, still clears the stored
tokens (oidc/handlers.go, unchanged). The next role refresh then finds no refresh token and
drops the roles. Fail closed, and recoverable by signing in, but a provider blip during a
profile sync now costs an admin their roles where it used to cost nothing. - An account that only ever came through
ProvisionBearerhas no refresh token. A CLI session
on it keeps the roles of the provisioning token for oneClaimsTTL, then none, until a
browser sign-in. - Roles are still not a kill switch for the session itself. A disabled account is ended by the
back-channel logout, which Registre delivers once. - Registre omits
rolesfor a person with none, and the login callback still refuses a token
without the claim ("the provider is missing its scope mapping"). So a person with no role in
an app that setsOIDC_CLAIMS_SCOPEcannot sign in to it at all. Unchanged here; it needs a
decision between Registre (emit[]) and the callback.
Added
pg.NewFromEnv(db)andpg.ResealInBackground(ctx, store, logger), with
pg.TokenKeyEnv. They arenewPorteStoreandresealInBackgroundfrom theporte_seal.go
that 15 apps carry (13 byte-identical inpackage main, Capsule and Prisme identical but for
package auth), moved as they are. One difference: the copy decided whether to reseal from
the raw variable, so a whitespace-onlyPORTE_TOKEN_KEYlogged a failed reseal at each boot;
the store's own sealer decides now and that case is silent.porte.ConfigFromEnv(get, defaults)reads theOIDC_*block andSSO_ONLYthat 22 apps
map by hand, and validates it. The variable names are the ones every app already uses: no app
uses another name for any of them. It takes the reader as an argument (nil means
os.Getenv), so porte still reads nothing on its own and a test can build two configurations
in one process, which was the reasondocs/configuration.mdgave for not reading the
environment. It lives in the root package and does not usetronc/env: the root package is
standard library only, and with the reader passed in there is nothing left fortronc/envto
do.defaultscarries what differs per app (seedocs/configuration.md). It does not fail on
an unsetOIDC_ISSUER, which means "OIDC off" in the suite; it fails on everythingValidate
fails on and on anSSO_ONLYthat is not a boolean.kit.NewDeletions(kit.DeletionsConfig{...})andkit.ErasedGuard, plus
pg.DeletionState,(*pg.Store).DeletionState(),pg.DeletionStateTableand
pg.DeletionStateSchema. The 19 apps that receive Registre's erasure notice all verify it
throughdirectory.Deletions.Handleralready, so verification, parsing, idempotency and the
response codes were never copied and are untouched. What each app repeated is the wiring
(credentials from the sign-in config,EraseIdentity,HoldsIdentity, a nil-safe
ErasedSubjects) and aStateStoreover a one-row table; those are what moved. The deletion
of the app's own data stays the app'sOnPersonDeletedcallback.
Changed
- The root module requires tronc v0.21.0, up from v0.10.1. v0.21.0 is the lowest tronc any app
on porte pins, so the bump moves no app. It is not v0.25.0, tronc's latest, on purpose: the
floor of a library is what consumers are forced up to, and 21 apps sit below v0.25.0. - The root module and
forfaitno longer carryreplace ... => ./directory. Both build
against the taggeddirectoryv0.5.0 they require (forfaitrequired v0.2.1 and was only
ever built against the working tree, so that floor was untested). This reverses the choice
recorded under v0.18.0 and forforfait: a replace is invisible to consumers, but it also
hides a floor that no longer compiles. What it gave, one module's change tested against the
others before a tag, is now a CI step that builds ago.workover all four modules. mcpauthrequires porte v0.21.0, forfait v0.1.4 and tronc v0.21.0, and drops its three
replaces too. That is a second commit, taggedmcpauth/v0.3.2, made after the root and
forfaittags: a module without a replace cannot require a version that is not published
yet. So a release that changes the root andmcpauthtogether is now two pull requests.
MIGRATION
Nothing here is forced by the upgrade: every app copy keeps compiling against v0.21.0. An app that sets OIDC_CLAIMS_SCOPE (Antenne, Boutique, Bulle, Echo, Journal, Place read it) gets the role-refresh fix on upgrade, with no code change.
Upgrade first:
go get github.com/FacileStudio/porte@v0.21.0
# only if the app requires them; use `go mod edit`, since `go get` on a nested module
# also probes an old root tag with a bad checksum
go mod edit -require=github.com/FacileStudio/porte/mcpauth@v0.3.2
go mod edit -require=github.com/FacileStudio/porte/forfait@v0.1.4
go mod tidyNo app pins tronc below v0.21.0, so the new floor moves nobody.
1. Token sealing
| Delete | apps/api/porte_seal.go in Agenda, Antenne, Bulle, Casier, Courrier, Echo, Journal, Nuage, Opus, Plume, Sablier, Sonde, Vision; apps/api/modules/auth/porte_seal.go in Capsule and Prisme |
| Import | none new: portepg "github.com/FacileStudio/porte/pg" is already there |
| Replace | newPorteStore(sqlDB) with portepg.NewFromEnv(sqlDB); resealInBackground(ctx, store, logger) with portepg.ResealInBackground(ctx, store, logger) |
Same variable (PORTE_TOKEN_KEY), same error text, same two log lines. Keep forwarding the variable in compose. Gare (modules/auth/seal.go) and sonar (internal/server/env.go) read the key through their own config and do other things with it (Gare warns when it is unset, sonar seals its keyring with the same sealer): they can call portepg.ResealInBackground and keep the rest.
2. OIDC configuration
| Delete | the OIDC_* reads in apps/api/internal/env/env.go (Gare: internal/daemon/config.go, Mycelium: internal/env/env.go, sonar: internal/server/env.go), and the app's OIDCConfig struct with its method that copies it into a porte.Config, where the app has one |
| Import | "github.com/FacileStudio/porte" |
| Replace | with cfg, err := porte.ConfigFromEnv(os.Getenv, porte.Config{ /* defaults */ }) |
Every app uses the same variable names, so none needs renaming. What differs per app goes in defaults:
SuccessURL: Agenda, Capsule, Casier, Courrier, Opus, Perception, Sablier fall back to the first CORS origin; Plume and Vision toDomain; Antenne and sonar toPublicURL + "/"; Bobine toPUBLIC_URL.MobileRedirect: Bullestudio.facile.bulle://auth, Placestudio.facile.place://auth, Courrier and SablierDefaultMobileRedirect.SSOOnly: truefor Gare.ExtraScopesandExtraClaims(connections) for ...
v0.20.2
Tags: root module v0.20.2 only; mcpauth, forfait and directory unchanged. No
behaviour change, no migration, no route, CSRF or pg.Schema change.
Tests
- The CLI code exchange, the device exchange and the mobile (PKCE) exchange are now asserted to
return a plain session token, never one behindporte.BrowserTokenPrefix(b~). Before,
onlyIssueFor's own tests pinned it, so an exchange handler switched toIssueCookieFor
would have handed a CLI a token that passesmcpauth.RequireOwnSessionas a cookie, with
every test green.
Known limits
- A CLI session can still obtain a browser token when local login is enabled and the account
has no password.local.Kit.SetPassword(local/local.go:310) asks for no confirmation,
because the account has no current password, so the caller's session is its only evidence.
A caller holding a plain CLI, device or mobile session token can set a first password, then
calllocal.Kit.Login(local/local.go:241) with it, which mints ab~token through
IssueCookieForand returns it in the JSON body. That token passes
RequireOwnSession. This is the same class as the v0.20.0 limit (local login and magic link
return the browser token in their body), with one extra step. It is open only where an app
mounts local login and lets a session callSetPassword; a federated-only app is not
affected. Not changed in this release.
Fixed
oidc/backchannel.go: thekeyFetchFailurecomment now names the check order it relies on.
go-oidc v3.20.0'sIDTokenVerifier.VerifyrunsverifyJWT(signature,verify.go:336)
before it reads issuer, audience or expiry (verify.go:237-281), so a key-fetch failure is
reported before any claim. Comment only.
v0.20.1 (mcpauth v0.3.1)
Tags: root module v0.20.1; mcpauth v0.3.1 (its go.mod requires porte v0.20.1, so
apps that take the fix through mcpauth get it; both tags on the same commit). forfait and
directory unchanged. No migration, no route, CSRF or pg.Schema change.
Upgrade note. Browser logins minted by v0.20.0 (b-) lose their mark: they still
authenticate, but RequireOwnSession refuses them (403) until the person signs in once more.
Security
- A plain session token could pass as a browser login. v0.20.0 marked browser logins with
b-, but a plain token is base64url of 32 random bytes, so about one in 4096 of them (CLI code
exchange, device exchange, mobile, and every session minted before v0.20.0) also starts with
b-. Sent as the session cookie withX-Facile-CSRF, such a token passed
mcpauth.RequireOwnSession, so an agent holding it could confirm its own pending MCP action.
porte.BrowserTokenPrefixis nowb~:~is not in the base64url alphabet, so no plain token
can carry it, and it is an RFC 6265 cookie-octet, sohttp.SetCookiewrites it unquoted and
r.Cookiereads it back.AuthenticatesetsIdentity.BrowserSessiononly for ab~cookie
token on an unlabelled row; ab-token is plain.IssueandIssueForalso redraw any token
that starts with the browser prefix, so a later prefix change cannot reopen this. Found in the
porte-rs v0.8.0 review.
v0.20.0 (mcpauth v0.3.0, forfait v0.1.3)
Tags: root module v0.20.0; mcpauth v0.3.0 (its go.mod requires porte v0.20.0
for Identity.BrowserSession, so both tags go on the same commit); forfait v0.1.3;
directory unchanged. No migration, no route, CSRF or pg.Schema change. A browser login's
session token now starts with b- (see NewBrowserToken); existing sessions keep working.
Upgrade note. An app that adopts RequireOwnSession needs each person to sign in once in the
browser after deploying v0.20.0 before they can confirm a pending action: a cookie minted before
the upgrade has no b- mark and is refused (403) by the helper only. It still authenticates for
everything else, so nobody is signed out.
Added
mcpauth.RequireOwnSession(r): only the person's own browser session confirms a pending MCP
action. The confirm pages decided this five different ways: Courrier, Agenda and Opus refused
only delegated tokens, so an agent holding the person's CLI or API token could confirm its own
courrier_send; Nuage, Sablier and Plume also required a session row, which an opaque bearer
or a named API token has; Capsule refused anyAuthorizationheader; Mycelium accepted only a
browser session. The helper takes the strictest rule: the session cookie carrying a token a
browser login minted, and nothing else. It refuses every bearer (opaque session, named API
token, JWT, delegated or not, machine token), a named API token sent as a cookie, a CLI,
device or mobile session token sent as a cookie, a request carrying anAuthorizationheader
next to the cookie, and aporte/keysAPI key. What it guarantees: the token in the cookie
came out ofIssueCookieFor(OIDC web callback, local login, register, password change,
magic link). What it does not: local login and magic link also return that token in their
JSON body, so a CLI that signs in with the person's password or mailbox holds a browser token. A request with no porte
identity is the 401 the apps answered; every other refusal is one 403,ErrNotOwnSession,
with the text of tronc'smcp.ErrDelegated.porte.Identity.BrowserSession, set bysession.Manager.Authenticatewhen the credential came
from the session cookie, the row is not a named API token, and the token starts with
porte.BrowserTokenPrefix(b-). The bearer JWT path clears it. Nothing else sets it.porte.NewBrowserToken():b-+NewToken().session.Manager.IssueCookieFor(and so
IssueCookie) mints it;IssueandIssueFor(CLI code exchange, device exchange, mobile)
keep plain tokens. Why a mark on the token and not anorigincolumn: about fourteen apps keep
their own copy of porte's DDL in goose migrations, so a column means a migration in each and a
broken login until it lands (the v0.10.0porte_login_codesprecedent). The stored hash
covers the prefix, so addingb-to a CLI token makes it fail its lookup (401). A session
minted before v0.20.0 has no mark and fails closed forRequireOwnSessiononly.mcpauth.AccountExists(ctx, info, lookup): the "account still exists" check six apps copy into
their tooluserOf. It resolves the Verifier token's user and reads it with the app's own
lookup; a token from elsewhere or a failed lookup isErrNoAccount, wrapping the lookup's error.- forfait:
(*LimitError).PlanLimit() (key, upgradeURL string), the method tronc v0.23.0's
mcp.Failurelooks for, so a plan refusal reaches an MCP client as the plan-limit failure with
no app code. - Conformance vectors a port reads:
exchange_errors.json(the token endpoint's answer to an
RFC 8693 exchange, mapped to token, reconnect, refused or unavailable),mcpauth_tokens.json
(audience, issuer, expiry, scope and provisioning outcomes),provision_bearer.json(the email,
roles, store and erased-subject refusals ofProvisionBearer) anddirectory_erased.json
(Deletions.Erasedand theHoldsre-erasure). Every vector'ssourcenames the release tag.
Fixed
- oidc: back-channel logout answers 503
unavailable("could not fetch the provider keys") when
the provider's JWKS cannot be fetched, as porte-rs does, instead of 401. The failure is the
app's, not the token's, so 503 is the correct status, and it lets a provider retry. Registre
delivers a logout once today and treats every status alike, so a deactivation during a JWKS
outage still leaves the person's sessions alive until they expire; a bounded retry on 5xx in
Registre would close that. Every other verification failure stays 401. go-oidc formats the fetch error
with%v, so the kit matches thefailed to verify signature: fetching keysprefix; the
vector cases "the provider keys are unreachable" and "the provider keys answer an error" fail
if a go-oidc upgrade changes it. - build(mcpauth): its
go.modrequiresdirectoryv0.5.0, as the root module now does; the
replace ../made CI's nested-module step ask forgo mod tidyon the v0.19.0 commit. No
mcpauth code change in that fix alone; it ships inmcpauth/v0.3.0.
v0.19.0 (directory v0.5.0)
Root module: v0.19.0; directory v0.5.0; forfait and mcpauth unchanged. Additive; no
migration, no route, cookie, CSRF, /auth/config or pg.Schema change, and every conformance
vector is unchanged.
Fixed
directory: an account re-created after an erasure is erased again, without a restart.
The receiver records every handled subject and skipped any later notice for it. When the
account came back for that subject (a Bulle provisioning call, a bearer token minted before
the erasure, a JIT or MCP first call), a re-pushed or re-polled notice was skipped as handled,
so the account survived (Prisme, 2026-11-11). The new optionalDeletions.Holdsfield is
asked for every handled subject that arrives again; when it reports an account, the person is
erased again (OnPersonDeleted, thenErase) and recorded again, on push and on poll. Only
that subject is touched, and the callbacks were already required to be idempotent. Nil
Holdskeeps the old skip, so existing apps compile and behave as before until they set it.
The alternative, re-running the callbacks for every repeat, would re-erase the subjects of
every poll's one-minute overlap, and an app whose callback refuses an unknown subject would
then fail every poll.
Added
directory:(*Deletions).Erased(ctx, provider, subject) (bool, error). It readsStateon
every call, never the receiver's in-memory copy, so a replica that does not run the receiver
answers the same and a sign-in never waits for a poll. NoStateStoremethod is added.pg:(*Store).HoldsIdentity(ctx, provider, subject) (bool, error), theDeletions.Holds
for every porte/pg app, matching the provider exactly asEraseIdentitydoes.porte.ErasedSubjects(theErasedmethod above) andporte.ErrSubjectErased.oidc.Deps.Erased: when set, the login callback,ProvisionBearerandRouteSyncProfile
refuse an erased identity beforeUpsertFromOIDCwith a troncpermission_denied(403)
wrappingporte.ErrSubjectErased.ProvisionBeareralso wrapsErrProvisionRefused, so
mcpauth answers an invalid token. A ledger read error fails closed as an internal error. This
is the guard Prisme wrote in its ownauth.Erased, moved to the one write path every app
shares. The tombstone lasts as long as the receiver keeps the subject (DeletionRetention,
60 days); Registre never reuses a subject, so the guard only has to outlast the race.- The root module requires
directoryv0.5.0, sodirectory/v0.5.0is tagged first.
directory/v0.5.0
Root module: v0.19.0; directory v0.5.0; forfait and mcpauth unchanged. Additive; no
migration, no route, cookie, CSRF, /auth/config or pg.Schema change, and every conformance
vector is unchanged.
Fixed
directory: an account re-created after an erasure is erased again, without a restart.
The receiver records every handled subject and skipped any later notice for it. When the
account came back for that subject (a Bulle provisioning call, a bearer token minted before
the erasure, a JIT or MCP first call), a re-pushed or re-polled notice was skipped as handled,
so the account survived (Prisme, 2026-11-11). The new optionalDeletions.Holdsfield is
asked for every handled subject that arrives again; when it reports an account, the person is
erased again (OnPersonDeleted, thenErase) and recorded again, on push and on poll. Only
that subject is touched, and the callbacks were already required to be idempotent. Nil
Holdskeeps the old skip, so existing apps compile and behave as before until they set it.
The alternative, re-running the callbacks for every repeat, would re-erase the subjects of
every poll's one-minute overlap, and an app whose callback refuses an unknown subject would
then fail every poll.
Added
directory:(*Deletions).Erased(ctx, provider, subject) (bool, error). It readsStateon
every call, never the receiver's in-memory copy, so a replica that does not run the receiver
answers the same and a sign-in never waits for a poll. NoStateStoremethod is added.pg:(*Store).HoldsIdentity(ctx, provider, subject) (bool, error), theDeletions.Holds
for every porte/pg app, matching the provider exactly asEraseIdentitydoes.porte.ErasedSubjects(theErasedmethod above) andporte.ErrSubjectErased.oidc.Deps.Erased: when set, the login callback,ProvisionBearerandRouteSyncProfile
refuse an erased identity beforeUpsertFromOIDCwith a troncpermission_denied(403)
wrappingporte.ErrSubjectErased.ProvisionBeareralso wrapsErrProvisionRefused, so
mcpauth answers an invalid token. A ledger read error fails closed as an internal error. This
is the guard Prisme wrote in its ownauth.Erased, moved to the one write path every app
shares. The tombstone lasts as long as the receiver keeps the subject (DeletionRetention,
60 days); Registre never reuses a subject, so the guard only has to outlast the race.- The root module requires
directoryv0.5.0, sodirectory/v0.5.0is tagged first.
v0.18.3
Root module: v0.18.3; nested modules unchanged. Deprecation; no migration.
Deprecated
- A
kit.Storeliteral is deprecated: build the store withkit.NewStore. Since v0.18.2
only a store built byNewStorewritescreated_atandupdated_aton a table without
database defaults. A literal still compiles and still writes NULL there, and that is how a
regression reached production. The literal stays legal, because removing it would break every
app that has not moved yet. Instead, a storeNewStoredid not build logs one warning per
process, the first time it inserts or updates an account (UpsertFromOIDCor
BackfillPictures), naming the literal, the NULL timestamps andkit.NewStore. One per
process, not per call, so a busy app's logs carry the signal without the flood. The warning
goes toStore.Logger, orslog.Default()when it is nil. It runs no extra query and changes
no write. Go'sDeprecated:marker is not used: it attaches to an identifier, and the only
identifier here is theStoretype thatNewStoreitself returns, so marking it would flag
every correct caller. The deprecation is in the doc comments ofStore,UpsertFromOIDCand
BackfillPicturesinstead.EraseAccountonly deletes and does not warn. No route, status
code, cookie, CSRF rule,/auth/configbody orpg.Schemachanges.
v0.18.2
Root module: v0.18.2; nested modules unchanged. Fix; no migration.
Fixed
porte/kitfills the timestamps a GORM table leaves without a default, and names the rest.
kit.Storecreated an account with an insert naming only the columns it knows. About half the
suite's apps createuserswith GORMAutoMigrate, which declarescreated_atand
updated_atwith no DEFAULT because GORM filled them in Go. Agenda's first kit sign-up wrote
created_atNULL and was fixed in the app with anOnCreatehook; every other GORM app would
have hit the same thing silently.kit.NewStorenow reads the table's columns once, at
construction.ColumnsgainsCreatedAtandUpdatedAt: the kit writesnow()into both on
insert and intoUpdatedAton every update it makes (sign-in refresh,BackfillPictures).
Left empty, a timestamp column namedcreated_atorupdated_atwith no default, identity or
generated expression is adopted; one with a default stays the database's.Store.Unwritten()
lists the nullable columns with no default the insert leaves out, logged once at warn when no
OnCreateis set. It is a warning, not an error: some apps leave columns NULL on purpose.
OnCreateruns after the insert and wins, so Agenda's hook, which also setscreated_at = now(), writes the same transaction timestamp and nothing conflicts.NewStorealso fails at
boot when the table or a named column is missing, which used to fail at the first sign-in.
Akit.Storeliteral behaves exactly as in v0.18.1, so Sonde, Antenne, Capsule, Agenda and
Casier see no change until they move toNewStore. No route, status code, cookie, CSRF rule,
/auth/configbody orpg.Schemachanges, andoidc,sessionandpgare untouched.
v0.18.1
Root module: v0.18.1; nested modules unchanged. Fix; no migration.
Fixed
porte/kittreats<issuer>and<issuer>/as one provider everywhere. The sign-in lookup,
the second-subject refusal andEraseAccountcompared the stored provider to the presented one
exactly. A person whose identity was stored in the other spelling was not found by subject, fell
through to the verified-email rule, and could get a second identity of the same provider linked
to their account; an erasure notice in the other spelling erased nothing. Apps configured the
issuer both ways over time (Casier ignores the slash), so production rows mix the two. One
helper now gives both spellings and every lookup, the backfill and the invitations subject
included, matches either, preferring the exact one when both exist. No schema change, no row
rewritten, and porte'soidc,sessionandpgpackages, routes, status codes, cookies, CSRF
rule,/auth/configbody andpg.Schemaare unchanged. Apps with mixed rows can adopt
kit.Storeand the erase hook without a data migration.
v0.18.0 (directory v0.4.0)
Root module: v0.18.0; directory v0.4.0; forfait and mcpauth unchanged. Additive; no
migration. Both tags carry the MIT LICENSE files.
Added
kit.MountInvitations: pending space invitations for every app's user menu, written once.
Opt-in and additive: not part ofkit.Mount, and no existing route, status code, cookie, CSRF
rule,/auth/configbody orpg.Schemachanges. It registersGET /me/invitations, which
reads the signed-in user's Registre subject from the identity store (the row filed under the
issuer), asks Registre'sGET /api/directory/invitationswith the directory credentials, and
answers{"count": n, "href": url}: the one invitation's page when n is 1, else
{issuer}/spaces. Every failure answers 200{"count":0}and logs at warn, because a menu
badge must never fail a page. Answers, failures included, are cached per user for 60 seconds
in a bounded cache, and concurrent requests for one user share one Registre call: each call
costs Registre an argon2 verification, and under load it answers 503, which must not be
retried by every page.kit.InvitationsRoute()documents the route for tronc/apiref. See
docs/kit.md. The alternative was twenty hand-written copies of the same route.directory:Client.Invitations(ctx, subject). Reuses the client's Basic auth and issuer
handling. Strict about what it accepts: a count that disagrees with the list, trailing data, an
invitation without an id or with a link off the issuer's origin, or a body over
MaxInvitationsBytes(64 KiB) isErrUnavailable. One call is bounded by
InvitationsTimeout(2 seconds) whatever the caller's deadline. An empty subject is
ErrNoSubjectand sends nothing.- The root module now requires
directory; itsreplace ./directoryserves this repository's
builds and is ignored by consumers, sodirectory/v0.4.0is tagged first.
Changed
- Licence: porte is now licensed under
MIT(seeLICENSE); before this, the repository carried no licence. The nesteddirectory,forfaitandmcpauthmodules carry the same file.