Skip to content

Releases

v0.21.0 (forfait v0.1.4, mcpauth v0.3.2)

Choose a tag to compare

@saravenpi saravenpi released this 16 Nov 00:05
65b282d

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 roles claim 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 roles claim means no
    roles; invalid_grant or 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
    per ClaimsTTL and locks nobody out. The table is in docs/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 an invalid_grant the 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.

Known limits

  • Clearing the roles after a refusal is a read then a Save of the whole row, because
    IdentityStore has 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 ProvisionBearer has no refresh token. A CLI session
    on it keeps the roles of the provisioning token for one ClaimsTTL, 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 roles for 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 sets OIDC_CLAIMS_SCOPE cannot sign in to it at all. Unchanged here; it needs a
    decision between Registre (emit []) and the callback.

Added

  • pg.NewFromEnv(db) and pg.ResealInBackground(ctx, store, logger), with
    pg.TokenKeyEnv. They are newPorteStore and resealInBackground from the porte_seal.go
    that 15 apps carry (13 byte-identical in package 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-only PORTE_TOKEN_KEY logged a failed reseal at each boot;
    the store's own sealer decides now and that case is silent.
  • porte.ConfigFromEnv(get, defaults) reads the OIDC_* block and SSO_ONLY that 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 reason docs/configuration.md gave for not reading the
    environment. It lives in the root package and does not use tronc/env: the root package is
    standard library only, and with the reader passed in there is nothing left for tronc/env to
    do. defaults carries what differs per app (see docs/configuration.md). It does not fail on
    an unset OIDC_ISSUER, which means "OIDC off" in the suite; it fails on everything Validate
    fails on and on an SSO_ONLY that is not a boolean.
  • kit.NewDeletions(kit.DeletionsConfig{...}) and kit.ErasedGuard, plus
    pg.DeletionState, (*pg.Store).DeletionState(), pg.DeletionStateTable and
    pg.DeletionStateSchema. The 19 apps that receive Registre's erasure notice all verify it
    through directory.Deletions.Handler already, 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 a StateStore over a one-row table; those are what moved. The deletion
    of the app's own data stays the app's OnPersonDeleted callback.

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 forfait no longer carry replace ... => ./directory. Both build
    against the tagged directory v0.5.0 they require (forfait required 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 for forfait: 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 a go.work over all four modules.
  • mcpauth requires porte v0.21.0, forfait v0.1.4 and tronc v0.21.0, and drops its three
    replaces too. That is a second commit, tagged mcpauth/v0.3.2, made after the root and
    forfait tags: a module without a replace cannot require a version that is not published
    yet. So a release that changes the root and mcpauth together 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 tidy

No 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 to Domain; Antenne and sonar to PublicURL + "/"; Bobine to PUBLIC_URL.
  • MobileRedirect: Bulle studio.facile.bulle://auth, Place studio.facile.place://auth, Courrier and Sablier DefaultMobileRedirect.
  • SSOOnly: true for Gare.
  • ExtraScopes and ExtraClaims (connections) for ...
Read more

v0.20.2

Choose a tag to compare

@saravenpi saravenpi released this 14 Nov 04:03
d108a59

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 behind porte.BrowserTokenPrefix (b~). Before,
    only IssueFor's own tests pinned it, so an exchange handler switched to IssueCookieFor
    would have handed a CLI a token that passes mcpauth.RequireOwnSession as 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
    call local.Kit.Login (local/local.go:241) with it, which mints a b~ token through
    IssueCookieFor and 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 call SetPassword; a federated-only app is not
    affected. Not changed in this release.

Fixed

  • oidc/backchannel.go: the keyFetchFailure comment now names the check order it relies on.
    go-oidc v3.20.0's IDTokenVerifier.Verify runs verifyJWT (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)

Choose a tag to compare

@saravenpi saravenpi released this 14 Nov 03:13
4590c5f

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 with X-Facile-CSRF, such a token passed
    mcpauth.RequireOwnSession, so an agent holding it could confirm its own pending MCP action.
    porte.BrowserTokenPrefix is now b~: ~ is not in the base64url alphabet, so no plain token
    can carry it, and it is an RFC 6265 cookie-octet, so http.SetCookie writes it unquoted and
    r.Cookie reads it back. Authenticate sets Identity.BrowserSession only for a b~ cookie
    token on an unlabelled row; a b- token is plain. Issue and IssueFor also 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)

Choose a tag to compare

@saravenpi saravenpi released this 13 Nov 23:06
488334a

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 any Authorization header; 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 an Authorization header
    next to the cookie, and a porte/keys API key. What it guarantees: the token in the cookie
    came out of IssueCookieFor (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's mcp.ErrDelegated.
  • porte.Identity.BrowserSession, set by session.Manager.Authenticate when 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; Issue and IssueFor (CLI code exchange, device exchange, mobile)
    keep plain tokens. Why a mark on the token and not an origin column: 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.0 porte_login_codes precedent). The stored hash
    covers the prefix, so adding b- to a CLI token makes it fail its lookup (401). A session
    minted before v0.20.0 has no mark and fails closed for RequireOwnSession only.
  • mcpauth.AccountExists(ctx, info, lookup): the "account still exists" check six apps copy into
    their tool userOf. It resolves the Verifier token's user and reads it with the app's own
    lookup; a token from elsewhere or a failed lookup is ErrNoAccount, wrapping the lookup's error.
  • forfait: (*LimitError).PlanLimit() (key, upgradeURL string), the method tronc v0.23.0's
    mcp.Failure looks 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 of ProvisionBearer) and directory_erased.json
    (Deletions.Erased and the Holds re-erasure). Every vector's source names 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 the failed to verify signature: fetching keys prefix; 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.mod requires directory v0.5.0, as the root module now does; the
    replace ../ made CI's nested-module step ask for go mod tidy on the v0.19.0 commit. No
    mcpauth code change in that fix alone; it ships in mcpauth/v0.3.0.

