amsl

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: Apache-2.0 Imports: 0 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

AMSL for Go

Reusable application behavior, earned through real consumers.

This repository is the Go implementation home for AMSL. The module is github.com/ajent-social/go.

The first CANDIDATE implementation is servicecred, with a durable local bbolt adapter in servicecred/boltstore and a multi-host SQL adapter in servicecred/sqlstore for PostgreSQL-compatible servers (including SereneDB). It provides issue-once machine secrets, explicit owner/resource/scopes, mandatory expiry and durable revocation. It is proposed for maintainer review, not a stable or released security API.

The second CANDIDATE is mcpoauth, a bounded OAuth 2.1 authorization server for a single MCP protected resource with public PKCE clients, plus a bbolt reference store in mcpoauth/boltstore and a multi-host SQL adapter in mcpoauth/sqlstore. It is an owner-authorized adaptation of restricted product code; see the contract, provenance and worklog. Refresh token rotation with reuse-triggered family revocation is a new extension on top of the extracted authorization-code flow.

A third CANDIDATE is billing/checkout for durable customer binding and hosted checkout attempt recovery around an established payment provider. See billing checkout. Redirect URLs are not payment evidence; entitlement policy stays with the application.

A fourth CANDIDATE is billing/subscription for a durable verified-event inbox and local subscription projection after SDK signature verification. See billing subscription. Grace and past_due policy stay with the application. Checkout companions include billing/checkout/stripeadapt, billing/checkout/sqlstore, billing/portal (Stripe Customer Portal), billing/stripeverify (webhook signature → VerifiedEvent), and billing/entitlement (projection status gate).

Human auth CANDIDATEs for the hosted path: accounts, passkey (go-webauthn ceremonies; patterns informed by ajent-social human accounts, no private source copied), magiclink (email challenge tokens), oidc (OIDC authorization-code social login around go-oidc) with oidc/github, oidc/apple, and oidc/microsoft adapters, passwordreset, and deviceflow (RFC 8628 CLI login). Each of accounts/passkey/magiclink/oidc/tenant has a multi-host sqlstore adapter (PostgreSQL-compatible, including SereneDB). Browser session cookies remain REFERENCE_EXISTING (e.g. SCS).

Additional identity/delivery CANDIDATEs: mcpclientoauth (product as OAuth client to remote MCP servers; sealed token blobs), publishablekey (embeddable public keys with origin allowlists; complements servicecred), webhookegress (HMAC-signed outbound webhooks), and webhookingress (verify inbound AMSL X-AMSL-Signature headers; provider webhooks stay with their SDKs / billing/stripeverify).

Hosted instance lifecycle CANDIDATE: tenant coordinates slug → provision → ready → upgrade/destroy around a product Runtime (typically Pulumi containerdeploy + tenantdnstls). Call billing/entitlement before Request.

Additional CANDIDATEs: usage (bounded meters), sealedvault (caller-sealed ciphertext only).

Proposed delivery component (not yet a CANDIDATE): cliagent with cmd/amsl-agent-plugin generates Codex, Claude Code and Cursor plugins for an existing CLI from a reviewed declarative spec and serves the spec's declared commands as a stdio MCP server on the official MCP Go SDK. No capability inference, shell or generic command tool. See docs/cli-agent-plugins.md; host installation is not yet verified.

Composition recipe (CLI → hosted multi-tenant paid MCP with user/billing management and passkey/magic/OIDC auth): docs/recipes/cli-to-hosted-paid-mcp.md.

Read the contract, provenance and alternatives, and implementation worklog before adopting it. Applications retain login, authorization, account-status and paid-access policy. The bbolt adapter uses local file locks and is supported on Unix platforms listed in the contract; on other platforms, provide another Store implementation. sqlstore accepts an application-owned *sql.DB; swap PostgreSQL ↔ SereneDB (or another compatible server) by changing the driver and DSN only.

go vet ./...
go test -race ./...
# sqlstore tests need a PostgreSQL-compatible server; CI sets AMSL_SQLSTORE_TEST_DSN, or locally:
#   createdb -h /tmp amsl_servicecred_test
#   AMSL_SQLSTORE_TEST_DSN='host=/tmp dbname=amsl_servicecred_test sslmode=disable'

Use established libraries for crypto, sessions, payment clients and MCP. See contributing and the canonical RFC.

Documentation

Overview

Package amsl documents the Go implementation home of the Ajent Agent-Maintained Standard Library. The servicecred and mcpoauth subpackages are candidate runtime implementations pending maintainer review.

Capability contracts and lifecycle evidence live in https://github.com/ajent-social/capabilities. Proposed behavior must not be treated as an implemented or consumer-verified guarantee.

Directories

