added: a public protocol package, client versions on integrations, and auth debug logging #11
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "integration-protocol"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When an app's client library spoke a different protocol than the Consent server, sign-in failed silently. Consent issued tokens the app could not decode, and nothing on either side said why. This PR makes that kind of mismatch visible and fixable, and adds a few operator conveniences.
Changes
consent api admins create HANDLEcreates the user, adds them toadmin, and prints a password link.make compose-adminuses it and no longer needsjq. While theadmingroup is empty,consent initprints the command to run.consent serve --verboselogs sign-ins, authorization requests, authorization codes, token exchanges, userinfo calls and sign-outs, with the reason for each refusal. Default logging is unchanged.pkg/protocol. A new public package for the contract between Consent and its apps: the protocol version, the endpoints apps call with their bodies, and the integration manifest. It imports only the standard library.pkg/clientbuilds on it, re-exports the types apps use, and no longer importsinternal/api, so apps stop linking Consent's server code.protocolandclient_version. Consent rejects a manifest whose protocol differs from its own, and says which side to upgrade. It records both values with each registration: migration 2 adds the columns, and existing registrations start at protocol 0. The Integrations page marks outdated registrations, andconsent initwarns about them on every start.AGENTS.mdnow requires a migration for every schema change and forbids editing a released one.What operators and integrations must do
git.sr.ht/~jakintosh/consentand redeploy. Then refresh each integration from its manifest in the admin UI. Registrations made before this change show as needing an upgrade until you do. Apps that useclient.UserInfoorclient.IntegrationManifestneed no source changes; those names remain as aliases.client.DecodeIntegrationManifestor using the manifest errors: switch topkg/protocol.--verbosetoCONSENT_SERVE_FLAGSto see authorization events.Testing
make testpasses on every commit.admins create, theinithint and warnings,--verboseoutput, and import of an old manifest against a local server.🤖 Generated with Claude Code
befd6174f7tob6b2018d18