v0.19.0 (directory v0.5.0)

Choose a tag to compare

@saravenpi saravenpi released this 12 Nov 09:34

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 optional Deletions.Holds field is
    asked for every handled subject that arrives again; when it reports an account, the person is
    erased again (OnPersonDeleted, then Erase) and recorded again, on push and on poll. Only
    that subject is touched, and the callbacks were already required to be idempotent. Nil
    Holds keeps 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 reads State on
    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. No StateStore method is added.
  • pg: (*Store).HoldsIdentity(ctx, provider, subject) (bool, error), the Deletions.Holds
    for every porte/pg app, matching the provider exactly as EraseIdentity does.
  • porte.ErasedSubjects (the Erased method above) and porte.ErrSubjectErased.
  • oidc.Deps.Erased: when set, the login callback, ProvisionBearer and RouteSyncProfile
    refuse an erased identity before UpsertFromOIDC with a tronc permission_denied (403)
    wrapping porte.ErrSubjectErased. ProvisionBearer also wraps ErrProvisionRefused, so
    mcpauth answers an invalid token. A ledger read error fails closed as an internal error. This
    is the guard Prisme wrote in its own auth.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 directory v0.5.0, so directory/v0.5.0 is tagged first.

directory/v0.5.0

Choose a tag to compare

@saravenpi saravenpi released this 12 Nov 09:34

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 optional Deletions.Holds field is
    asked for every handled subject that arrives again; when it reports an account, the person is
    erased again (OnPersonDeleted, then Erase) and recorded again, on push and on poll. Only
    that subject is touched, and the callbacks were already required to be idempotent. Nil
    Holds keeps 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 reads State on
    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. No StateStore method is added.
  • pg: (*Store).HoldsIdentity(ctx, provider, subject) (bool, error), the Deletions.Holds
    for every porte/pg app, matching the provider exactly as EraseIdentity does.
  • porte.ErasedSubjects (the Erased method above) and porte.ErrSubjectErased.
  • oidc.Deps.Erased: when set, the login callback, ProvisionBearer and RouteSyncProfile
    refuse an erased identity before UpsertFromOIDC with a tronc permission_denied (403)
    wrapping porte.ErrSubjectErased. ProvisionBearer also wraps ErrProvisionRefused, so
    mcpauth answers an invalid token. A ledger read error fails closed as an internal error. This
    is the guard Prisme wrote in its own auth.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 directory v0.5.0, so directory/v0.5.0 is tagged first.

