AccountsAdminServices
tai42_contract.accounts.provider.AccountsAdminServices
AccountsProviderSettings.admin — accounts plugins never import the
application package, so this Protocol is the only way plugin code can
create a principal, apply a role template, remove a principal’s policy,
or flip the disabled marker. Every method mutates application-owned
principal and policy state; the plugin never touches that state directly.
Members
create_principal
tai42_contract.accounts.provider.AccountsAdminServices.create_principal
human principal authenticates through an accounts provider; a
service principal holds keys only. created_by is the principal
id that created this one, or None for the setup door. Raises loudly
if the principal already exists or the role is unknown.
Parameters
apply_role
tai42_contract.accounts.provider.AccountsAdminServices.apply_role
remove_policy
tai42_contract.accounts.provider.AccountsAdminServices.remove_policy
set_user_disabled
tai42_contract.accounts.provider.AccountsAdminServices.set_user_disabled
AccountsProvider
tai42_contract.accounts.provider.AccountsProvider
validate_token — the
same seam every credential passes through — so installing an accounts
provider never adds a second enforcement pathway.
Session tokens are opaque strings minted and stored by the provider
(recommended prefix tai-sess- to distinguish them from sk- API
keys at a glance); the contract never parses token contents. Storage,
hashing, and lifetime are provider-owned.
Login/lifecycle HTTP routes (submit endpoints, redirect flows) are
shipped by the provider plugin as ordinary router modules; the contract
carries only the metadata that lets a generic login screen render them.
Members
login_methods
tai42_contract.accounts.provider.AccountsProvider.login_methods
readiness_targets).
revoke_session
tai42_contract.accounts.provider.AccountsProvider.revoke_session
token if it is this provider’s.
Returns True when a session was found and revoked; False
when the token is not this provider’s (wrong prefix, unknown). The
application’s single logout route dispatches across ALL registered
accounts providers, so implementations must answer False for
foreign tokens instead of raising. Backend errors still raise
(fail closed).
Parameters
AccountsProviderSettings
tai42_contract.accounts.provider.AccountsProviderSettings
redis and admin are typed loosely for the same reason
IdentityProviderSettings.redis is Any: the contract cannot name
application or kit types. admin carries the application’s
AccountsAdminServices implementation.
Attributes
LoginAttachingProvider
tai42_contract.accounts.provider.LoginAttachingProvider
isinstance-check for it: a provider whose login lives at
an external issuer (OIDC) does not implement it, and the caller reports the
login as not attached.
Ownership of a principal’s disable/delete follows the login: the principals
door asks every registered attaching provider has_login, and a
principal some provider claims is managed through that provider’s users door
(which cleans its login row and runs its own guard), never the principals
door.
Members
has_login
tai42_contract.accounts.provider.LoginAttachingProvider.has_login
user_id.
The principals door reads this to decide who owns a principal’s
disable/delete: a True means the provider holds the credential, so the
principal is managed through that provider’s users door; a False means
it does not (a service principal, an OIDC-provisioned human whose login
lives at the issuer, the keys-only owner), and the principals door manages
it directly. A backend error raises (fail closed), never a silent False.
Parameters
attach_login
tai42_contract.accounts.provider.LoginAttachingProvider.attach_login
credential to the existing principal user_id.
A PasswordCredential sets the
password now; an InviteCredential
mints a one-time link returned on the LoginAttachment.
A correctable-input failure (a too-short password) raises
LoginAttachError; a login already
existing for the principal or a taken email raises
LoginConflictError. The state is
unchanged on either, so the caller surfaces the failure and stays retriable.
Parameters
ButtonMethod
tai42_contract.accounts.models.ButtonMethod
FormField
tai42_contract.accounts.models.FormField
FormMethod
tai42_contract.accounts.models.FormMethod
InviteCredential
tai42_contract.accounts.models.InviteCredential
LoginAttachment
tai42_contract.accounts.models.LoginAttachment
attached is whether an interactive login was attached. invite_token
and login_path are set only for an invite credential — the one-time link
the operator follows to set the password later.
Attributes
LoginCredential
tai42_contract.accounts.models.LoginCredential
LoginMethod
tai42_contract.accounts.models.LoginMethod
PasswordCredential
tai42_contract.accounts.models.PasswordCredential
abort_staging
tai42_contract.accounts.registry.abort_staging
begin_staging
tai42_contract.accounts.registry.begin_staging
commit_staging
tai42_contract.accounts.registry.commit_staging
get_accounts_provider_factory
tai42_contract.accounts.registry.get_accounts_provider_factory
name in the COMMITTED generation.
Unknown names raise KeyError.
Parameters
iter_accounts_provider_factories
tai42_contract.accounts.registry.iter_accounts_provider_factories
iter_accounts_provider_factories_staged
tai42_contract.accounts.registry.iter_accounts_provider_factories_staged
register_accounts_provider
tai42_contract.accounts.registry.register_accounts_provider
factory here and — because an accounts provider is the
identity answerer for its own session tokens — into the identity
registry under the same name. Both registries stage together, so a staged
accounts registration lands beside its staged identity twin.
RELOAD-SAFE: re-registering the SAME factory (by
same_factory) under a name it
already holds is a quiet no-op in BOTH registries, so the hot-reload primitive
re-executing this plugin’s module body does not raise. A DIFFERENT factory under
an already-registered name still raises loudly, in either registry. The accounts
no-op returns before touching the identity registry, and the identity registry
is only written when this name is new here, so the two registries never drift.
Parameters
reset_registry
tai42_contract.accounts.registry.reset_registry