Path Synopsis
Package accounts is a thin subject registry for linking auth methods.
Package accounts is a thin subject registry for linking auth methods.
sqlstore
Package sqlstore persists accounts via database/sql against PostgreSQL-compatible servers (PostgreSQL, SereneDB, and others that speak the same dialect).
Package sqlstore persists accounts via database/sql against PostgreSQL-compatible servers (PostgreSQL, SereneDB, and others that speak the same dialect).
billing
checkout
Package checkout coordinates durable local customer binding and hosted checkout attempts around an established payment provider.
Package checkout coordinates durable local customer binding and hosted checkout attempts around an established payment provider.
checkout/sqlstore
Package sqlstore persists checkout bindings and attempts in PostgreSQL-compatible SQL.
Package sqlstore persists checkout bindings and attempts in PostgreSQL-compatible SQL.
checkout/stripeadapt
Package stripeadapt implements checkout.Provider with the official Stripe Go SDK.
Package stripeadapt implements checkout.Provider with the official Stripe Go SDK.
entitlement
Package entitlement gates product actions on subscription projection status.
Package entitlement gates product actions on subscription projection status.
portal
Package portal opens Stripe Billing Portal sessions for self-serve billing management (invoices, payment method, cancel) around an existing customer ref.
Package portal opens Stripe Billing Portal sessions for self-serve billing management (invoices, payment method, cancel) around an existing customer ref.
stripeverify
Package stripeverify verifies Stripe webhook signatures using the official stripe-go webhook helpers and maps events into subscription.VerifiedEvent fields for AcceptVerifiedEvent.
Package stripeverify verifies Stripe webhook signatures using the official stripe-go webhook helpers and maps events into subscription.VerifiedEvent fields for AcceptVerifiedEvent.
subscription
Package subscription keeps a durable inbox of signature-verified provider events and a local per-customer subscription projection.
Package subscription keeps a durable inbox of signature-verified provider events and a local per-customer subscription projection.
subscription/sqlstore
Package sqlstore persists subscription event inbox and projections in PostgreSQL-compatible SQL (PostgreSQL, SereneDB, and similar).
Package sqlstore persists subscription event inbox and projections in PostgreSQL-compatible SQL (PostgreSQL, SereneDB, and similar).
Package cliagent turns an explicit, reviewed description of an existing command-line tool into coding-agent host plugins (Codex, Claude Code and Cursor) and serves that description as a stdio MCP server.
Package cliagent turns an explicit, reviewed description of an existing command-line tool into coding-agent host plugins (Codex, Claude Code and Cursor) and serves that description as a stdio MCP server.
cmd
amsl-agent-plugin command
Command amsl-agent-plugin generates Codex, Claude Code and Cursor plugins for an existing CLI from a reviewed cliagent spec, checks generated output for drift, and serves the spec's declared tools as a stdio MCP server.
Command amsl-agent-plugin generates Codex, Claude Code and Cursor plugins for an existing CLI from a reviewed cliagent spec, checks generated output for drift, and serves the spec's declared tools as a stdio MCP server.
Package deviceflow coordinates the OAuth 2.0 device authorization grant (RFC 8628) against a configured authorization server.
Package deviceflow coordinates the OAuth 2.0 device authorization grant (RFC 8628) against a configured authorization server.
Package magiclink issues and consumes single-use email sign-in challenges.
Package magiclink issues and consumes single-use email sign-in challenges.
sqlstore
Package sqlstore persists magiclink challenges via database/sql against PostgreSQL-compatible servers (PostgreSQL, SereneDB, and similar).
Package sqlstore persists magiclink challenges via database/sql against PostgreSQL-compatible servers (PostgreSQL, SereneDB, and similar).
Package mcpclientoauth coordinates OAuth 2.1 authorization-code + PKCE when the product is the client connecting to remote authorization servers (for example remote MCP servers).
Package mcpclientoauth coordinates OAuth 2.1 authorization-code + PKCE when the product is the client connecting to remote authorization servers (for example remote MCP servers).
internal/lifecycletest
Package lifecycletest exercises the coordinator against actual store adapters.
Package lifecycletest exercises the coordinator against actual store adapters.
memory
Package memory provides an ephemeral lifecycle store.
Package memory provides an ephemeral lifecycle store.
sqlstore
Package sqlstore persists mcpclientoauth state via database/sql.
Package sqlstore persists mcpclientoauth state via database/sql.
Package mcpoauth implements a bounded OAuth 2.1 authorization server for a single protected resource with public PKCE clients, as used by an MCP server.
Package mcpoauth implements a bounded OAuth 2.1 authorization server for a single protected resource with public PKCE clients, as used by an MCP server.
boltstore
Package boltstore is a durable single-process mcpoauth.Store backed by bbolt.
Package boltstore is a durable single-process mcpoauth.Store backed by bbolt.
sqlstore
Package sqlstore persists mcpoauth.Store state via database/sql against PostgreSQL-compatible servers (PostgreSQL, SereneDB, and others that speak the same SQL dialect and wire protocol).
Package sqlstore persists mcpoauth.Store state via database/sql against PostgreSQL-compatible servers (PostgreSQL, SereneDB, and others that speak the same SQL dialect and wire protocol).
Package oidc coordinates OAuth 2.0 + OpenID Connect authorization-code login for social identity providers around the maintained go-oidc and golang.org/x/oauth2 libraries.
Package oidc coordinates OAuth 2.0 + OpenID Connect authorization-code login for social identity providers around the maintained go-oidc and golang.org/x/oauth2 libraries.
apple
Package apple helps configure Sign in with Apple for oidc.New.
Package apple helps configure Sign in with Apple for oidc.New.
github
Package github provides a non-OIDC OAuth 2.0 adapter for GitHub login that produces oidc.Identity and shares oidc.Store for pending state and bindings.
Package github provides a non-OIDC OAuth 2.0 adapter for GitHub login that produces oidc.Identity and shares oidc.Store for pending state and bindings.
microsoft
Package microsoft provides Microsoft identity platform presets for oidc.New.
Package microsoft provides Microsoft identity platform presets for oidc.New.
sqlstore
Package sqlstore persists OIDC pending states and bindings via database/sql.
Package sqlstore persists OIDC pending states and bindings via database/sql.
Package passkey coordinates discoverable, user-verified WebAuthn ceremonies around the maintained go-webauthn library.
Package passkey coordinates discoverable, user-verified WebAuthn ceremonies around the maintained go-webauthn library.
memory
Package memory is an in-memory passkey.Store for tests and single-process demos.
Package memory is an in-memory passkey.Store for tests and single-process demos.
sqlstore
Package sqlstore persists passkey ceremonies and credentials via database/sql against PostgreSQL-compatible servers (PostgreSQL, SereneDB, and similar).
Package sqlstore persists passkey ceremonies and credentials via database/sql against PostgreSQL-compatible servers (PostgreSQL, SereneDB, and similar).
Package passwordreset issues and consumes single-use password-reset tokens.
Package passwordreset issues and consumes single-use password-reset tokens.
sqlstore
Package sqlstore persists password-reset challenges via database/sql.
Package sqlstore persists password-reset challenges via database/sql.
Package publishablekey issues browser-embeddable public identifiers with hashed storage and optional origin allowlists.
Package publishablekey issues browser-embeddable public identifiers with hashed storage and optional origin allowlists.
sqlstore
Package sqlstore persists publishable keys via database/sql.
Package sqlstore persists publishable keys via database/sql.
Package sealedvault stores caller-sealed ciphertext blobs.
Package sealedvault stores caller-sealed ciphertext blobs.
sqlstore
Package sqlstore persists sealed vault records via database/sql.
Package sqlstore persists sealed vault records via database/sql.
Package servicecred implements scoped, revocable machine credentials.
Package servicecred implements scoped, revocable machine credentials.
boltstore
Package boltstore persists service credentials in bbolt on a local filesystem on platforms with Unix flock support.
Package boltstore persists service credentials in bbolt on a local filesystem on platforms with Unix flock support.
sqlstore
Package sqlstore persists service credentials via database/sql against PostgreSQL-compatible servers (PostgreSQL, SereneDB, and others that speak the same SQL dialect and wire protocol).
Package sqlstore persists service credentials via database/sql against PostgreSQL-compatible servers (PostgreSQL, SereneDB, and others that speak the same SQL dialect and wire protocol).
Package tenant coordinates durable per-account instance lifecycle for hosted product deployments (slug → provision → ready → upgrade/destroy).
Package tenant coordinates durable per-account instance lifecycle for hosted product deployments (slug → provision → ready → upgrade/destroy).
sqlstore
Package sqlstore persists tenant instances via database/sql against PostgreSQL-compatible servers.
Package sqlstore persists tenant instances via database/sql against PostgreSQL-compatible servers.
Package usage meters bounded consumption per owner and period.
Package usage meters bounded consumption per owner and period.
sqlstore
Package sqlstore persists usage counters via database/sql.
Package sqlstore persists usage counters via database/sql.
Package webhookegress registers HTTPS webhook endpoints, signs payloads, and delivers events with bounded concurrency and per-owner rate limits.
Package webhookegress registers HTTPS webhook endpoints, signs payloads, and delivers events with bounded concurrency and per-owner rate limits.
sqlstore
Package sqlstore persists webhook endpoints and deliveries via database/sql.
Package sqlstore persists webhook endpoints and deliveries via database/sql.
Package webhookingress verifies inbound AMSL HMAC webhook signatures.
Package webhookingress verifies inbound AMSL HMAC webhook signatures.

Jump to

Keyboard shortcuts

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