v0.18.3

Choose a tag to compare

@saravenpi saravenpi released this 10 Nov 20:21

Root module: v0.18.3; nested modules unchanged. Deprecation; no migration.

Deprecated

  • A kit.Store literal is deprecated: build the store with kit.NewStore. Since v0.18.2
    only a store built by NewStore writes created_at and updated_at on 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 store NewStore did not build logs one warning per
    process, the first time it inserts or updates an account (UpsertFromOIDC or
    BackfillPictures), naming the literal, the NULL timestamps and kit.NewStore. One per
    process, not per call, so a busy app's logs carry the signal without the flood. The warning
    goes to Store.Logger, or slog.Default() when it is nil. It runs no extra query and changes
    no write. Go's Deprecated: marker is not used: it attaches to an identifier, and the only
    identifier here is the Store type that NewStore itself returns, so marking it would flag
    every correct caller. The deprecation is in the doc comments of Store, UpsertFromOIDC and
    BackfillPictures instead. EraseAccount only deletes and does not warn. No route, status
    code, cookie, CSRF rule, /auth/config body or pg.Schema changes.

v0.18.2

Choose a tag to compare

@saravenpi saravenpi released this 10 Nov 20:06

Root module: v0.18.2; nested modules unchanged. Fix; no migration.

Fixed

  • porte/kit fills the timestamps a GORM table leaves without a default, and names the rest.
    kit.Store created an account with an insert naming only the columns it knows. About half the
    suite's apps create users with GORM AutoMigrate, which declares created_at and
    updated_at with no DEFAULT because GORM filled them in Go. Agenda's first kit sign-up wrote
    created_at NULL and was fixed in the app with an OnCreate hook; every other GORM app would
    have hit the same thing silently. kit.NewStore now reads the table's columns once, at
    construction. Columns gains CreatedAt and UpdatedAt: the kit writes now() into both on
    insert and into UpdatedAt on every update it makes (sign-in refresh, BackfillPictures).
    Left empty, a timestamp column named created_at or updated_at with 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
    OnCreate is set. It is a warning, not an error: some apps leave columns NULL on purpose.
    OnCreate runs after the insert and wins, so Agenda's hook, which also sets created_at = now(), writes the same transaction timestamp and nothing conflicts. NewStore also fails at
    boot when the table or a named column is missing, which used to fail at the first sign-in.
    A kit.Store literal behaves exactly as in v0.18.1, so Sonde, Antenne, Capsule, Agenda and
    Casier see no change until they move to NewStore. No route, status code, cookie, CSRF rule,
    /auth/config body or pg.Schema changes, and oidc, session and pg are untouched.

v0.18.1

Choose a tag to compare

@saravenpi saravenpi released this 10 Nov 19:44

Root module: v0.18.1; nested modules unchanged. Fix; no migration.

Fixed

  • porte/kit treats <issuer> and <issuer>/ as one provider everywhere. The sign-in lookup,
    the second-subject refusal and EraseAccount compared 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's oidc, session and pg packages, routes, status codes, cookies, CSRF
    rule, /auth/config body and pg.Schema are unchanged. Apps with mixed rows can adopt
    kit.Store and the erase hook without a data migration.

v0.18.0 (directory v0.4.0)

Choose a tag to compare

@saravenpi saravenpi released this 10 Nov 18:37

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 of kit.Mount, and no existing route, status code, cookie, CSRF
    rule, /auth/config body or pg.Schema changes. It registers GET /me/invitations, which
    reads the signed-in user's Registre subject from the identity store (the row filed under the
    issuer), asks Registre's GET /api/directory/invitations with 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) is ErrUnavailable. One call is bounded by
    InvitationsTimeout (2 seconds) whatever the caller's deadline. An empty subject is
    ErrNoSubject and sends nothing.
  • The root module now requires directory; its replace ./directory serves this repository's
    builds and is ignored by consumers, so directory/v0.4.0 is tagged first.

Changed

  • Licence: porte is now licensed under MIT (see LICENSE); before this, the repository carried no licence. The nested directory, forfait and mcpauth modules carry the same file.