Documentation
¶
Overview ¶
Package authclient is an isolated, typed Go client for the ab0t Auth Service (an Okta-style enterprise auth/permission stack served at https://auth.service.ab0t.com).
Isolation ¶
This package is its own Go module (github.com/ab0t-com/auth-sdk-go) and depends ONLY on the standard library. It has no dependency on any particular server, simulation, or any game internals. The server can adopt it later to gate routes via Authorize/ValidateToken without coupling to auth-service internals or to this package's transport details.
What the auth service provides ¶
Multi-provider authentication (password, OAuth/OIDC, SAML, passwordless), multi-tenant organizations, RBAC + a Zanzibar-style relationship engine, JWKS-backed JWTs, federation/SSO, API keys and service accounts. Tokens are JWTs bound to an active org (tenant); access tokens are short-lived and refreshed with a long-lived refresh token. Services authenticate to each other with API keys (prefix "ab0t_sk_") sent as bearer tokens.
Surface ¶
The client groups the endpoints a resource server / agent actually needs:
Authentication: Login, Register, Refresh, Logout, SwitchOrganization, Me, Delegate
OAuth2/OIDC: OAuthAuthorizeURL, OAuthCallback
Revocation: RevokeToken, RevokeTokenPublic
Token/authz: ValidateToken, ValidateAPIKey, Introspect, CheckPermission, Authorize
JWKS: JWKS, RefreshJWKS, OrgJWKS, SigningKey (TTL-cached)
Users: GetMyProfile, UpdateMyProfile, ChangeMyPassword, GetUser,
UpdateUser, Activate/DeactivateUser, VerifyUserEmail, *PasswordReset
Orgs/tenants: Create/Get/Update/DeleteOrganization, GetOrgHierarchy,
ListOrgUsers, UpdateOrgUserRole, RemoveOrgUser, Invite*,
List/RevokeOrgSessions, RevokeUserSessions
Teams/groups: Create/Get/Update/DeleteTeam, *TeamMember*, GetTeamPermissions
Roles/RBAC: GetRoles, Grant/RevokePermission (query-param based),
registry (services, valid-permissions, validate, stats, register)
Zanzibar ReBAC: ZanzibarCheck(+Bulk/Wildcard), Expand, List(Objects|Users),
Write/DeleteRelationships (single tuple), namespaces,
grant/revoke, hierarchy/team setup, visualize, migrate, watch.
Uses combined typed-string ids ("doc:123", "user:alice"); build
them with Object()/Subject(). Request/response types match the
live OpenAPI (verified 2026-07-12).
Authz model: Write/Read/List/EnsureAuthorizationModel,
WriteAndDeleteRelationships (atomic), List(Relationships|Objects)Paged,
DeleteAllRelationshipsForObject
(forward-looking: model management + transact + list-relationships
pagination are SERVER-GAPs not in the auth service OpenAPI;
the REAL schema surface is namespaces. See COVERAGE.md.)
Providers/SSO: Create/List/Get/Update/Delete/TestProvider, federation
SSO sessions/config/domains, attribute mappings, JIT, stats
API keys: List/Create/Get/Update/DeleteAPIKey (CreateServiceAccount)
Delegation: Grant/Revoke/Check/ListDelegation
Admin: password policy, JWKS rotate/revoke/generate/activate/cleanup,
circuit breakers, elevate privileges, audit, emergency revoke
Super-admin: time-bound Grant/Revoke/Extend/Approve + active-grants/audit
Interactive: OAuthAuthorize, PushedAuthorizationRequest, OAuthToken,
RefreshTokenForm, dynamic client registration, email-verify,
password-reset, OIDC/OAuth discovery, JWKS health
Hosted auth: OrgLogin/Register/Token/Refresh/Logout, OrgAuthProviders,
OrgSSOInitiate/Callback, login-config, hosted pages, invites
Passwordless: WebAuthn register/authenticate + credentials, magic links,
recovery codes, devices
SAML: IdP/SP SSO/ACS/SLO/metadata, SP CRUD, attribute mappings,
certificates, analytics
Email admin: system + per-org config/templates/preview/test
Events: webhook subscription CRUD + test/toggle/stats
Network ACL: policies, emergency overrides, temp allowlists, violations
Forward-auth: ForwardAuth/Live/Pass/Fail edge decisions (GET/POST/HEAD)
Quotas/reports: MyQuotaUsage, CheckQuota, QuotaTiers, Submit/List/Dismiss/ResolveReport
System: Health, Status, Discover, Metrics, JWKSMetrics, alerts, help
The client covers the operations a resource server / agent needs across the surfaces listed above. The Zanzibar ReBAC and account/RBAC request/response contracts were reconciled against the live OpenAPI on 2026-07-12; a small number of forward-looking authorization-model / transact / paging capabilities have no server route yet and are marked SERVER-GAP in authzmodel.go. See COVERAGE.md for the operation -> method map and the known gaps.
Two interfaces decouple callers from the concrete client:
Validator — resolve a bearer token to an Actor (who + tenant + permissions). Authorizer — decide whether a token may perform an action on a resource.
The route-gating primitive is:
allowed, _ := client.Authorize(ctx, token, "world.write", authclient.Resource{Type: "world", ID: "w1"})
Quick start ¶
c := authclient.New("https://auth.service.ab0t.com",
authclient.WithAPIKey("ab0t_sk_...")) // server's service key (optional)
tok, err := c.Login(ctx, authclient.LoginRequest{Email: e, Password: p})
actor, err := c.ValidateToken(ctx, tok.AccessToken)
ok, err := c.Authorize(ctx, tok.AccessToken, "world.write",
authclient.Resource{Type: "world", ID: "w1"})
See README.md for the full mapping to endpoints.
Index ¶
- Constants
- func IsAPIKey(cred string) bool
- func IsBadRequest(err error) bool
- func IsConflict(err error) bool
- func IsForbidden(err error) bool
- func IsNotFound(err error) bool
- func IsRateLimited(err error) bool
- func IsRetryable(err error) bool
- func IsServerError(err error) bool
- func IsUnauthorized(err error) bool
- func IsValidationError(err error) bool
- func Object(typ, id string) string
- func StatusCode(err error) int
- func Subject(typ, id string) string
- type APIError
- type APIKey
- type APIKeyCreate
- type APIKeyUpdate
- type APIKeyValidation
- type APIKeyWithToken
- type ActiveMagicLink
- type ActiveMagicLinksResponse
- type Actor
- type AlertEntry
- type ApprovalRequestModel
- type AttributeMapping
- type AttributeMappingCreateResponse
- type AttributeMappingListResponse
- type AuthorizationModel
- type AuthorizationModelResponse
- type AuthorizationResponse
- type AuthorizationServerMetadata
- type Authorizer
- type BulkCheckRequest
- type BulkCheckResults
- type ChangePassword
- type CheckPermissionRequest
- type CheckPermissionResponse
- type CircuitBreakerResetAllResponse
- type CircuitBreakerResetResponse
- type CircuitBreakerStatusResponse
- type Client
- func (c *Client) AcceptInvitePage(ctx context.Context, slug, inviteToken string) (map[string]any, error)
- func (c *Client) ActivateSigningKey(ctx context.Context, kid, callerToken string) (*KeyActivateResponse, error)
- func (c *Client) ActivateUser(ctx context.Context, userID, callerToken string) (*MessageDetailResponse, error)
- func (c *Client) AddTeamMember(ctx context.Context, teamID string, req TeamMemberAdd, callerToken string) (*MessageResponse, error)
- func (c *Client) AuthorizationServerMetadata(ctx context.Context) (*AuthorizationServerMetadata, error)
- func (c *Client) Authorize(ctx context.Context, token, action string, resource Resource) (bool, error)
- func (c *Client) BaseURL() string
- func (c *Client) ChangeMyPassword(ctx context.Context, token string, req ChangePassword) (*MessageResponse, error)
- func (c *Client) CheckDelegation(ctx context.Context, targetUserID, token string) (*DelegationCheckResponse, error)
- func (c *Client) CheckPermission(ctx context.Context, req PermissionCheckRequest, callerToken string) (*PermissionDecision, error)
- func (c *Client) CheckPermissionPublic(ctx context.Context, req PermissionCheckRequest) (*PermissionDecision, error)
- func (c *Client) CheckQuota(ctx context.Context, resourceType, token string) (*QuotaCheckResponse, error)
- func (c *Client) CircuitBreakerStatus(ctx context.Context, callerToken string) (*CircuitBreakerStatusResponse, error)
- func (c *Client) CleanupSigningKeys(ctx context.Context, req KeyCleanupRequest, callerToken string) (*KeyCleanupResponse, error)
- func (c *Client) ConfirmPasswordResetAuth(ctx context.Context, req PasswordResetConfirm) (*PasswordResetConfirmResponse, error)
- func (c *Client) ConfirmVerificationEmail(ctx context.Context, token string) error
- func (c *Client) CreateAPIKey(ctx context.Context, req APIKeyCreate, token string) (*APIKeyWithToken, error)
- func (c *Client) CreateAttributeMapping(ctx context.Context, req AttributeMapping, callerToken string) (*AttributeMappingCreateResponse, error)
- func (c *Client) CreateDomainToken(ctx context.Context, token string) (*DomainTokenResponse, error)
- func (c *Client) CreateEmergencyOverride(ctx context.Context, req EmergencyOverrideRequest, callerToken string) (*EmergencyOverrideCreateResponse, error)
- func (c *Client) CreateEventSubscription(ctx context.Context, req EventSubscriptionCreate, token string) (*EventSubscription, error)
- func (c *Client) CreateNamespace(ctx context.Context, storeID string, req NamespaceRequest, callerToken string) (*ZanzibarMessageResponse, error)
- func (c *Client) CreateNetworkPolicy(ctx context.Context, req CreateNetworkPolicyRequest, callerToken string) (*NetworkPolicyCreateResponse, error)
- func (c *Client) CreateOrganization(ctx context.Context, req OrganizationCreate, token string) (*Organization, error)
- func (c *Client) CreateProvider(ctx context.Context, req ProviderConfigCreate, callerToken string) (*Provider, error)
- func (c *Client) CreateSSODomain(ctx context.Context, domain string, req SSODomainConfigRequest, ...) (*SSODomainConfigResponse, error)
- func (c *Client) CreateSSOSession(ctx context.Context, token string) (*SSOSessionCreateResponse, error)
- func (c *Client) CreateServiceAccount(ctx context.Context, req ServiceAccountCreate, callerToken string) (*ServiceAccountResponse, error)
- func (c *Client) CreateTeam(ctx context.Context, orgID string, req TeamCreate, callerToken string) (*Team, error)
- func (c *Client) CreateTempAllowlist(ctx context.Context, req TempAllowlistRequest, callerToken string) (*TempAllowlistCreateResponse, error)
- func (c *Client) DeactivateUser(ctx context.Context, userID, callerToken string) (*MessageDetailResponse, error)
- func (c *Client) Delegate(ctx context.Context, req DelegateTokenRequest, token string) (*TokenSet, error)
- func (c *Client) DeleteAPIKey(ctx context.Context, keyID, callerToken string) (*MessageResponse, error)
- func (c *Client) DeleteAllRelationshipsForObject(ctx context.Context, storeID, objectType, objectID, token string) (int, error)
- func (c *Client) DeleteClientRegistration(ctx context.Context, clientID string) error
- func (c *Client) DeleteCurrentUser(ctx context.Context, confirmEmail, callerToken string) (*SelfDeleteResponse, error)
- func (c *Client) DeleteEventSubscription(ctx context.Context, subscriptionID, token string) error
- func (c *Client) DeleteNetworkOverride(ctx context.Context, overrideID, callerToken string) (*NetworkPolicyStatusResponse, error)
- func (c *Client) DeleteNetworkPolicy(ctx context.Context, policyID, callerToken string) (*NetworkPolicyStatusResponse, error)
- func (c *Client) DeleteOrgEmailConfig(ctx context.Context, orgID, callerToken string) (*EmailConfigDeleteResponse, error)
- func (c *Client) DeleteOrgEmailTemplate(ctx context.Context, orgID, templateType, callerToken string) (*EmailTemplateDeleteResponse, error)
- func (c *Client) DeleteOrganization(ctx context.Context, orgID, callerToken string) (*MessageResponse, error)
- func (c *Client) DeleteProvider(ctx context.Context, providerID, callerToken string) (*MessageResponse, error)
- func (c *Client) DeleteRelationships(ctx context.Context, storeID string, req RelationshipRequest, token string) (*WriteOperationResponse, error)
- func (c *Client) DeleteSAMLSP(ctx context.Context, spID, callerToken string) (*EnterpriseMessageResponse, error)
- func (c *Client) DeleteSSODomain(ctx context.Context, domain, callerToken string) (*MessageResponse, error)
- func (c *Client) DeleteSSOSession(ctx context.Context, sessionID, token string) (*MessageResponse, error)
- func (c *Client) DeleteTeam(ctx context.Context, teamID, callerToken string) (*MessageResponse, error)
- func (c *Client) DeleteTempAllowlist(ctx context.Context, entryID, callerToken string) (*NetworkPolicyStatusResponse, error)
- func (c *Client) DeleteWebAuthnCredential(ctx context.Context, token, credentialID string) (*EnterpriseMessageResponse, error)
- func (c *Client) Discover(ctx context.Context) (*ServiceDiscoveryResponse, error)
- func (c *Client) DismissReport(ctx context.Context, reportID, callerToken string) (*LeakReportActionResponse, error)
- func (c *Client) ElevatePrivileges(ctx context.Context, req ElevatePrivilegesRequest, callerToken string) (*ElevatePrivilegesResponse, error)
- func (c *Client) EmailHistory(ctx context.Context, callerToken string) (*EmailHistoryResponse, error)
- func (c *Client) EmailStats(ctx context.Context, callerToken string) (*EmailStatsResponse, error)
- func (c *Client) EmailTemplateTypes(ctx context.Context, callerToken string) (*TemplateTypesResponse, error)
- func (c *Client) EmergencyRevokeAPIKeys(ctx context.Context, req EmergencyRevokeRequest, callerToken string) (*EmergencyRevokeResponse, error)
- func (c *Client) EnsureAuthorizationModel(ctx context.Context, storeID string, model AuthorizationModel, ...) (modelID string, changed bool, err error)
- func (c *Client) EnterpriseHelp(ctx context.Context) (map[string]any, error)
- func (c *Client) EnterpriseLicense(ctx context.Context) (map[string]any, error)
- func (c *Client) EvaluateNetworkPolicy(ctx context.Context, ip string) (*PolicyEvaluationResult, error)
- func (c *Client) EventSubscriptionStats(ctx context.Context, subscriptionID, token string) (*EventSubscriptionStatsResponse, error)
- func (c *Client) EventTypes(ctx context.Context) (*EventTypesResponse, error)
- func (c *Client) FederationStats(ctx context.Context, callerToken string) (*FederationStatsResponse, error)
- func (c *Client) ForcePasswordReset(ctx context.Context, req ForcePasswordResetRequest, callerToken string) (*ForcePasswordResetResponse, error)
- func (c *Client) ForwardAuth(ctx context.Context, method, token string) (*ForwardAuthDecision, error)
- func (c *Client) ForwardAuthFail(ctx context.Context, method, token string) (*ForwardAuthDecision, error)
- func (c *Client) ForwardAuthLive(ctx context.Context, method, token string) (*ForwardAuthDecision, error)
- func (c *Client) ForwardAuthPass(ctx context.Context, method, token string) (*ForwardAuthDecision, error)
- func (c *Client) GenerateRecoveryCodes(ctx context.Context, token string) (*RecoveryCodesResponse, error)
- func (c *Client) GenerateSAMLCertificate(ctx context.Context, callerToken string) (*SAMLCertificateGenerateResponse, error)
- func (c *Client) GenerateSigningKey(ctx context.Context, req KeyGenerationRequest, callerToken string) (*KeyGenerateResponse, error)
- func (c *Client) GetAPIKey(ctx context.Context, keyID, token string) (*APIKey, error)
- func (c *Client) GetClientRegistration(ctx context.Context, clientID string) (*ClientRegistrationResponse, error)
- func (c *Client) GetEventSubscription(ctx context.Context, subscriptionID, token string) (*EventSubscription, error)
- func (c *Client) GetHostedLoginPage(ctx context.Context, slug string) (map[string]any, error)
- func (c *Client) GetJITConfig(ctx context.Context, callerToken string) (*JITConfigResponse, error)
- func (c *Client) GetLoginConfig(ctx context.Context, orgID, callerToken string) (*LoginConfigResponse, error)
- func (c *Client) GetMeshProvider(ctx context.Context, serviceID, callerToken string) (*MeshProvider, error)
- func (c *Client) GetMyOrganizations(ctx context.Context, token string) ([]UserOrganizationInfo, error)
- func (c *Client) GetMyProfile(ctx context.Context, token string) (*User, error)
- func (c *Client) GetNamespace(ctx context.Context, storeID, name, callerToken string) (*NamespaceDetailResponse, error)
- func (c *Client) GetNetworkPolicy(ctx context.Context, policyID, callerToken string) (*NetworkPolicy, error)
- func (c *Client) GetOrgEmailConfig(ctx context.Context, orgID, callerToken string) (*OrgEmailConfigResponse, error)
- func (c *Client) GetOrgEmailTemplate(ctx context.Context, orgID, templateType, callerToken string) (*OrgEmailTemplateResponse, error)
- func (c *Client) GetOrgHierarchy(ctx context.Context, orgID, callerToken string) (*OrgHierarchyResponse, error)
- func (c *Client) GetOrganization(ctx context.Context, orgID, callerToken string) (*Organization, error)
- func (c *Client) GetPasswordPolicy(ctx context.Context, orgID, callerToken string) (*PasswordPolicyGetResponse, error)
- func (c *Client) GetProvider(ctx context.Context, providerID, callerToken string) (*Provider, error)
- func (c *Client) GetPublicLoginConfig(ctx context.Context, slug string) (*PublicLoginConfig, error)
- func (c *Client) GetRoles(ctx context.Context, callerToken string) (map[string]RoleDefinition, error)
- func (c *Client) GetSAMLAttributeMappings(ctx context.Context, callerToken string) (*SAMLAttributeMappingResponse, error)
- func (c *Client) GetSAMLCertificates(ctx context.Context, callerToken string) (*SAMLCertificateStatusResponse, error)
- func (c *Client) GetSAMLSP(ctx context.Context, spID, callerToken string) (*SAMLSPDetailResponse, error)
- func (c *Client) GetSSOConfig(ctx context.Context, callerToken string) (*SSOConfigResponse, error)
- func (c *Client) GetSSODomain(ctx context.Context, domain, callerToken string) (*SSODomainConfigResponse, error)
- func (c *Client) GetSSOSession(ctx context.Context, sessionID, token string) (*SSOSessionDetailResponse, error)
- func (c *Client) GetTeam(ctx context.Context, teamID, callerToken string) (*Team, error)
- func (c *Client) GetTeamPermissions(ctx context.Context, teamID, callerToken string) (*TeamPermissionsResponse, error)
- func (c *Client) GetUser(ctx context.Context, userID, callerToken string) (*User, error)
- func (c *Client) GetUserPermissions(ctx context.Context, userID, callerToken string) (*UserPermissions, error)
- func (c *Client) GlobalEmailConfig(ctx context.Context, callerToken string) (*GlobalEmailConfigResponse, error)
- func (c *Client) GrantDelegation(ctx context.Context, req DelegationGrant, token string) (*DelegationResponse, error)
- func (c *Client) GrantPermission(ctx context.Context, userID, orgID, permission, callerToken string) (*MessageResponse, error)
- func (c *Client) Health(ctx context.Context) (*HealthCheckResponse, error)
- func (c *Client) Help(ctx context.Context) (map[string]any, error)
- func (c *Client) Introspect(ctx context.Context, token, hint string) (*Introspection, error)
- func (c *Client) InviteToOrganization(ctx context.Context, orgID string, req OrganizationInvite, callerToken string) (*MessageResponse, error)
- func (c *Client) JWKS(ctx context.Context) (JWKS, error)
- func (c *Client) JWKSHealth(ctx context.Context) (map[string]any, error)
- func (c *Client) JWKSHealthDetail(ctx context.Context) (*JwksHealthResponse, error)
- func (c *Client) JWKSMetrics(ctx context.Context, callerToken string) (*JwksMetricsResponse, error)
- func (c *Client) JWKSNextRotation(ctx context.Context, callerToken string) (*NextRotationResponse, error)
- func (c *Client) JWKSRotationStatus(ctx context.Context, callerToken string) (*RotationStatusResponse, error)
- func (c *Client) ListAPIKeys(ctx context.Context, callerToken string) ([]APIKey, error)
- func (c *Client) ListActiveMagicLinks(ctx context.Context, token string) (*ActiveMagicLinksResponse, error)
- func (c *Client) ListAttributeMappings(ctx context.Context, callerToken string) (*AttributeMappingListResponse, error)
- func (c *Client) ListAuthorizationModels(ctx context.Context, storeID, pageToken, callerToken string) (*ListAuthorizationModelsResponse, error)
- func (c *Client) ListDelegations(ctx context.Context, userID, token string) ([]DelegationEntry, error)
- func (c *Client) ListDevices(ctx context.Context, token string) (*DeviceListResponse, error)
- func (c *Client) ListEventSubscriptions(ctx context.Context, token string) (*EventSubscriptionListResponse, error)
- func (c *Client) ListInvitations(ctx context.Context, orgID, callerToken string) ([]InvitationListItem, error)
- func (c *Client) ListMeshProviders(ctx context.Context, q url.Values, callerToken string) (*MeshProvidersListResponse, error)
- func (c *Client) ListNamespaces(ctx context.Context, storeID, callerToken string) (*NamespaceListResponse, error)
- func (c *Client) ListNetworkOverrides(ctx context.Context, callerToken string) (*OverrideListResponse, error)
- func (c *Client) ListNetworkPolicies(ctx context.Context, callerToken string) (*NetworkPolicyListResponse, error)
- func (c *Client) ListNetworkViolations(ctx context.Context, callerToken string) (*ViolationListResponse, error)
- func (c *Client) ListObjectsPaged(ctx context.Context, storeID string, req ListObjectsRequest, ...) (*ListObjectsResponse, error)
- func (c *Client) ListOrgClients(ctx context.Context, orgID, callerToken string) (*OrgClientSafeResponse, error)
- func (c *Client) ListOrgEmailTemplates(ctx context.Context, orgID, callerToken string) (*OrgEmailTemplateResponse, error)
- func (c *Client) ListOrgSessions(ctx context.Context, orgID, callerToken string) (*OrgSessionsResponse, error)
- func (c *Client) ListOrgUsers(ctx context.Context, orgID, callerToken string) (*OrgUserResponse, error)
- func (c *Client) ListProviders(ctx context.Context, callerToken string) ([]Provider, error)
- func (c *Client) ListRegisteredServices(ctx context.Context, callerToken string) (*RegisteredServicesResponse, error)
- func (c *Client) ListRelationships(ctx context.Context, ...) (*RelationshipsResponse, error)
- func (c *Client) ListRelationshipsPaged(ctx context.Context, ...) (*RelationshipsPage, error)
- func (c *Client) ListReports(ctx context.Context, callerToken string) (*LeakReportListResponse, error)
- func (c *Client) ListRevokedKeys(ctx context.Context, callerToken string) (*RevokedKeysListResponse, error)
- func (c *Client) ListSAMLSPs(ctx context.Context, callerToken string) (*SAMLSPListResponse, error)
- func (c *Client) ListSAMLSessions(ctx context.Context, token string) (*SAMLSessionListResponse, error)
- func (c *Client) ListSSODomains(ctx context.Context, callerToken string) (*SSODomainListResponse, error)
- func (c *Client) ListSSOSessions(ctx context.Context, token string) (*SSOSessionListResponse, error)
- func (c *Client) ListTeamMembers(ctx context.Context, teamID, callerToken string) ([]TeamMember, error)
- func (c *Client) ListTeams(ctx context.Context, orgID, callerToken string) ([]Team, error)
- func (c *Client) ListTempAllowlist(ctx context.Context, callerToken string) (*TempAllowlistListResponse, error)
- func (c *Client) ListValidPermissions(ctx context.Context) (*ValidPermissionsResponse, error)
- func (c *Client) ListWebAuthnCredentials(ctx context.Context, token string) (*WebAuthnCredentialListResponse, error)
- func (c *Client) Login(ctx context.Context, req LoginRequest) (*TokenSet, error)
- func (c *Client) Logout(ctx context.Context, token string) (*LogoutResult, error)
- func (c *Client) MagicLinkAnalytics(ctx context.Context, token string) (*MagicLinkAnalyticsResponse, error)
- func (c *Client) MagicLinkConfig(ctx context.Context) (*MagicLinkConfigResponse, error)
- func (c *Client) Me(ctx context.Context, token string) (*User, error)
- func (c *Client) Metrics(ctx context.Context, callerToken string) (map[string]any, error)
- func (c *Client) MigratePermissions(ctx context.Context, storeID, userID string, permissions []string, ...) (*ZanzibarMessageResponse, error)
- func (c *Client) MigrateSetupDefaults(ctx context.Context, storeID, callerToken string) (*ZanzibarMessageResponse, error)
- func (c *Client) MyQuotaUsage(ctx context.Context, token string) (*QuotaUsageResponse, error)
- func (c *Client) OAuthAuthorize(ctx context.Context, token string, params url.Values) (*AuthorizationResponse, error)
- func (c *Client) OAuthAuthorizeURL(ctx context.Context, p OAuthAuthorizeParams) (*OAuthAuthorize, error)
- func (c *Client) OAuthCallback(ctx context.Context, p OAuthCallbackParams) (*TokenSet, error)
- func (c *Client) OAuthToken(ctx context.Context, form url.Values) (*TokenResponse, error)
- func (c *Client) OpenIDConfiguration(ctx context.Context) (*OpenIDConfiguration, error)
- func (c *Client) OrgAuthProviders(ctx context.Context, slug string) (*OrgProvidersResponse, error)
- func (c *Client) OrgEmailHistory(ctx context.Context, orgID, callerToken string) (*EmailHistoryResponse, error)
- func (c *Client) OrgJWKS(ctx context.Context, orgID string) (JWKS, error)
- func (c *Client) OrgLogin(ctx context.Context, slug string, req OrgLoginRequest) (*TokenSet, error)
- func (c *Client) OrgLogout(ctx context.Context, slug, token string) (*HostedLoginMessageResponse, error)
- func (c *Client) OrgRefresh(ctx context.Context, slug, refreshToken string) (*TokenResponse, error)
- func (c *Client) OrgRegister(ctx context.Context, slug string, req OrgRegisterRequest) (*TokenSet, error)
- func (c *Client) OrgResetPassword(ctx context.Context, slug string, req OrgPasswordResetRequest) (*HostedLoginMessageResponse, error)
- func (c *Client) OrgSSOCallback(ctx context.Context, slug string, form url.Values) (map[string]any, error)
- func (c *Client) OrgSSOInitiate(ctx context.Context, slug string, params url.Values) (map[string]any, error)
- func (c *Client) OrgToken(ctx context.Context, slug string, form url.Values) (*TokenResponse, error)
- func (c *Client) PasswordAuditEvents(ctx context.Context, callerToken string) (*PasswordAuditEventsResponse, error)
- func (c *Client) PasswordComplianceReport(ctx context.Context, callerToken string) (*PasswordComplianceResponse, error)
- func (c *Client) PreviewOrgEmailTemplate(ctx context.Context, orgID, templateType string, vars map[string]any, ...) (*TemplatePreviewResponse, error)
- func (c *Client) PropagateLogout(ctx context.Context, token string) (*LogoutPropagationResponse, error)
- func (c *Client) PropagateSSO(ctx context.Context, callerToken string) (*SSOPropagateResponse, error)
- func (c *Client) ProviderAuthorizeInfo(ctx context.Context, provider string, params url.Values) (*OAuthProviderAuthorizeResponse, error)
- func (c *Client) PublishMeshProvider(ctx context.Context, req MeshProviderPublishRequest, callerToken string) (*MeshProviderPublishResponse, error)
- func (c *Client) PushedAuthorizationRequest(ctx context.Context, params url.Values) (*PushedAuthorizationResponse, error)
- func (c *Client) QuotaTiers(ctx context.Context) (*QuotaTiersResponse, error)
- func (c *Client) ReadAuthorizationModel(ctx context.Context, storeID, modelID, callerToken string) (*AuthorizationModelResponse, error)
- func (c *Client) RecentAlerts(ctx context.Context, callerToken string) (*RecentAlertsResponse, error)
- func (c *Client) RecoverJWKS(ctx context.Context) (*JwksRecoverResponse, error)
- func (c *Client) Refresh(ctx context.Context, refreshToken string) (*TokenSet, error)
- func (c *Client) RefreshJWKS(ctx context.Context) (JWKS, error)
- func (c *Client) RefreshTokenForm(ctx context.Context, refreshToken string) (*TokenResponse, error)
- func (c *Client) Register(ctx context.Context, req RegisterRequest) (*TokenSet, error)
- func (c *Client) RegisterClient(ctx context.Context, req ClientRegistration) (*ClientRegistrationResponse, error)
- func (c *Client) RegisterSAMLSP(ctx context.Context, req SAMLServiceProviderConfig, callerToken string) (*SAMLSPRegistrationResponse, error)
- func (c *Client) RegisterServicePermissions(ctx context.Context, req ServicePermissionRegister, callerToken string) (*ServicePermissionResponse, error)
- func (c *Client) RegistryStats(ctx context.Context) (*RegistryStatsResponse, error)
- func (c *Client) RemoveOrgUser(ctx context.Context, orgID, userID, callerToken string) (*MessageResponse, error)
- func (c *Client) RemoveTeamMember(ctx context.Context, teamID, userID, callerToken string) (*MessageResponse, error)
- func (c *Client) RequestPasswordReset(ctx context.Context, req PasswordReset) (*PasswordResetResponse, error)
- func (c *Client) RequestPasswordResetAuth(ctx context.Context, req PasswordReset) (*PasswordResetResponse, error)
- func (c *Client) ResetAllCircuitBreakers(ctx context.Context, callerToken string) (*CircuitBreakerResetAllResponse, error)
- func (c *Client) ResetCircuitBreaker(ctx context.Context, name, callerToken string) (*CircuitBreakerResetResponse, error)
- func (c *Client) ResetPassword(ctx context.Context, req PasswordResetConfirm) (*PasswordResetConfirmResponse, error)
- func (c *Client) ResolveReport(ctx context.Context, reportID, callerToken string) (*LeakReportActionResponse, error)
- func (c *Client) RevocationAuditLog(ctx context.Context, callerToken string) ([]RevocationAuditEntry, error)
- func (c *Client) RevokeDelegation(ctx context.Context, actorID, token string) (*MessageResponse, error)
- func (c *Client) RevokeInvitation(ctx context.Context, orgID, invitationID, callerToken string) (*MessageResponse, error)
- func (c *Client) RevokeMagicLink(ctx context.Context, callerToken, linkToken string) (*EnterpriseMessageResponse, error)
- func (c *Client) RevokeOrgSessions(ctx context.Context, orgID, callerToken string) (*MessageResponse, error)
- func (c *Client) RevokePermission(ctx context.Context, userID, orgID, permission, callerToken string) (*MessageResponse, error)
- func (c *Client) RevokeSigningKey(ctx context.Context, kid string, req KeyRevocationRequest, callerToken string) (*KeyRevocationResponse, error)
- func (c *Client) RevokeToken(ctx context.Context, callerToken, tokenToRevoke, hint string) (*RevokeResult, error)
- func (c *Client) RevokeTokenPublic(ctx context.Context, token, hint string) error
- func (c *Client) RevokeUserSessions(ctx context.Context, orgID, userID, callerToken string) (*SessionRevokeResponse, error)
- func (c *Client) RotateSigningKeys(ctx context.Context, req KeyRotationRequest, callerToken string) (*KeyRotationResponse, error)
- func (c *Client) SAMLAnalytics(ctx context.Context, callerToken string) (*SAMLAnalyticsResponse, error)
- func (c *Client) SAMLAssertionConsumer(ctx context.Context, form url.Values) (*SAMLAssertionResult, error)
- func (c *Client) SAMLMetadata(ctx context.Context) (string, error)
- func (c *Client) SAMLSPMetadata(ctx context.Context, spID string) (string, error)
- func (c *Client) SAMLSSOPost(ctx context.Context, form url.Values) (string, error)
- func (c *Client) SAMLSSORedirect(ctx context.Context, params url.Values) (string, error)
- func (c *Client) SAMLSingleLogout(ctx context.Context, form url.Values) (*SAMLLogoutResult, error)
- func (c *Client) SendMagicLink(ctx context.Context, form url.Values) (*MagicLinkSendResponse, error)
- func (c *Client) SendTestEmail(ctx context.Context, orgID string, req TestEmailRequest, callerToken string) (*TestEmailSentResponse, error)
- func (c *Client) SendVerificationEmail(ctx context.Context, req VerifyEmailSendRequest) error
- func (c *Client) SetPasswordPolicy(ctx context.Context, req PasswordPolicyRequest, callerToken string) (*PasswordPolicySetResponse, error)
- func (c *Client) SetupOrgHierarchy(ctx context.Context, storeID string, req OrgHierarchyRequest, ...) (*ZanzibarMessageResponse, error)
- func (c *Client) SetupTeamMembership(ctx context.Context, storeID string, req TeamMembershipRequest, ...) (*ZanzibarMessageResponse, error)
- func (c *Client) SigningKey(ctx context.Context, kid string) (JWK, error)
- func (c *Client) Status(ctx context.Context) (*ServiceStatusResponse, error)
- func (c *Client) Store(storeID, callerToken string) *ZanzibarStore
- func (c *Client) SubmitReport(ctx context.Context, req LeakReportSubmission) (*LeakReportSubmissionResponse, error)
- func (c *Client) SuperAdminActiveGrants(ctx context.Context, callerToken string) (*SuperAdminActiveGrantsResponse, error)
- func (c *Client) SuperAdminApprove(ctx context.Context, req ApprovalRequestModel, callerToken string) (*MessageResponse, error)
- func (c *Client) SuperAdminAuditLog(ctx context.Context, callerToken string) (*MessageResponse, error)
- func (c *Client) SuperAdminCleanupExpired(ctx context.Context, callerToken string) (*SuperAdminCleanupResponse, error)
- func (c *Client) SuperAdminExtend(ctx context.Context, req SuperAdminExtendRequestModel, callerToken string) (*SuperAdminExtendResponse, error)
- func (c *Client) SuperAdminGrant(ctx context.Context, req SuperAdminGrantRequestModel, callerToken string) (*SuperAdminGrantResponse, error)
- func (c *Client) SuperAdminRevoke(ctx context.Context, req SuperAdminRevokeRequestModel, callerToken string) (*SuperAdminRevokeResponse, error)
- func (c *Client) SupportedProviderTypes(ctx context.Context) (map[string]any, error)
- func (c *Client) SwitchOrganization(ctx context.Context, token, orgID string) (*TokenSet, error)
- func (c *Client) TestEventSubscription(ctx context.Context, subscriptionID, token string) (*EventSubscriptionTestResponse, error)
- func (c *Client) TestProvider(ctx context.Context, req ProviderTestRequest, callerToken string) (*ProviderTestResponse, error)
- func (c *Client) ToggleEventSubscription(ctx context.Context, subscriptionID, token string) (*EventSubscription, error)
- func (c *Client) UpdateAPIKey(ctx context.Context, keyID string, req APIKeyUpdate, callerToken string) (*MessageResponse, error)
- func (c *Client) UpdateClientRegistration(ctx context.Context, clientID string, req ClientRegistration) (*ClientRegistrationResponse, error)
- func (c *Client) UpdateEventSubscription(ctx context.Context, subscriptionID string, req EventSubscriptionUpdate, ...) (*EventSubscription, error)
- func (c *Client) UpdateJITConfig(ctx context.Context, config map[string]any, callerToken string) (*MessageResponse, error)
- func (c *Client) UpdateLoginConfig(ctx context.Context, orgID string, req LoginConfigUpdate, callerToken string) (*LoginConfigResponse, error)
- func (c *Client) UpdateMyProfile(ctx context.Context, token string, upd UserUpdate) (*User, error)
- func (c *Client) UpdateNetworkPolicy(ctx context.Context, policyID string, req UpdateNetworkPolicyRequest, ...) (*NetworkPolicyStatusResponse, error)
- func (c *Client) UpdateOrgEmailConfig(ctx context.Context, orgID string, req OrgEmailConfigUpdate, ...) (*OrgEmailConfigResponse, error)
- func (c *Client) UpdateOrgEmailTemplate(ctx context.Context, orgID, templateType string, req OrgEmailTemplateUpdate, ...) (*OrgEmailTemplateResponse, error)
- func (c *Client) UpdateOrgUserRole(ctx context.Context, orgID, userID string, req OrgRoleUpdate, ...) (*RoleUpdateResponse, error)
- func (c *Client) UpdateOrganization(ctx context.Context, orgID string, req OrganizationUpdate, callerToken string) (*MessageResponse, error)
- func (c *Client) UpdatePasswordAge(ctx context.Context, req PasswordAgeUpdate, callerToken string) (*PasswordAgeUpdateResponse, error)
- func (c *Client) UpdateProvider(ctx context.Context, providerID string, req ProviderConfigUpdate, ...) (*MessageResponse, error)
- func (c *Client) UpdateProviderStatus(ctx context.Context, req ProviderStatusUpdateRequest, callerToken string) (*ProviderStatusUpdateResponse, error)
- func (c *Client) UpdateSAMLAttributeMappings(ctx context.Context, req SAMLAttributeMappingUpdate, callerToken string) (*EnterpriseMessageResponse, error)
- func (c *Client) UpdateSAMLSP(ctx context.Context, spID string, req SAMLServiceProviderConfig, ...) (*SAMLSPUpdateResponse, error)
- func (c *Client) UpdateSSOConfig(ctx context.Context, config map[string]any, callerToken string) (*SSOConfigUpdateResponse, error)
- func (c *Client) UpdateSSODomain(ctx context.Context, domain string, req SSODomainConfigRequest, ...) (*SSODomainConfigResponse, error)
- func (c *Client) UpdateTeam(ctx context.Context, teamID string, req TeamUpdate, callerToken string) (*MessageResponse, error)
- func (c *Client) UpdateTeamMemberRole(ctx context.Context, teamID, userID string, req TeamMemberRoleUpdate, ...) (*MessageResponse, error)
- func (c *Client) UpdateUser(ctx context.Context, userID string, upd UserUpdate, callerToken string) (*MessageResponse, error)
- func (c *Client) UpdateWebAuthnCredential(ctx context.Context, token, credentialID string, req WebAuthnCredentialUpdate) (*EnterpriseMessageResponse, error)
- func (c *Client) ValidateAPIKey(ctx context.Context, req ValidateAPIKeyRequest) (*APIKeyValidation, error)
- func (c *Client) ValidatePasswordResetToken(ctx context.Context, token string) (*PasswordResetValidateResponse, error)
- func (c *Client) ValidatePermissions(ctx context.Context, perms []string) (*PermissionValidationResponse, error)
- func (c *Client) ValidateToken(ctx context.Context, token string) (*Actor, error)
- func (c *Client) ValidateTokenWith(ctx context.Context, req TokenValidationRequest) (*Actor, error)
- func (c *Client) VerifyMagicLink(ctx context.Context, form url.Values) (*PasswordlessAuthResponse, error)
- func (c *Client) VerifyRecoveryCode(ctx context.Context, form url.Values) (*PasswordlessAuthResponse, error)
- func (c *Client) VerifyUserEmail(ctx context.Context, userID, callerToken string) (*MessageResponse, error)
- func (c *Client) VisualizeHierarchy(ctx context.Context, storeID string, req VisualizationRequest, ...) (*HierarchyVisualizationResponse, error)
- func (c *Client) VisualizePermissions(ctx context.Context, storeID, userID, callerToken string) (*PermissionsVisualizationResponse, error)
- func (c *Client) WatchStatus(ctx context.Context, storeID, callerToken string) (*WatchStatusResponse, error)
- func (c *Client) WebAuthnAuthenticateFinish(ctx context.Context, assertion map[string]any) (*PasswordlessAuthResponse, error)
- func (c *Client) WebAuthnAuthenticateStart(ctx context.Context, req map[string]any) (map[string]any, error)
- func (c *Client) WebAuthnConfig(ctx context.Context) (*WebAuthnConfigResponse, error)
- func (c *Client) WebAuthnRegisterFinish(ctx context.Context, token string, credential map[string]any) (*WebAuthnRegistrationResult, error)
- func (c *Client) WebAuthnRegisterStart(ctx context.Context, token string, req map[string]any) (map[string]any, error)
- func (c *Client) WriteAndDeleteRelationships(ctx context.Context, storeID string, req TransactRelationshipsRequest, ...) (*WriteOperationResponse, error)
- func (c *Client) WriteAuthorizationModel(ctx context.Context, storeID string, req WriteAuthorizationModelRequest, ...) (*WriteAuthorizationModelResponse, error)
- func (c *Client) WriteRelationships(ctx context.Context, storeID string, req RelationshipRequest, token string) (*WriteOperationResponse, error)
- func (c *Client) ZanzibarCheck(ctx context.Context, storeID string, req CheckPermissionRequest, ...) (*CheckPermissionResponse, error)
- func (c *Client) ZanzibarCheckBulk(ctx context.Context, storeID string, req BulkCheckRequest, callerToken string) (BulkCheckResults, error)
- func (c *Client) ZanzibarCheckWildcard(ctx context.Context, storeID string, q url.Values, callerToken string) (*WildcardCheckResponse, error)
- func (c *Client) ZanzibarExpand(ctx context.Context, storeID string, req ExpandRequest, callerToken string) (*ExpandResponse, error)
- func (c *Client) ZanzibarGrant(ctx context.Context, storeID string, req PermissionGrantRequest, ...) (*WriteOperationResponse, error)
- func (c *Client) ZanzibarListObjects(ctx context.Context, storeID string, req ListObjectsRequest, ...) (*ListObjectsResponse, error)
- func (c *Client) ZanzibarListUsers(ctx context.Context, storeID string, req ListUsersRequest, callerToken string) (*ListUsersResponse, error)
- func (c *Client) ZanzibarRevoke(ctx context.Context, storeID string, req PermissionGrantRequest, ...) (*WriteOperationResponse, error)
- type ClientRegistration
- type ClientRegistrationResponse
- type CreateNetworkPolicyRequest
- type DelegateTokenRequest
- type DelegationCheckResponse
- type DelegationEntry
- type DelegationGrant
- type DelegationResponse
- type Device
- type DeviceListResponse
- type DomainTokenResponse
- type ElevatePrivilegesRequest
- type ElevatePrivilegesResponse
- type EmailConfigDeleteResponse
- type EmailHistoryEntry
- type EmailHistoryResponse
- type EmailStatsResponse
- type EmailTemplateDeleteResponse
- type EmergencyOverrideCreateResponse
- type EmergencyOverrideRequest
- type EmergencyRevokeRequest
- type EmergencyRevokeResponse
- type EnterpriseMessageResponse
- type ErrUntypedID
- type EventSubscription
- type EventSubscriptionCreate
- type EventSubscriptionListResponse
- type EventSubscriptionStatsResponse
- type EventSubscriptionTestResponse
- type EventSubscriptionUpdate
- type EventTypeInfo
- type EventTypesResponse
- type ExpandRequest
- type ExpandResponse
- type FederationStatsResponse
- type ForcePasswordResetRequest
- type ForcePasswordResetResponse
- type ForwardAuthDecision
- type GlobalEmailConfigResponse
- type HealthCheckResponse
- type HierarchyTeam
- type HierarchyUser
- type HierarchyVisualizationResponse
- type HostedLoginMessageResponse
- type Introspection
- type InvitationListItem
- type JITConfigResponse
- type JWK
- type JWKS
- type JwksHealthResponse
- type JwksMetricsResponse
- type JwksRecoverResponse
- type KeyActivateResponse
- type KeyCleanupRequest
- type KeyCleanupResponse
- type KeyGenerateResponse
- type KeyGenerationRequest
- type KeyRevocationRequest
- type KeyRevocationResponse
- type KeyRotationRequest
- type KeyRotationResponse
- type LeakReport
- type LeakReportActionResponse
- type LeakReportListResponse
- type LeakReportSubmission
- type LeakReportSubmissionResponse
- type ListAuthorizationModelsResponse
- type ListObjectsRequest
- type ListObjectsResponse
- type ListUsersRequest
- type ListUsersResponse
- type LoginConfig
- type LoginConfigResponse
- type LoginConfigUpdate
- type LoginRequest
- type LogoutPropagationResponse
- type LogoutResult
- type MagicLinkAnalyticsResponse
- type MagicLinkConfigResponse
- type MagicLinkSendResponse
- type MeshConsumerRegistration
- type MeshProvider
- type MeshProviderPublishRequest
- type MeshProviderPublishResponse
- type MeshProviderTier
- type MeshProviderTierInput
- type MeshProvidersListResponse
- type MessageDetailResponse
- type MessageResponse
- type NamespaceDetailResponse
- type NamespaceListResponse
- type NamespaceRequest
- type NamespaceSummary
- type NetworkOverride
- type NetworkPolicy
- type NetworkPolicyCreateResponse
- type NetworkPolicyListResponse
- type NetworkPolicyStatusResponse
- type NetworkViolation
- type NextRotationResponse
- type OAuthAuthorize
- type OAuthAuthorizeParams
- type OAuthCallbackParams
- type OAuthProviderAuthorizeResponse
- type Observer
- type OpenIDConfiguration
- type Option
- func WithAPIKey(key string) Option
- func WithBackoff(base, max time.Duration) Option
- func WithBaseURL(u string) Option
- func WithExpectedAudience(aud string) Option
- func WithHTTPClient(h *http.Client) Option
- func WithMaxRetries(n int) Option
- func WithObserver(fn Observer) Option
- func WithTimeout(d time.Duration) Option
- func WithUserAgent(ua string) Option
- type OrgClientSafe
- type OrgClientSafeResponse
- type OrgEmailConfig
- type OrgEmailConfigResponse
- type OrgEmailConfigUpdate
- type OrgEmailTemplate
- type OrgEmailTemplateResponse
- type OrgEmailTemplateUpdate
- type OrgHierarchyNode
- type OrgHierarchyRequest
- type OrgHierarchyResponse
- type OrgInfo
- type OrgLoginRequest
- type OrgMember
- type OrgPasswordResetRequest
- type OrgProviderInfo
- type OrgProvidersResponse
- type OrgRegisterRequest
- type OrgRoleUpdate
- type OrgSession
- type OrgSessionsResponse
- type OrgUserResponse
- type Organization
- type OrganizationCreate
- type OrganizationInvite
- type OrganizationUpdate
- type OverrideListResponse
- type PasswordAgeUpdate
- type PasswordAgeUpdateResponse
- type PasswordAuditEventsResponse
- type PasswordComplianceResponse
- type PasswordPolicyGetResponse
- type PasswordPolicyRequest
- type PasswordPolicySetResponse
- type PasswordReset
- type PasswordResetConfirm
- type PasswordResetConfirmResponse
- type PasswordResetResponse
- type PasswordResetValidateResponse
- type PasswordlessAuthResponse
- type PermissionCheckRequest
- type PermissionDecision
- type PermissionGrantRequest
- type PermissionValidationRequest
- type PermissionValidationResponse
- type PermissionsVisualizationResponse
- type PolicyEvaluationResult
- type Provider
- type ProviderConfigCreate
- type ProviderConfigUpdate
- type ProviderStatusUpdateRequest
- type ProviderStatusUpdateResponse
- type ProviderTestRequest
- type ProviderTestResponse
- type PublicLoginConfig
- type PushedAuthorizationResponse
- type QuotaCheckResponse
- type QuotaTier
- type QuotaTiersResponse
- type QuotaUsageItem
- type QuotaUsageResponse
- type RecentAlertsResponse
- type RecoveryCodesResponse
- type RefreshRequest
- type RegisterRequest
- type RegisteredService
- type RegisteredServicesResponse
- type RegistryStatsResponse
- type RelationshipEntry
- type RelationshipRequest
- type RelationshipsPage
- type RelationshipsResponse
- type RequestInfo
- type Resource
- type RevocationAuditEntry
- type RevokeResult
- type RevokedKeysListResponse
- type RoleDefinition
- type RoleUpdateResponse
- type RolesResponse
- type RotationStatusResponse
- type SAMLAnalyticsResponse
- type SAMLAssertionResult
- type SAMLAttributeMappingResponse
- type SAMLAttributeMappingUpdate
- type SAMLCertificate
- type SAMLCertificateGenerateResponse
- type SAMLCertificateStatusResponse
- type SAMLLogoutResult
- type SAMLSPDetailResponse
- type SAMLSPListResponse
- type SAMLSPRegistrationResponse
- type SAMLSPUpdateResponse
- type SAMLServiceProvider
- type SAMLServiceProviderConfig
- type SAMLSession
- type SAMLSessionListResponse
- type SSOConfigResponse
- type SSOConfigUpdateResponse
- type SSODomainConfigRequest
- type SSODomainConfigResponse
- type SSODomainListResponse
- type SSOPropagateResponse
- type SSOSession
- type SSOSessionCreateResponse
- type SSOSessionDetailResponse
- type SSOSessionListResponse
- type SelfDeleteRequest
- type SelfDeleteResponse
- type ServiceAccountCreate
- type ServiceAccountResponse
- type ServiceDiscoveryResponse
- type ServicePermissionRegister
- type ServicePermissionResponse
- type ServiceStatusResponse
- type SessionRevokeResponse
- type SuperAdminActiveGrantsResponse
- type SuperAdminCleanupResponse
- type SuperAdminExtendRequestModel
- type SuperAdminExtendResponse
- type SuperAdminGrantRequestModel
- type SuperAdminGrantResponse
- type SuperAdminRevokeRequestModel
- type SuperAdminRevokeResponse
- type SwitchOrganizationRequest
- type Team
- type TeamCreate
- type TeamMember
- type TeamMemberAdd
- type TeamMemberRoleUpdate
- type TeamMembershipRequest
- type TeamPermissionsResponse
- type TeamUpdate
- type TempAllowlistCreateResponse
- type TempAllowlistEntry
- type TempAllowlistListResponse
- type TempAllowlistRequest
- type TemplatePreviewResponse
- type TemplateTypeInfo
- type TemplateTypesResponse
- type TestEmailRequest
- type TestEmailSentResponse
- type TokenResponse
- type TokenSet
- type TokenSource
- type TokenUserInfo
- type TokenValidationRequest
- type TransactRelationshipsRequest
- type UpdateNetworkPolicyRequest
- type User
- type UserOrganizationInfo
- type UserPermissions
- type UserUpdate
- type ValidPermissionsResponse
- type ValidateAPIKeyRequest
- type Validator
- type VerifyEmailConfirmRequest
- type VerifyEmailSendRequest
- type ViolationListResponse
- type VisualizationRequest
- type WatchStatusResponse
- type WebAuthnConfigResponse
- type WebAuthnCredential
- type WebAuthnCredentialListResponse
- type WebAuthnCredentialUpdate
- type WebAuthnRegistrationResult
- type WildcardCheckResponse
- type WriteAuthorizationModelRequest
- type WriteAuthorizationModelResponse
- type WriteOperationResponse
- type ZanzibarMessageResponse
- type ZanzibarStore
- func (s *ZanzibarStore) As(callerToken string) *ZanzibarStore
- func (s *ZanzibarStore) Can(ctx context.Context, ...) (bool, error)
- func (s *ZanzibarStore) CanAll(ctx context.Context, checks ...CheckPermissionRequest) (bool, error)
- func (s *ZanzibarStore) CanAny(ctx context.Context, checks ...CheckPermissionRequest) (bool, error)
- func (s *ZanzibarStore) CanID(ctx context.Context, subject, permission, object string) (bool, error)
- func (s *ZanzibarStore) ID() string
- func (s *ZanzibarStore) Relate(ctx context.Context, ...) error
- func (s *ZanzibarStore) RelateID(ctx context.Context, subject, relation, object string) error
- func (s *ZanzibarStore) RelateUntil(ctx context.Context, subject, relation, object string, expires time.Time) error
- func (s *ZanzibarStore) RelationsOn(ctx context.Context, objectType, objectID, relation string) ([]RelationshipEntry, error)
- func (s *ZanzibarStore) Unrelate(ctx context.Context, ...) error
- func (s *ZanzibarStore) UnrelateID(ctx context.Context, subject, relation, object string) error
- func (s *ZanzibarStore) WhatCan(ctx context.Context, subject, permission, objectType string) ([]string, error)
- func (s *ZanzibarStore) WhoCan(ctx context.Context, object, permission string) ([]string, error)
- func (s *ZanzibarStore) Why(ctx context.Context, subject, permission, object string) (*CheckPermissionResponse, error)
Constants ¶
const ( ScopeOrgRead = "org.read" ScopeOrgAdmin = "org.admin" ScopeSystemAdmin = "system.admin" ScopeUsersRead = "users.read" ScopeUsersWrite = "users.write" ScopeUsersInvite = "users.invite" ScopeUsersElevate = "users.elevate" ScopeTeamsRead = "teams.read" ScopeTeamsWrite = "teams.write" ScopeSAMLRead = "saml.read" ScopeSAMLAdmin = "saml.admin" ScopeSSOAdmin = "sso.admin" ScopeZanzibarAdmin = "zanzibar.admin" ScopePermissionsRegister = "permissions.register" ScopeEventsSubscribe = "events.subscribe" ScopeEventsRead = "events.read" ScopeEventsUpdate = "events.update" ScopeEventsDelete = "events.delete" ScopeEventsTest = "events.test" ScopeAdminPasswordPolicyRead = "admin.password_policy.read" ScopeAdminPasswordPolicyWrite = "admin.password_policy.write" ScopeAdminPasswordResetWrite = "admin.password_reset.write" ScopeAdminReportsRead = "admin.reports.read" ScopeAdminAuditRead = "admin.audit.read" ScopeAdminServiceAccountsWrite = "admin.service_accounts.write" ScopeAdminUsersElevate = "admin.users.elevate" ScopeAdminTestWrite = "admin.test.write" ScopeAdminJWKSRead = "admin.jwks.read" ScopeAdminJWKSWrite = "admin.jwks.write" ScopeAdminJWKSRotate = "admin.jwks.rotate" ScopeAdminJWKSRevoke = "admin.jwks.revoke" ScopeAdminJWKSAdmin = "admin.jwks.admin" ScopeAdminCircuitBreakerRead = "admin.circuit_breaker.read" ScopeAdminCircuitBreakerWrite = "admin.circuit_breaker.write" ScopeAdminMetricsRead = "admin.metrics.read" )
This file defines the permission/role vocabulary (dot-permissions) the auth service enforces via RBAC + Zanzibar. They are provided as typed constants so SDK callers (especially admin/service clients) can reference required scopes without stringly-typed literals. The vocabulary mirrors section "Permission/ role vocabulary" of the FULL contract.
const APIKeyPrefix = "ab0t_sk_"
APIKeyPrefix is the prefix of service-to-service API keys.
const DefaultBaseURL = "https://auth.service.ab0t.com"
DefaultBaseURL is the production auth service.
const Version = "0.9.0"
Version is the SDK's released version. It is reported in the User-Agent of every request, so the auth service can attribute traffic and spot clients that are running a version with a known-bad contract.
Keep this in step with the git tag: a tag of v0.1.0 means Version == "0.1.0".
Variables ¶
This section is empty.
Functions ¶
func IsAPIKey ¶
IsAPIKey reports whether a credential is a service API key (vs. a user JWT) based on the ab0t_sk_ prefix.
func IsBadRequest ¶
IsBadRequest reports whether err is an APIError with a 400 status.
func IsConflict ¶
IsConflict reports whether err is an APIError with a 409 status.
func IsForbidden ¶
IsForbidden reports whether err is an APIError with a 403 status (authenticated but lacking the required permission/role).
func IsNotFound ¶
IsNotFound reports whether err is an APIError with a 404 status.
func IsRateLimited ¶
IsRateLimited reports whether err is an APIError with a 429 status.
func IsRetryable ¶
IsRetryable reports whether err represents a transient condition that the transport considers safe to retry (429 or 5xx).
func IsServerError ¶
IsServerError reports whether err is an APIError with a 5xx status.
func IsUnauthorized ¶
IsUnauthorized reports whether err is an APIError with a 401 status (authentication failed / token missing, expired, or invalid).
func IsValidationError ¶
IsValidationError reports whether err is an APIError with a 422 status (request body failed server-side validation).
func Object ¶
Object builds a combined Zanzibar object/subject id ("type:id"), e.g. Object("calendar", "123") == "calendar:123". Subject is an alias for the same shape (e.g. Subject("user", "bob") == "user:bob").
func StatusCode ¶
StatusCode returns the HTTP status code carried by err, or 0 if err is not an APIError.
Types ¶
type APIError ¶
type APIError struct {
// StatusCode is the HTTP status code of the response.
StatusCode int
// Method is the HTTP method of the originating request.
Method string
// Endpoint is the request path (no query string) that produced the error.
Endpoint string
// Code is a machine-readable error code parsed from the body, if any
// (e.g. "invalid_grant", "token_expired"). Empty when not present.
Code string
// Message is a human-readable message parsed from the body, if any.
Message string
// RequestID echoes any X-Request-ID / request correlation id returned.
RequestID string
// Body is the raw (possibly truncated) response body.
Body string
}
APIError is returned for non-2xx responses from the auth service. It captures the HTTP status, the endpoint that produced it, a best-effort machine-readable error code parsed from the response body, and the raw body for diagnostics.
Callers should generally branch on the Is* helpers (IsUnauthorized, etc.) rather than comparing StatusCode directly.
func AsAPIError ¶
AsAPIError returns the underlying *APIError if err wraps one.
type APIKey ¶
type APIKey struct {
ID string `json:"id"`
Name string `json:"name,omitempty"`
Prefix string `json:"prefix,omitempty"`
Permissions []string `json:"permissions,omitempty"`
OrgID string `json:"org_id,omitempty"`
Enabled bool `json:"enabled,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
ExpiresAt string `json:"expires_at,omitempty"`
LastUsedAt string `json:"last_used_at,omitempty"`
}
APIKey is the metadata for a key (no secret). APIKeyResponse in the API.
type APIKeyCreate ¶
type APIKeyCreate struct {
Name string `json:"name"`
Permissions []string `json:"permissions,omitempty"`
OrgID string `json:"org_id,omitempty"`
ExpiresAt string `json:"expires_at,omitempty"`
Audience []string `json:"audience,omitempty"`
}
APIKeyCreate is the body for POST /api-keys/.
type APIKeyUpdate ¶
type APIKeyUpdate struct {
Name *string `json:"name,omitempty"`
Permissions *[]string `json:"permissions,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
ExpiresAt *string `json:"expires_at,omitempty"`
}
APIKeyUpdate is the body for PUT /api-keys/{key_id}.
type APIKeyValidation ¶
type APIKeyValidation struct {
Valid bool `json:"valid"`
UserID string `json:"user_id,omitempty"`
OrgID string `json:"org_id,omitempty"`
Permissions []string `json:"permissions,omitempty"`
Reason string `json:"reason,omitempty"`
}
APIKeyValidation is the result of validating a service API key.
type APIKeyWithToken ¶
APIKeyWithToken is the create response, which includes the secret exactly once (APIKeyWithToken in the API). Token has the "ab0t_sk_" prefix.
type ActiveMagicLink ¶
type ActiveMagicLink struct {
Token string `json:"token,omitempty"`
Email string `json:"email,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
ExpiresAt string `json:"expires_at,omitempty"`
}
ActiveMagicLink describes one outstanding magic link.
type ActiveMagicLinksResponse ¶
type ActiveMagicLinksResponse struct {
Links []ActiveMagicLink `json:"links"`
}
ActiveMagicLinksResponse lists a user's active magic links.
type Actor ¶
type Actor struct {
Valid bool `json:"valid"`
UserID string `json:"user_id,omitempty"`
OrgID string `json:"org_id,omitempty"`
Email string `json:"email,omitempty"`
Permissions []string `json:"permissions,omitempty"`
Audience []string `json:"audience,omitempty"`
ExpiresAt string `json:"expires_at,omitempty"`
Error string `json:"error,omitempty"`
// contains filtered or unexported fields
}
Actor is the resolved identity behind a token (TokenValidationResponse). It is the canonical "who + tenant + capabilities" the server authorizes on.
func (Actor) HasPermission ¶
HasPermission reports whether the actor's resolved permission list contains p. Note: this only reflects permissions the service chose to return (use IncludePermissions or RequiredPermissions when validating). Prefer Client.Authorize / Client.CheckPermission for authoritative decisions.
type AlertEntry ¶
type AlertEntry struct {
Level string `json:"level,omitempty"`
Message string `json:"message,omitempty"`
Timestamp string `json:"timestamp,omitempty"`
Source string `json:"source,omitempty"`
}
AlertEntry is one recent operational alert.
type ApprovalRequestModel ¶
type ApprovalRequestModel struct {
GrantID string `json:"grant_id"`
Approve bool `json:"approve"`
Comment string `json:"comment,omitempty"`
}
ApprovalRequestModel is the body for POST /super-admin/approve.
type AttributeMapping ¶
type AttributeMapping struct {
ID string `json:"id,omitempty"`
SourceAttr string `json:"source_attribute"`
TargetAttr string `json:"target_attribute"`
Transform string `json:"transform,omitempty"`
ProviderID string `json:"provider_id,omitempty"`
}
AttributeMapping is one IdP attribute -> local attribute mapping.
type AttributeMappingCreateResponse ¶
type AttributeMappingCreateResponse struct {
Mapping AttributeMapping `json:"mapping"`
Message string `json:"message,omitempty"`
}
AttributeMappingCreateResponse is the result of POST /federation/attribute-mappings.
type AttributeMappingListResponse ¶
type AttributeMappingListResponse struct {
Mappings []AttributeMapping `json:"mappings"`
Total int `json:"total,omitempty"`
}
AttributeMappingListResponse is the result of GET /federation/attribute-mappings.
type AuthorizationModel ¶
type AuthorizationModel struct {
// SchemaVersion is the model schema language version (e.g. "1.1").
SchemaVersion string `json:"schema_version,omitempty"`
// DSL is the model expressed as OpenFGA/Zanzibar model text.
DSL string `json:"dsl,omitempty"`
// TypeDefinitions is the structured form of the model (type -> relations ->
// rewrites). Left generic (untyped) so any server schema shape is expressible.
TypeDefinitions []map[string]any `json:"type_definitions,omitempty"`
}
AuthorizationModel is a versioned authorization schema: the object types, their relations, and the userset rewrites (unions, computed usersets such as "viewer from parent", wildcards, subject-relation subjects) that checks evaluate against. Provide EITHER DSL (the OpenFGA/Zanzibar model text) OR TypeDefinitions (the equivalent structured form); the server parses whichever is supplied and returns the canonical form plus a version id.
SERVER-GAP: authorization-model management is not part of the auth service OpenAPI as of 2026-07-12; these types describe a forward-looking contract.
type AuthorizationModelResponse ¶
type AuthorizationModelResponse struct {
AuthorizationModelID string `json:"authorization_model_id"`
SchemaVersion string `json:"schema_version,omitempty"`
TypeDefinitions []map[string]any `json:"type_definitions,omitempty"`
DSL string `json:"dsl,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
}
AuthorizationModelResponse is one stored model version (read / list item).
type AuthorizationResponse ¶
type AuthorizationResponse struct {
RedirectURI string `json:"redirect_uri,omitempty"`
Location string `json:"location,omitempty"`
Code string `json:"code,omitempty"`
State string `json:"state,omitempty"`
ConsentURL string `json:"consent_url,omitempty"`
Extra map[string]any `json:"extra,omitempty"`
}
AuthorizationResponse is returned by GET /auth/authorize. For an interactive browser flow the service typically issues a redirect; when accessed programmatically it returns the location and any pending consent metadata.
type AuthorizationServerMetadata ¶
type AuthorizationServerMetadata = OpenIDConfiguration
AuthorizationServerMetadata is the RFC 8414 OAuth metadata document.
type Authorizer ¶
type Authorizer interface {
Authorize(ctx context.Context, token, action string, resource Resource) (bool, error)
}
Authorizer decides whether a token may perform an action on a resource. This is the intended route-gating primitive.
type BulkCheckRequest ¶
type BulkCheckRequest struct {
Checks []CheckPermissionRequest `json:"checks"`
}
BulkCheckRequest is the body for POST /zanzibar/stores/{store_id}/check/bulk. Matches OpenAPI schema BulkCheckRequest (required: checks).
type BulkCheckResults ¶
type BulkCheckResults []CheckPermissionResponse
BulkCheckResults is the result of a bulk check: one CheckPermissionResponse per element of the BulkCheckRequest.Checks slice, IN THE SAME ORDER.
The wire shape is a bare JSON array (OpenAPI: `type: array, items: CheckPermissionResponse`, verified against the live spec 2026-07-25), not an object. An earlier release of this SDK decoded it into a struct with a `results` map — a documented best-effort guess made while the server had no declared response schema. The server has since declared one and the guess was wrong, which made EVERY successful bulk check return a json.UnmarshalTypeError to the caller. If you are upgrading from that release, this type and ZanzibarCheckBulk's return type both changed.
func (BulkCheckResults) AllAllowed ¶
func (b BulkCheckResults) AllAllowed() bool
AllAllowed reports whether every check was allowed. An empty result set returns false — "nothing was checked" is not "everything is permitted".
func (BulkCheckResults) Allowed ¶
func (b BulkCheckResults) Allowed(i int) bool
Allowed reports the decision for the i'th check in the request. It returns false for an out-of-range index rather than panicking: a short response from the server must fail CLOSED, never allow.
type ChangePassword ¶
type ChangePassword struct {
CurrentPassword string `json:"current_password"`
NewPassword string `json:"new_password"`
}
ChangePassword is the body for POST /users/me/change-password.
type CheckPermissionRequest ¶
type CheckPermissionRequest struct {
Subject string `json:"subject"`
Permission string `json:"permission"`
Object string `json:"object"`
OrgID string `json:"org_id,omitempty"`
Context map[string]any `json:"context,omitempty"`
// ConsistencyToken requests a read at least as fresh as the write that
// produced it (read-after-write). Maps to `consistency_token`.
ConsistencyToken string `json:"consistency_token,omitempty"`
}
CheckPermissionRequest is the body for POST /zanzibar/stores/{store_id}/check (and the elements of a BulkCheckRequest). Matches OpenAPI schema CheckPermissionRequest (required: subject, permission, object).
func Check ¶ added in v0.3.0
func Check(subjectType, subjectID, permission, objectType, objectID string) CheckPermissionRequest
Check builds one element of a CanAll/CanAny batch.
ok, err := store.CanAll(ctx,
authclient.Check("user", "alice", "view", "doc", "1"),
authclient.Check("user", "alice", "view", "doc", "2"),
)
type CheckPermissionResponse ¶
type CheckPermissionResponse struct {
Allowed bool `json:"allowed"`
Reason string `json:"reason,omitempty"`
Path []string `json:"path,omitempty"`
Cached bool `json:"cached,omitempty"`
CheckTimeMS float64 `json:"check_time_ms,omitempty"`
}
CheckPermissionResponse is the result of a Zanzibar check. Matches OpenAPI schema CheckPermissionResponse (required: allowed).
type CircuitBreakerResetAllResponse ¶
type CircuitBreakerResetAllResponse struct {
ResetCount int `json:"reset_count,omitempty"`
Message string `json:"message,omitempty"`
}
CircuitBreakerResetAllResponse is the result of resetting all breakers.
type CircuitBreakerResetResponse ¶
type CircuitBreakerResetResponse struct {
Name string `json:"name,omitempty"`
Reset bool `json:"reset,omitempty"`
Message string `json:"message,omitempty"`
}
CircuitBreakerResetResponse is the result of resetting one breaker.
type CircuitBreakerStatusResponse ¶
CircuitBreakerStatusResponse is the result of GET /admin/circuit-breakers/status.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a typed, isolated client for the auth service. It is safe for concurrent use.
func (*Client) AcceptInvitePage ¶
func (c *Client) AcceptInvitePage(ctx context.Context, slug, inviteToken string) (map[string]any, error)
AcceptInvitePage fetches the invite-acceptance page payload for a tenant slug. GET /organizations/{slug}/accept-invite. token is the invite token query param.
func (*Client) ActivateSigningKey ¶
func (c *Client) ActivateSigningKey(ctx context.Context, kid, callerToken string) (*KeyActivateResponse, error)
ActivateSigningKey activates a signing key by kid. POST /admin/jwks/activate/{kid}.
func (*Client) ActivateUser ¶
func (c *Client) ActivateUser(ctx context.Context, userID, callerToken string) (*MessageDetailResponse, error)
ActivateUser reactivates a user (requires users.write). POST /users/{user_id}/activate.
func (*Client) AddTeamMember ¶
func (c *Client) AddTeamMember(ctx context.Context, teamID string, req TeamMemberAdd, callerToken string) (*MessageResponse, error)
AddTeamMember adds a member to a team (requires teams.write). POST /teams/{team_id}/members.
func (*Client) AuthorizationServerMetadata ¶
func (c *Client) AuthorizationServerMetadata(ctx context.Context) (*AuthorizationServerMetadata, error)
AuthorizationServerMetadata fetches the RFC 8414 metadata document. GET /.well-known/oauth-authorization-server.
func (*Client) Authorize ¶
func (c *Client) Authorize(ctx context.Context, token, action string, resource Resource) (bool, error)
Authorize reports whether token may perform action on resource. It validates the token with an inline required-permission (and optional resource) check, so it needs no service privilege. This is the route-gating primitive.
resource may be the zero Resource for non-resource-scoped actions.
A credential may be a user JWT or a service/agent API key (ab0t_sk_…). API keys are resolved at POST /auth/validate-api-key (the validate-token endpoint does not resolve them), so Authorize routes an API-key credential there with the required permission; JWTs use the inline validate-token check below.
func (*Client) ChangeMyPassword ¶
func (c *Client) ChangeMyPassword(ctx context.Context, token string, req ChangePassword) (*MessageResponse, error)
ChangeMyPassword changes the caller's password. POST /users/me/change-password.
func (*Client) CheckDelegation ¶
func (c *Client) CheckDelegation(ctx context.Context, targetUserID, token string) (*DelegationCheckResponse, error)
CheckDelegation reports whether the caller may act on behalf of a target user. GET /delegation/check/{target_user_id}.
func (*Client) CheckPermission ¶
func (c *Client) CheckPermission(ctx context.Context, req PermissionCheckRequest, callerToken string) (*PermissionDecision, error)
CheckPermission performs an authoritative RBAC check for a specific user. POST /permissions/check. Requires the caller (service API key or a token with users.read) to be authorized; configure WithAPIKey or pass a privileged token via callerToken (use "" to fall back to the configured service API key).
func (*Client) CheckPermissionPublic ¶
func (c *Client) CheckPermissionPublic(ctx context.Context, req PermissionCheckRequest) (*PermissionDecision, error)
CheckPermissionPublic performs a permission check via the public POST /auth/check-permission endpoint (no caller auth required). This is the account/RBAC surface: it takes PermissionCheckRequest{user_id,...}, NOT a Zanzibar tuple.
func (*Client) CheckQuota ¶
func (c *Client) CheckQuota(ctx context.Context, resourceType, token string) (*QuotaCheckResponse, error)
CheckQuota checks the caller's quota for a resource type. GET /quotas/check/{resource_type}.
func (*Client) CircuitBreakerStatus ¶
func (c *Client) CircuitBreakerStatus(ctx context.Context, callerToken string) (*CircuitBreakerStatusResponse, error)
CircuitBreakerStatus returns the status of all circuit breakers. GET /admin/circuit-breakers/status.
func (*Client) CleanupSigningKeys ¶
func (c *Client) CleanupSigningKeys(ctx context.Context, req KeyCleanupRequest, callerToken string) (*KeyCleanupResponse, error)
CleanupSigningKeys removes old signing keys. POST /admin/jwks/cleanup.
func (*Client) ConfirmPasswordResetAuth ¶
func (c *Client) ConfirmPasswordResetAuth(ctx context.Context, req PasswordResetConfirm) (*PasswordResetConfirmResponse, error)
ConfirmPasswordResetAuth confirms a password reset via the auth endpoint. POST /auth/password-reset/confirm.
func (*Client) ConfirmVerificationEmail ¶
ConfirmVerificationEmail confirms an email-verification token. POST /auth/verify-email/confirm.
func (*Client) CreateAPIKey ¶
func (c *Client) CreateAPIKey(ctx context.Context, req APIKeyCreate, token string) (*APIKeyWithToken, error)
CreateAPIKey mints a new API key. The secret token is returned exactly once. POST /api-keys/. Requires a user JWT (BearerJWT).
func (*Client) CreateAttributeMapping ¶
func (c *Client) CreateAttributeMapping(ctx context.Context, req AttributeMapping, callerToken string) (*AttributeMappingCreateResponse, error)
CreateAttributeMapping creates a federation attribute mapping (requires system.admin). POST /federation/attribute-mappings.
func (*Client) CreateDomainToken ¶
CreateDomainToken mints a domain-scoped SSO token. POST /federation/sso/create-token.
func (*Client) CreateEmergencyOverride ¶
func (c *Client) CreateEmergencyOverride(ctx context.Context, req EmergencyOverrideRequest, callerToken string) (*EmergencyOverrideCreateResponse, error)
CreateEmergencyOverride creates an emergency network override. POST /network-policy/emergency-override. Requires org.admin.
func (*Client) CreateEventSubscription ¶
func (c *Client) CreateEventSubscription(ctx context.Context, req EventSubscriptionCreate, token string) (*EventSubscription, error)
CreateEventSubscription creates a webhook subscription. POST /events/subscriptions. Requires events.subscribe.
func (*Client) CreateNamespace ¶
func (c *Client) CreateNamespace(ctx context.Context, storeID string, req NamespaceRequest, callerToken string) (*ZanzibarMessageResponse, error)
CreateNamespace defines a namespace (requires zanzibar.admin). POST /zanzibar/stores/{store_id}/namespaces.
func (*Client) CreateNetworkPolicy ¶
func (c *Client) CreateNetworkPolicy(ctx context.Context, req CreateNetworkPolicyRequest, callerToken string) (*NetworkPolicyCreateResponse, error)
CreateNetworkPolicy creates an IP/network access policy. POST /network-policy/. Requires org.admin.
func (*Client) CreateOrganization ¶
func (c *Client) CreateOrganization(ctx context.Context, req OrganizationCreate, token string) (*Organization, error)
CreateOrganization creates a new organization/tenant. POST /organizations/.
func (*Client) CreateProvider ¶
func (c *Client) CreateProvider(ctx context.Context, req ProviderConfigCreate, callerToken string) (*Provider, error)
CreateProvider creates a provider/SSO connection (requires org.admin). POST /providers/.
func (*Client) CreateSSODomain ¶
func (c *Client) CreateSSODomain(ctx context.Context, domain string, req SSODomainConfigRequest, callerToken string) (*SSODomainConfigResponse, error)
CreateSSODomain creates an SSO domain config (requires org.admin). POST /federation/sso/domains/{domain}.
func (*Client) CreateSSOSession ¶
func (c *Client) CreateSSOSession(ctx context.Context, token string) (*SSOSessionCreateResponse, error)
CreateSSOSession creates a federated SSO session. POST /federation/sso/sessions.
func (*Client) CreateServiceAccount ¶
func (c *Client) CreateServiceAccount(ctx context.Context, req ServiceAccountCreate, callerToken string) (*ServiceAccountResponse, error)
CreateServiceAccount creates a service account (machine identity). POST /admin/users/create-service-account.
func (*Client) CreateTeam ¶
func (c *Client) CreateTeam(ctx context.Context, orgID string, req TeamCreate, callerToken string) (*Team, error)
CreateTeam creates a team in an organization (requires teams.write). POST /organizations/{org_id}/teams.
func (*Client) CreateTempAllowlist ¶
func (c *Client) CreateTempAllowlist(ctx context.Context, req TempAllowlistRequest, callerToken string) (*TempAllowlistCreateResponse, error)
CreateTempAllowlist adds a temporary IP allowlist entry. POST /network-policy/temp-allowlist.
func (*Client) DeactivateUser ¶
func (c *Client) DeactivateUser(ctx context.Context, userID, callerToken string) (*MessageDetailResponse, error)
DeactivateUser deactivates a user (requires users.write). POST /users/{user_id}/deactivate.
func (*Client) Delegate ¶
func (c *Client) Delegate(ctx context.Context, req DelegateTokenRequest, token string) (*TokenSet, error)
Delegate mints a delegated (act-as) token for the target user, scoped to the permissions the caller holds. POST /auth/delegate.
func (*Client) DeleteAPIKey ¶
func (c *Client) DeleteAPIKey(ctx context.Context, keyID, callerToken string) (*MessageResponse, error)
DeleteAPIKey revokes an API key. DELETE /api-keys/{key_id}.
func (*Client) DeleteAllRelationshipsForObject ¶
func (c *Client) DeleteAllRelationshipsForObject(ctx context.Context, storeID, objectType, objectID, token string) (int, error)
DeleteAllRelationshipsForObject removes EVERY tuple whose object == (objectType, objectID) — the generic cleanup primitive for deleting a resource or erasing its relationships. It is implemented client-side as a ListRelationships -> DeleteRelationships loop (there is no bulk server route today), deleting one tuple per call because the server's DELETE .../relationships accepts a SINGLE tuple. It re-lists from the start after draining a batch, so it is idempotent and safe to retry. Requires zanzibar.admin. Returns the total number of tuples deleted.
func (*Client) DeleteClientRegistration ¶
DeleteClientRegistration deletes a dynamically-registered client. DELETE /auth/oauth/register/{client_id}.
func (*Client) DeleteCurrentUser ¶
func (c *Client) DeleteCurrentUser(ctx context.Context, confirmEmail, callerToken string) (*SelfDeleteResponse, error)
DeleteCurrentUser IRREVERSIBLY deletes the authenticated caller's own account. DELETE /users/me. Requires the caller's own bearer token; there is no admin/impersonation form of this call — a user may only delete themselves.
⚠️ THIS IS NOT UNDOABLE. Per the endpoint's own contract the server will: soft-delete the account and anonymize its PII, invalidate every session, hard-delete every API key, remove permissions, delegations and Zanzibar relationship tuples, drop organization and team memberships (flagging any organization left without an owner), clean up enterprise records, and emit an audit event.
confirmEmail must equal the caller's own account email exactly; a mismatch is rejected with no state change. Callers should obtain it from a deliberate user action (typing it), never auto-fill it from the session — auto-filling defeats the entire purpose of the guard.
func (*Client) DeleteEventSubscription ¶
DeleteEventSubscription deletes a webhook subscription. DELETE /events/subscriptions/{subscription_id}. Requires events.delete.
func (*Client) DeleteNetworkOverride ¶
func (c *Client) DeleteNetworkOverride(ctx context.Context, overrideID, callerToken string) (*NetworkPolicyStatusResponse, error)
DeleteNetworkOverride deletes an emergency override. DELETE /network-policy/overrides/{override_id}.
func (*Client) DeleteNetworkPolicy ¶
func (c *Client) DeleteNetworkPolicy(ctx context.Context, policyID, callerToken string) (*NetworkPolicyStatusResponse, error)
DeleteNetworkPolicy deletes a network policy. DELETE /network-policy/{policy_id}.
func (*Client) DeleteOrgEmailConfig ¶
func (c *Client) DeleteOrgEmailConfig(ctx context.Context, orgID, callerToken string) (*EmailConfigDeleteResponse, error)
DeleteOrgEmailConfig deletes an org's email configuration. DELETE /organizations/{org_id}/emails/config. Requires org.admin.
func (*Client) DeleteOrgEmailTemplate ¶
func (c *Client) DeleteOrgEmailTemplate(ctx context.Context, orgID, templateType, callerToken string) (*EmailTemplateDeleteResponse, error)
DeleteOrgEmailTemplate deletes one of an org's email templates. DELETE /organizations/{org_id}/emails/templates/{template_type}. Requires org.admin.
func (*Client) DeleteOrganization ¶
func (c *Client) DeleteOrganization(ctx context.Context, orgID, callerToken string) (*MessageResponse, error)
DeleteOrganization deletes an organization (requires org.admin). DELETE /organizations/{org_id}.
func (*Client) DeleteProvider ¶
func (c *Client) DeleteProvider(ctx context.Context, providerID, callerToken string) (*MessageResponse, error)
DeleteProvider deletes a provider config (requires org.admin). DELETE /providers/{provider_id}.
func (*Client) DeleteRelationships ¶
func (c *Client) DeleteRelationships(ctx context.Context, storeID string, req RelationshipRequest, token string) (*WriteOperationResponse, error)
DeleteRelationships deletes a single relationship tuple (requires zanzibar.admin). DELETE /zanzibar/stores/{store_id}/relationships.
func (*Client) DeleteSAMLSP ¶
func (c *Client) DeleteSAMLSP(ctx context.Context, spID, callerToken string) (*EnterpriseMessageResponse, error)
DeleteSAMLSP deletes a service provider. DELETE /saml/sp/{sp_id}. Requires saml.admin / system.admin.
func (*Client) DeleteSSODomain ¶
func (c *Client) DeleteSSODomain(ctx context.Context, domain, callerToken string) (*MessageResponse, error)
DeleteSSODomain removes an SSO domain config (requires org.admin). DELETE /federation/sso/domains/{domain}.
func (*Client) DeleteSSOSession ¶
func (c *Client) DeleteSSOSession(ctx context.Context, sessionID, token string) (*MessageResponse, error)
DeleteSSOSession terminates one of the caller's SSO sessions. DELETE /federation/sso/sessions/{session_id}.
func (*Client) DeleteTeam ¶
func (c *Client) DeleteTeam(ctx context.Context, teamID, callerToken string) (*MessageResponse, error)
DeleteTeam deletes a team (requires teams.write). DELETE /teams/{team_id}.
func (*Client) DeleteTempAllowlist ¶
func (c *Client) DeleteTempAllowlist(ctx context.Context, entryID, callerToken string) (*NetworkPolicyStatusResponse, error)
DeleteTempAllowlist removes a temporary allowlist entry. DELETE /network-policy/temp-allowlist/{entry_id}.
func (*Client) DeleteWebAuthnCredential ¶
func (c *Client) DeleteWebAuthnCredential(ctx context.Context, token, credentialID string) (*EnterpriseMessageResponse, error)
DeleteWebAuthnCredential removes one of the caller's credentials. DELETE /auth/passwordless/webauthn/credentials/{credential_id}.
func (*Client) Discover ¶
func (c *Client) Discover(ctx context.Context) (*ServiceDiscoveryResponse, error)
Discover fetches the service-discovery root. GET / (public).
func (*Client) DismissReport ¶
func (c *Client) DismissReport(ctx context.Context, reportID, callerToken string) (*LeakReportActionResponse, error)
DismissReport dismisses an abuse report. POST /reports/{report_id}/dismiss. Requires org.admin.
func (*Client) ElevatePrivileges ¶
func (c *Client) ElevatePrivileges(ctx context.Context, req ElevatePrivilegesRequest, callerToken string) (*ElevatePrivilegesResponse, error)
ElevatePrivileges grants elevated privileges to a user. POST /admin/users/elevate-privileges.
func (*Client) EmailHistory ¶
func (c *Client) EmailHistory(ctx context.Context, callerToken string) (*EmailHistoryResponse, error)
EmailHistory returns the system-wide sent-email history. GET /admin/emails/history. Requires system.admin.
func (*Client) EmailStats ¶
EmailStats returns system-wide email statistics. GET /admin/emails/stats. Requires system.admin.
func (*Client) EmailTemplateTypes ¶
func (c *Client) EmailTemplateTypes(ctx context.Context, callerToken string) (*TemplateTypesResponse, error)
EmailTemplateTypes lists the available email template types. GET /admin/emails/template-types. Requires system.admin.
func (*Client) EmergencyRevokeAPIKeys ¶
func (c *Client) EmergencyRevokeAPIKeys(ctx context.Context, req EmergencyRevokeRequest, callerToken string) (*EmergencyRevokeResponse, error)
EmergencyRevokeAPIKeys emergency-revokes API keys (requires org.admin). POST /admin/api-keys/emergency-revoke.
func (*Client) EnsureAuthorizationModel ¶
func (c *Client) EnsureAuthorizationModel(ctx context.Context, storeID string, model AuthorizationModel, callerToken string) (modelID string, changed bool, err error)
EnsureAuthorizationModel registers model only if the store's latest model is not already equivalent, and returns the effective (existing-or-newly-written) model id. It is idempotent and safe to run on every deploy: an unchanged model is a no-op (changed == false), a new or differing model is written (changed == true). Requires zanzibar.admin.
SERVER-GAP: this helper composes ReadAuthorizationModel + WriteAuthorizationModel, NEITHER of which exists in the auth service OpenAPI as of 2026-07-12 (no authorization-model management). Forward-looking; both underlying calls will 404 until the server implements model management.
func (*Client) EnterpriseHelp ¶
EnterpriseHelp fetches the enterprise help payload. GET /help/enterprise (public).
func (*Client) EnterpriseLicense ¶
EnterpriseLicense fetches the enterprise license payload. GET /enterprise/license (public).
func (*Client) EvaluateNetworkPolicy ¶
func (c *Client) EvaluateNetworkPolicy(ctx context.Context, ip string) (*PolicyEvaluationResult, error)
EvaluateNetworkPolicy evaluates whether an IP is allowed (public). GET /network-policy/evaluate. ip is supplied as the `ip` query parameter.
func (*Client) EventSubscriptionStats ¶
func (c *Client) EventSubscriptionStats(ctx context.Context, subscriptionID, token string) (*EventSubscriptionStatsResponse, error)
EventSubscriptionStats returns delivery statistics for a subscription. GET /events/subscriptions/{subscription_id}/stats. Requires events.read.
func (*Client) EventTypes ¶
func (c *Client) EventTypes(ctx context.Context) (*EventTypesResponse, error)
EventTypes lists the available event types. GET /events/types (public).
func (*Client) FederationStats ¶
func (c *Client) FederationStats(ctx context.Context, callerToken string) (*FederationStatsResponse, error)
FederationStats returns federation usage statistics (requires system.admin). GET /federation/stats.
func (*Client) ForcePasswordReset ¶
func (c *Client) ForcePasswordReset(ctx context.Context, req ForcePasswordResetRequest, callerToken string) (*ForcePasswordResetResponse, error)
ForcePasswordReset forces password resets for users. POST /admin/password-policy/force-reset.
func (*Client) ForwardAuth ¶
func (c *Client) ForwardAuth(ctx context.Context, method, token string) (*ForwardAuthDecision, error)
ForwardAuth is the primary forward-auth decision endpoint. method may be GET, POST or HEAD. /forward-auth/.
func (*Client) ForwardAuthFail ¶
func (c *Client) ForwardAuthFail(ctx context.Context, method, token string) (*ForwardAuthDecision, error)
ForwardAuthFail is the explicit-fail decision endpoint. method may be GET, POST or HEAD. /forward-auth/fail.
func (*Client) ForwardAuthLive ¶
func (c *Client) ForwardAuthLive(ctx context.Context, method, token string) (*ForwardAuthDecision, error)
ForwardAuthLive is the liveness decision endpoint. method may be GET, POST or HEAD. /forward-auth/live.
func (*Client) ForwardAuthPass ¶
func (c *Client) ForwardAuthPass(ctx context.Context, method, token string) (*ForwardAuthDecision, error)
ForwardAuthPass is the explicit-pass decision endpoint. method may be GET, POST or HEAD. /forward-auth/pass.
func (*Client) GenerateRecoveryCodes ¶
func (c *Client) GenerateRecoveryCodes(ctx context.Context, token string) (*RecoveryCodesResponse, error)
GenerateRecoveryCodes generates a new set of MFA recovery codes for the caller. POST /auth/passwordless/recovery-codes/generate.
func (*Client) GenerateSAMLCertificate ¶
func (c *Client) GenerateSAMLCertificate(ctx context.Context, callerToken string) (*SAMLCertificateGenerateResponse, error)
GenerateSAMLCertificate generates a new SAML certificate. POST /saml/certificates/generate. Requires saml.admin / system.admin.
func (*Client) GenerateSigningKey ¶
func (c *Client) GenerateSigningKey(ctx context.Context, req KeyGenerationRequest, callerToken string) (*KeyGenerateResponse, error)
GenerateSigningKey generates a new signing key. POST /admin/jwks/generate.
func (*Client) GetClientRegistration ¶
func (c *Client) GetClientRegistration(ctx context.Context, clientID string) (*ClientRegistrationResponse, error)
GetClientRegistration reads a dynamically-registered client. GET /auth/oauth/register/{client_id}.
func (*Client) GetEventSubscription ¶
func (c *Client) GetEventSubscription(ctx context.Context, subscriptionID, token string) (*EventSubscription, error)
GetEventSubscription fetches a webhook subscription. GET /events/subscriptions/{subscription_id}. Requires events.read.
func (*Client) GetHostedLoginPage ¶
GetHostedLoginPage fetches the hosted login page payload for a tenant slug. GET /login/{slug}. Returns the raw JSON the hosted page is rendered from.
func (*Client) GetJITConfig ¶
GetJITConfig returns just-in-time provisioning config (requires org.admin). GET /federation/jit/config.
func (*Client) GetLoginConfig ¶
func (c *Client) GetLoginConfig(ctx context.Context, orgID, callerToken string) (*LoginConfigResponse, error)
GetLoginConfig returns a tenant's hosted-login configuration. GET /organizations/{org_id}/login-config.
func (*Client) GetMeshProvider ¶
func (c *Client) GetMeshProvider(ctx context.Context, serviceID, callerToken string) (*MeshProvider, error)
GetMeshProvider fetches one provider entry by its service id. GET /mesh/providers/{service_id}.
func (*Client) GetMyOrganizations ¶
func (c *Client) GetMyOrganizations(ctx context.Context, token string) ([]UserOrganizationInfo, error)
GetMyOrganizations lists organizations the token's user belongs to. GET /users/me/organizations.
func (*Client) GetMyProfile ¶
GetMyProfile returns the caller's full profile. GET /users/me.
func (*Client) GetNamespace ¶
func (c *Client) GetNamespace(ctx context.Context, storeID, name, callerToken string) (*NamespaceDetailResponse, error)
GetNamespace fetches one namespace definition. GET /zanzibar/stores/{store_id}/namespaces/{namespace_name}.
func (*Client) GetNetworkPolicy ¶
func (c *Client) GetNetworkPolicy(ctx context.Context, policyID, callerToken string) (*NetworkPolicy, error)
GetNetworkPolicy fetches a network policy. GET /network-policy/{policy_id}.
func (*Client) GetOrgEmailConfig ¶
func (c *Client) GetOrgEmailConfig(ctx context.Context, orgID, callerToken string) (*OrgEmailConfigResponse, error)
GetOrgEmailConfig returns an org's email configuration. GET /organizations/{org_id}/emails/config. Requires org.admin.
func (*Client) GetOrgEmailTemplate ¶
func (c *Client) GetOrgEmailTemplate(ctx context.Context, orgID, templateType, callerToken string) (*OrgEmailTemplateResponse, error)
GetOrgEmailTemplate fetches one of an org's email templates. GET /organizations/{org_id}/emails/templates/{template_type}. Requires org.admin.
func (*Client) GetOrgHierarchy ¶
func (c *Client) GetOrgHierarchy(ctx context.Context, orgID, callerToken string) (*OrgHierarchyResponse, error)
GetOrgHierarchy returns the org's sub-tree. GET /organizations/{org_id}/hierarchy.
func (*Client) GetOrganization ¶
func (c *Client) GetOrganization(ctx context.Context, orgID, callerToken string) (*Organization, error)
GetOrganization fetches an organization/tenant. GET /organizations/{org_id}.
func (*Client) GetPasswordPolicy ¶
func (c *Client) GetPasswordPolicy(ctx context.Context, orgID, callerToken string) (*PasswordPolicyGetResponse, error)
GetPasswordPolicy fetches an org's password policy. GET /admin/password-policy/{org_id}.
func (*Client) GetProvider ¶
func (c *Client) GetProvider(ctx context.Context, providerID, callerToken string) (*Provider, error)
GetProvider fetches a provider config (requires org.read). GET /providers/{provider_id}.
func (*Client) GetPublicLoginConfig ¶
GetPublicLoginConfig returns the public login config for a tenant slug. GET /organizations/{slug}/login-config/public.
func (*Client) GetRoles ¶
func (c *Client) GetRoles(ctx context.Context, callerToken string) (map[string]RoleDefinition, error)
GetRoles returns the available roles and their permissions. GET /permissions/roles.
func (*Client) GetSAMLAttributeMappings ¶
func (c *Client) GetSAMLAttributeMappings(ctx context.Context, callerToken string) (*SAMLAttributeMappingResponse, error)
GetSAMLAttributeMappings returns the SAML attribute mappings. GET /saml/attributes/mappings. Requires saml.read / system.admin.
func (*Client) GetSAMLCertificates ¶
func (c *Client) GetSAMLCertificates(ctx context.Context, callerToken string) (*SAMLCertificateStatusResponse, error)
GetSAMLCertificates returns SAML certificate status. GET /saml/certificates. Requires saml.read / system.admin.
func (*Client) GetSAMLSP ¶
func (c *Client) GetSAMLSP(ctx context.Context, spID, callerToken string) (*SAMLSPDetailResponse, error)
GetSAMLSP fetches a service provider by id. GET /saml/sp/{sp_id}.
func (*Client) GetSSOConfig ¶
GetSSOConfig returns the org SSO configuration (requires org.admin). GET /federation/sso/config.
func (*Client) GetSSODomain ¶
func (c *Client) GetSSODomain(ctx context.Context, domain, callerToken string) (*SSODomainConfigResponse, error)
GetSSODomain fetches one SSO domain config (requires org.admin). GET /federation/sso/domains/{domain}.
func (*Client) GetSSOSession ¶
func (c *Client) GetSSOSession(ctx context.Context, sessionID, token string) (*SSOSessionDetailResponse, error)
GetSSOSession fetches one of the caller's SSO sessions. GET /federation/sso/sessions/{session_id}.
func (*Client) GetTeamPermissions ¶
func (c *Client) GetTeamPermissions(ctx context.Context, teamID, callerToken string) (*TeamPermissionsResponse, error)
GetTeamPermissions returns a team's effective permissions (requires teams.read). GET /teams/{team_id}/permissions.
func (*Client) GetUser ¶
GetUser fetches a user by id. GET /users/{user_id}. callerToken may be a user JWT or "" to use the service API key.
func (*Client) GetUserPermissions ¶
func (c *Client) GetUserPermissions(ctx context.Context, userID, callerToken string) (*UserPermissions, error)
GetUserPermissions lists a user's effective permissions. GET /permissions/user/{user_id}.
func (*Client) GlobalEmailConfig ¶
func (c *Client) GlobalEmailConfig(ctx context.Context, callerToken string) (*GlobalEmailConfigResponse, error)
GlobalEmailConfig returns the system-wide email configuration. GET /admin/emails/config. Requires system.admin.
func (*Client) GrantDelegation ¶
func (c *Client) GrantDelegation(ctx context.Context, req DelegationGrant, token string) (*DelegationResponse, error)
GrantDelegation grants act-as rights to an actor (you can only delegate permissions you hold). POST /delegation/grant.
func (*Client) GrantPermission ¶
func (c *Client) GrantPermission(ctx context.Context, userID, orgID, permission, callerToken string) (*MessageResponse, error)
GrantPermission grants an explicit permission to a user. POST /permissions/grant. Requires org.admin / users.write (or api.*).
Per the auth service OpenAPI (verified 2026-07-12) this endpoint takes its arguments as REQUIRED query parameters (user_id, org_id, permission), NOT a request body.
func (*Client) Health ¶
func (c *Client) Health(ctx context.Context) (*HealthCheckResponse, error)
Health returns the service health check. GET /health (public).
func (*Client) Introspect ¶
Introspect performs RFC 7662 token introspection. POST /token/introspect. hint may be "" or "access_token"/"refresh_token". Always check Active.
func (*Client) InviteToOrganization ¶
func (c *Client) InviteToOrganization(ctx context.Context, orgID string, req OrganizationInvite, callerToken string) (*MessageResponse, error)
InviteToOrganization invites a user by email (requires users.invite). POST /organizations/{org_id}/invite.
func (*Client) JWKS ¶
JWKS returns the service's signing key set, using a TTL cache (10m) with single-flight refresh. GET /.well-known/jwks.json. Use RefreshJWKS to force a fetch (e.g. on an unknown kid).
func (*Client) JWKSHealth ¶
JWKSHealth reports the health of the global JWKS endpoint. GET /.well-known/jwks.json/health.
func (*Client) JWKSHealthDetail ¶
func (c *Client) JWKSHealthDetail(ctx context.Context) (*JwksHealthResponse, error)
JWKSHealthDetail returns JWKS health detail. GET /health/jwks (public).
func (*Client) JWKSMetrics ¶
JWKSMetrics returns JWKS operational metrics. GET /metrics/jwks. Requires admin.jwks.read / jwks.read.
func (*Client) JWKSNextRotation ¶
func (c *Client) JWKSNextRotation(ctx context.Context, callerToken string) (*NextRotationResponse, error)
JWKSNextRotation returns the next scheduled rotation. GET /admin/jwks/next-rotation.
func (*Client) JWKSRotationStatus ¶
func (c *Client) JWKSRotationStatus(ctx context.Context, callerToken string) (*RotationStatusResponse, error)
JWKSRotationStatus returns current rotation status. GET /admin/jwks/rotation-status.
func (*Client) ListAPIKeys ¶
ListAPIKeys lists the caller's API keys. GET /api-keys/.
func (*Client) ListActiveMagicLinks ¶
func (c *Client) ListActiveMagicLinks(ctx context.Context, token string) (*ActiveMagicLinksResponse, error)
ListActiveMagicLinks lists the caller's outstanding magic links. GET /auth/passwordless/magic-link/active.
func (*Client) ListAttributeMappings ¶
func (c *Client) ListAttributeMappings(ctx context.Context, callerToken string) (*AttributeMappingListResponse, error)
ListAttributeMappings lists federation attribute mappings (requires system.admin). GET /federation/attribute-mappings.
func (*Client) ListAuthorizationModels ¶
func (c *Client) ListAuthorizationModels(ctx context.Context, storeID, pageToken, callerToken string) (*ListAuthorizationModelsResponse, error)
ListAuthorizationModels lists a store's model versions (newest first). Pass pageToken == "" for the first page and the response's ContinuationToken to continue. GET /zanzibar/stores/{store_id}/authorization-models.
SERVER-GAP: this endpoint does NOT exist in the auth service OpenAPI as of 2026-07-12 (no authorization-model management). Forward-looking; will 404 until the server implements it.
func (*Client) ListDelegations ¶
func (c *Client) ListDelegations(ctx context.Context, userID, token string) ([]DelegationEntry, error)
ListDelegations lists a user's delegations (own unless admin). GET /delegation/list/{user_id}.
func (*Client) ListDevices ¶
ListDevices lists the caller's known passwordless devices. GET /auth/passwordless/devices.
func (*Client) ListEventSubscriptions ¶
func (c *Client) ListEventSubscriptions(ctx context.Context, token string) (*EventSubscriptionListResponse, error)
ListEventSubscriptions lists webhook subscriptions. GET /events/subscriptions. Requires events.read.
func (*Client) ListInvitations ¶
func (c *Client) ListInvitations(ctx context.Context, orgID, callerToken string) ([]InvitationListItem, error)
ListInvitations lists pending invitations. GET /organizations/{org_id}/invitations.
func (*Client) ListMeshProviders ¶
func (c *Client) ListMeshProviders(ctx context.Context, q url.Values, callerToken string) (*MeshProvidersListResponse, error)
ListMeshProviders lists providers in the mesh directory. GET /mesh/providers. Pass an empty callerToken for the public directory.
q may carry server-supported filters; pass nil for none.
func (*Client) ListNamespaces ¶
func (c *Client) ListNamespaces(ctx context.Context, storeID, callerToken string) (*NamespaceListResponse, error)
ListNamespaces lists namespaces in a store. GET /zanzibar/stores/{store_id}/namespaces.
func (*Client) ListNetworkOverrides ¶
func (c *Client) ListNetworkOverrides(ctx context.Context, callerToken string) (*OverrideListResponse, error)
ListNetworkOverrides lists emergency overrides. GET /network-policy/overrides.
func (*Client) ListNetworkPolicies ¶
func (c *Client) ListNetworkPolicies(ctx context.Context, callerToken string) (*NetworkPolicyListResponse, error)
ListNetworkPolicies lists network policies. GET /network-policy/.
func (*Client) ListNetworkViolations ¶
func (c *Client) ListNetworkViolations(ctx context.Context, callerToken string) (*ViolationListResponse, error)
ListNetworkViolations lists recorded access violations. GET /network-policy/violations.
func (*Client) ListObjectsPaged ¶
func (c *Client) ListObjectsPaged(ctx context.Context, storeID string, req ListObjectsRequest, callerToken string) (*ListObjectsResponse, error)
ListObjectsPaged lists the object ids a subject relates to. Set req.MaxResults (1..1000) to cap the result set. POST /zanzibar/stores/{store_id}/list-objects.
SERVER-GAP (pagination): the route is REAL, but the auth service OpenAPI (verified 2026-07-12) caps results with `max_results` and has NO request-side continuation token. The response's ContinuationToken is documented as "reserved for future use" and currently always empty, so this method returns at most one (capped) page. It is retained as an alias of ZanzibarListObjects for callers that want the pagination-shaped name.
func (*Client) ListOrgClients ¶
func (c *Client) ListOrgClients(ctx context.Context, orgID, callerToken string) (*OrgClientSafeResponse, error)
ListOrgClients lists the OAuth clients registered for a tenant (safe view). GET /organizations/{org_id}/clients.
func (*Client) ListOrgEmailTemplates ¶
func (c *Client) ListOrgEmailTemplates(ctx context.Context, orgID, callerToken string) (*OrgEmailTemplateResponse, error)
ListOrgEmailTemplates lists an org's email templates. GET /organizations/{org_id}/emails/templates. Requires org.admin.
func (*Client) ListOrgSessions ¶
func (c *Client) ListOrgSessions(ctx context.Context, orgID, callerToken string) (*OrgSessionsResponse, error)
ListOrgSessions lists active sessions in an organization. GET /organizations/{org_id}/sessions.
func (*Client) ListOrgUsers ¶
func (c *Client) ListOrgUsers(ctx context.Context, orgID, callerToken string) (*OrgUserResponse, error)
ListOrgUsers lists members of an organization (requires users.read). GET /organizations/{org_id}/users.
func (*Client) ListProviders ¶
ListProviders lists configured providers (requires org.read). GET /providers/.
func (*Client) ListRegisteredServices ¶
func (c *Client) ListRegisteredServices(ctx context.Context, callerToken string) (*RegisteredServicesResponse, error)
ListRegisteredServices lists services that have registered permissions. GET /permissions/registry/services.
func (*Client) ListRelationships ¶
func (c *Client) ListRelationships(ctx context.Context, storeID, objectType, objectID, relation, callerToken string) (*RelationshipsResponse, error)
ListRelationships lists the tuples for an object, optionally filtered by relation (pass "" for all). GET /zanzibar/stores/{store_id}/relationships/{object_type}/{object_id}.
func (*Client) ListRelationshipsPaged ¶
func (c *Client) ListRelationshipsPaged(ctx context.Context, storeID, objectType, objectID, relation, callerToken string) (*RelationshipsPage, error)
ListRelationshipsPaged lists the tuples whose object == (objectType, objectID), optionally filtered by relation (pass "" for all). GET /zanzibar/stores/{store_id}/relationships/{object_type}/{object_id}.
SERVER-GAP (pagination): the auth service OpenAPI (verified 2026-07-12) accepts ONLY a `relation` query filter on this route — it does NOT accept page_size/continuation_token and returns the FULL (unpaged) result set {object, relationships:[]RelationshipEntry} with no cursor. This method is therefore a thin wrapper over ListRelationships; RelationshipsPage's ContinuationToken is always empty.
func (*Client) ListReports ¶
func (c *Client) ListReports(ctx context.Context, callerToken string) (*LeakReportListResponse, error)
ListReports lists abuse/leak reports. GET /reports. Requires org.admin.
func (*Client) ListRevokedKeys ¶
func (c *Client) ListRevokedKeys(ctx context.Context, callerToken string) (*RevokedKeysListResponse, error)
ListRevokedKeys lists revoked signing keys. GET /admin/jwks/revoked.
func (*Client) ListSAMLSPs ¶
ListSAMLSPs lists registered service providers. GET /saml/sp/list. Requires saml.read.
func (*Client) ListSAMLSessions ¶
func (c *Client) ListSAMLSessions(ctx context.Context, token string) (*SAMLSessionListResponse, error)
ListSAMLSessions lists the caller's active SAML sessions. GET /saml/sessions.
func (*Client) ListSSODomains ¶
func (c *Client) ListSSODomains(ctx context.Context, callerToken string) (*SSODomainListResponse, error)
ListSSODomains lists configured SSO domains (requires org.admin). GET /federation/sso/domains.
func (*Client) ListSSOSessions ¶
func (c *Client) ListSSOSessions(ctx context.Context, token string) (*SSOSessionListResponse, error)
ListSSOSessions lists the caller's federated SSO sessions. GET /federation/sso/sessions.
func (*Client) ListTeamMembers ¶
func (c *Client) ListTeamMembers(ctx context.Context, teamID, callerToken string) ([]TeamMember, error)
ListTeamMembers lists a team's members (requires teams.read). GET /teams/{team_id}/members.
func (*Client) ListTeams ¶
ListTeams lists teams in an organization (requires teams.read). GET /organizations/{org_id}/teams.
func (*Client) ListTempAllowlist ¶
func (c *Client) ListTempAllowlist(ctx context.Context, callerToken string) (*TempAllowlistListResponse, error)
ListTempAllowlist lists temporary allowlist entries. GET /network-policy/temp-allowlist.
func (*Client) ListValidPermissions ¶
func (c *Client) ListValidPermissions(ctx context.Context) (*ValidPermissionsResponse, error)
ListValidPermissions returns all permission strings the registry knows about. GET /permissions/registry/valid-permissions. PUBLIC.
func (*Client) ListWebAuthnCredentials ¶
func (c *Client) ListWebAuthnCredentials(ctx context.Context, token string) (*WebAuthnCredentialListResponse, error)
ListWebAuthnCredentials lists the caller's registered credentials. GET /auth/passwordless/webauthn/credentials.
func (*Client) MagicLinkAnalytics ¶
func (c *Client) MagicLinkAnalytics(ctx context.Context, token string) (*MagicLinkAnalyticsResponse, error)
MagicLinkAnalytics returns magic-link usage analytics for the caller. GET /auth/passwordless/magic-link/analytics.
func (*Client) MagicLinkConfig ¶
func (c *Client) MagicLinkConfig(ctx context.Context) (*MagicLinkConfigResponse, error)
MagicLinkConfig returns the magic-link configuration. GET /auth/passwordless/magic-link/config.
func (*Client) Metrics ¶
Metrics fetches the service metrics payload. GET /metrics. Requires admin.metrics.read / metrics.read.
func (*Client) MigratePermissions ¶
func (c *Client) MigratePermissions(ctx context.Context, storeID, userID string, permissions []string, callerToken string) (*ZanzibarMessageResponse, error)
MigratePermissions migrates a user's legacy RBAC permissions into Zanzibar tuples (requires zanzibar.admin). The user id and permission list are passed as `user_id` and repeated `permissions` query parameters (required by the server). POST /zanzibar/stores/{store_id}/migrate/permissions.
func (*Client) MigrateSetupDefaults ¶
func (c *Client) MigrateSetupDefaults(ctx context.Context, storeID, callerToken string) (*ZanzibarMessageResponse, error)
MigrateSetupDefaults installs default namespaces/relations (requires zanzibar.admin). POST /zanzibar/stores/{store_id}/migrate/setup-defaults.
func (*Client) MyQuotaUsage ¶
MyQuotaUsage returns the caller's quota usage. GET /quotas/my-usage.
func (*Client) OAuthAuthorize ¶
func (c *Client) OAuthAuthorize(ctx context.Context, token string, params url.Values) (*AuthorizationResponse, error)
OAuthAuthorize starts the interactive OAuth2 authorization flow for the current user. GET /auth/authorize. params are appended as query parameters. (The token-validation route-gating primitive is the separate Authorize method.)
func (*Client) OAuthAuthorizeURL ¶
func (c *Client) OAuthAuthorizeURL(ctx context.Context, p OAuthAuthorizeParams) (*OAuthAuthorize, error)
OAuthAuthorizeURL starts an OAuth2/OIDC authorization flow with the given provider and returns the authorization URL the user-agent should be redirected to. GET /auth/oauth/{provider}/authorize.
func (*Client) OAuthCallback ¶
OAuthCallback completes an OAuth2/OIDC flow by exchanging the authorization code returned by the IdP for a token set. POST /auth/oauth/{provider}/callback.
func (*Client) OAuthToken ¶
OAuthToken exchanges credentials at the OAuth2 token endpoint. This is the device/CLI grant path (authorization_code, refresh_token, etc.). POST /auth/oauth/token (form-encoded).
func (*Client) OpenIDConfiguration ¶
func (c *Client) OpenIDConfiguration(ctx context.Context) (*OpenIDConfiguration, error)
OpenIDConfiguration fetches the OIDC discovery document. GET /.well-known/openid-configuration.
func (*Client) OrgAuthProviders ¶
OrgAuthProviders lists the tenant's safe provider metadata for a hosted login page. GET /organizations/{slug}/auth/providers.
func (*Client) OrgEmailHistory ¶
func (c *Client) OrgEmailHistory(ctx context.Context, orgID, callerToken string) (*EmailHistoryResponse, error)
OrgEmailHistory returns an org's sent-email history. GET /organizations/{org_id}/emails/history. Requires org.admin.
func (*Client) OrgJWKS ¶
OrgJWKS returns an organization's signing key set, cached per org. GET /organizations/{org_id}/.well-known/jwks.json.
func (*Client) OrgLogin ¶
OrgLogin authenticates a user against a specific tenant's login endpoint. POST /organizations/{slug}/auth/login.
func (*Client) OrgLogout ¶
func (c *Client) OrgLogout(ctx context.Context, slug, token string) (*HostedLoginMessageResponse, error)
OrgLogout logs out of a tenant session. POST /organizations/{slug}/auth/logout.
func (*Client) OrgRefresh ¶
OrgRefresh refreshes a token against a tenant's refresh endpoint. POST /organizations/{slug}/auth/refresh.
func (*Client) OrgRegister ¶
func (c *Client) OrgRegister(ctx context.Context, slug string, req OrgRegisterRequest) (*TokenSet, error)
OrgRegister creates a user within a specific tenant. POST /organizations/{slug}/auth/register.
func (*Client) OrgResetPassword ¶
func (c *Client) OrgResetPassword(ctx context.Context, slug string, req OrgPasswordResetRequest) (*HostedLoginMessageResponse, error)
OrgResetPassword requests a password reset within a tenant. POST /organizations/{slug}/auth/reset-password.
func (*Client) OrgSSOCallback ¶
func (c *Client) OrgSSOCallback(ctx context.Context, slug string, form url.Values) (map[string]any, error)
OrgSSOCallback completes an org-scoped SSO flow (form-encoded callback). POST /organizations/{slug}/auth/sso/callback.
func (*Client) OrgSSOInitiate ¶
func (c *Client) OrgSSOInitiate(ctx context.Context, slug string, params url.Values) (map[string]any, error)
OrgSSOInitiate begins an org-scoped SSO flow, returning the redirect target. GET /organizations/{slug}/auth/sso/initiate.
func (*Client) OrgToken ¶
func (c *Client) OrgToken(ctx context.Context, slug string, form url.Values) (*TokenResponse, error)
OrgToken exchanges credentials at a tenant's token endpoint (form-encoded). POST /organizations/{slug}/auth/token.
func (*Client) PasswordAuditEvents ¶
func (c *Client) PasswordAuditEvents(ctx context.Context, callerToken string) (*PasswordAuditEventsResponse, error)
PasswordAuditEvents returns password-related audit events. GET /admin/audit/password-events.
func (*Client) PasswordComplianceReport ¶
func (c *Client) PasswordComplianceReport(ctx context.Context, callerToken string) (*PasswordComplianceResponse, error)
PasswordComplianceReport returns password-compliance stats. GET /admin/reports/password-compliance.
func (*Client) PreviewOrgEmailTemplate ¶
func (c *Client) PreviewOrgEmailTemplate(ctx context.Context, orgID, templateType string, vars map[string]any, callerToken string) (*TemplatePreviewResponse, error)
PreviewOrgEmailTemplate renders a preview of an org's email template. POST /organizations/{org_id}/emails/templates/{template_type}/preview. Requires org.admin.
func (*Client) PropagateLogout ¶
func (c *Client) PropagateLogout(ctx context.Context, token string) (*LogoutPropagationResponse, error)
PropagateLogout propagates a logout across federated domains. POST /federation/sso/propagate-logout.
func (*Client) PropagateSSO ¶
func (c *Client) PropagateSSO(ctx context.Context, callerToken string) (*SSOPropagateResponse, error)
PropagateSSO propagates an SSO session across domains (requires sso.admin). POST /federation/sso/propagate.
func (*Client) ProviderAuthorizeInfo ¶
func (c *Client) ProviderAuthorizeInfo(ctx context.Context, provider string, params url.Values) (*OAuthProviderAuthorizeResponse, error)
ProviderAuthorizeInfo returns provider authorize metadata for a programmatic device/CLI flow. GET /auth/oauth/{provider}/authorize. Unlike OAuthAuthorizeURL this returns the typed discovery payload directly.
func (*Client) PublishMeshProvider ¶
func (c *Client) PublishMeshProvider(ctx context.Context, req MeshProviderPublishRequest, callerToken string) (*MeshProviderPublishResponse, error)
PublishMeshProvider publishes (or updates) this service's mesh directory entry. POST /mesh/providers.
Check the returned Valid and Listed fields: a nil error means the request was accepted, NOT that the provider is listed.
func (*Client) PushedAuthorizationRequest ¶
func (c *Client) PushedAuthorizationRequest(ctx context.Context, params url.Values) (*PushedAuthorizationResponse, error)
PushedAuthorizationRequest performs an RFC 9126 PAR, registering the authorization parameters and returning a request_uri. POST /auth/oauth/par.
func (*Client) QuotaTiers ¶
func (c *Client) QuotaTiers(ctx context.Context) (*QuotaTiersResponse, error)
QuotaTiers lists the available subscription tiers. GET /quotas/tiers (public).
func (*Client) ReadAuthorizationModel ¶
func (c *Client) ReadAuthorizationModel(ctx context.Context, storeID, modelID, callerToken string) (*AuthorizationModelResponse, error)
ReadAuthorizationModel fetches a single model version. Pass modelID == "" (or "latest") to read the store's latest model. GET /zanzibar/stores/{store_id}/authorization-models/{authorization_model_id}.
SERVER-GAP: this endpoint does NOT exist in the auth service OpenAPI as of 2026-07-12 (no authorization-model management). Forward-looking; will 404 until the server implements it.
func (*Client) RecentAlerts ¶
func (c *Client) RecentAlerts(ctx context.Context, callerToken string) (*RecentAlertsResponse, error)
RecentAlerts returns recent operational alerts. GET /metrics/alerts/recent. Requires admin.jwks.read / jwks.read.
func (*Client) RecoverJWKS ¶
func (c *Client) RecoverJWKS(ctx context.Context) (*JwksRecoverResponse, error)
RecoverJWKS triggers JWKS recovery. POST /health/jwks/recover (public).
func (*Client) RefreshJWKS ¶
RefreshJWKS forces a refetch of the global key set, bypassing the cache.
func (*Client) RefreshTokenForm ¶
RefreshTokenForm exchanges a refresh token via the form-encoded token endpoint. POST /token/refresh.
func (*Client) RegisterClient ¶
func (c *Client) RegisterClient(ctx context.Context, req ClientRegistration) (*ClientRegistrationResponse, error)
RegisterClient performs RFC 7591 dynamic client registration. POST /auth/oauth/register.
func (*Client) RegisterSAMLSP ¶
func (c *Client) RegisterSAMLSP(ctx context.Context, req SAMLServiceProviderConfig, callerToken string) (*SAMLSPRegistrationResponse, error)
RegisterSAMLSP registers a SAML service provider. POST /saml/sp/register. Requires saml.admin. callerToken may be a JWT or an API key.
func (*Client) RegisterServicePermissions ¶
func (c *Client) RegisterServicePermissions(ctx context.Context, req ServicePermissionRegister, callerToken string) (*ServicePermissionResponse, error)
RegisterServicePermissions registers a service's permission vocabulary. POST /permissions/registry/register. Requires permissions.register.
func (*Client) RegistryStats ¶
func (c *Client) RegistryStats(ctx context.Context) (*RegistryStatsResponse, error)
RegistryStats returns aggregate permission-registry counters. GET /permissions/registry/stats. PUBLIC.
func (*Client) RemoveOrgUser ¶
func (c *Client) RemoveOrgUser(ctx context.Context, orgID, userID, callerToken string) (*MessageResponse, error)
RemoveOrgUser removes a member from an organization (requires users.write). DELETE /organizations/{org_id}/users/{user_id}.
func (*Client) RemoveTeamMember ¶
func (c *Client) RemoveTeamMember(ctx context.Context, teamID, userID, callerToken string) (*MessageResponse, error)
RemoveTeamMember removes a member from a team (requires teams.write). DELETE /teams/{team_id}/members/{user_id}.
func (*Client) RequestPasswordReset ¶
func (c *Client) RequestPasswordReset(ctx context.Context, req PasswordReset) (*PasswordResetResponse, error)
RequestPasswordReset starts a password-reset flow (sends an email). POST /users/request-password-reset. PUBLIC.
func (*Client) RequestPasswordResetAuth ¶
func (c *Client) RequestPasswordResetAuth(ctx context.Context, req PasswordReset) (*PasswordResetResponse, error)
RequestPasswordResetAuth requests a password reset via the auth endpoint. POST /auth/password-reset.
func (*Client) ResetAllCircuitBreakers ¶
func (c *Client) ResetAllCircuitBreakers(ctx context.Context, callerToken string) (*CircuitBreakerResetAllResponse, error)
ResetAllCircuitBreakers resets all circuit breakers. POST /admin/circuit-breakers/reset-all.
func (*Client) ResetCircuitBreaker ¶
func (c *Client) ResetCircuitBreaker(ctx context.Context, name, callerToken string) (*CircuitBreakerResetResponse, error)
ResetCircuitBreaker resets one circuit breaker. POST /admin/circuit-breakers/{breaker_name}/reset.
func (*Client) ResetPassword ¶
func (c *Client) ResetPassword(ctx context.Context, req PasswordResetConfirm) (*PasswordResetConfirmResponse, error)
ResetPassword completes a password-reset flow with a token. POST /users/reset-password. PUBLIC.
func (*Client) ResolveReport ¶
func (c *Client) ResolveReport(ctx context.Context, reportID, callerToken string) (*LeakReportActionResponse, error)
ResolveReport resolves an abuse report. POST /reports/{report_id}/resolve. Requires org.admin.
func (*Client) RevocationAuditLog ¶
func (c *Client) RevocationAuditLog(ctx context.Context, callerToken string) ([]RevocationAuditEntry, error)
RevocationAuditLog lists revocation audit entries. GET /admin/audit/revocations.
func (*Client) RevokeDelegation ¶
func (c *Client) RevokeDelegation(ctx context.Context, actorID, token string) (*MessageResponse, error)
RevokeDelegation revokes an actor's delegation. DELETE /delegation/revoke/{actor_id}.
func (*Client) RevokeInvitation ¶
func (c *Client) RevokeInvitation(ctx context.Context, orgID, invitationID, callerToken string) (*MessageResponse, error)
RevokeInvitation cancels a pending invitation. DELETE /organizations/{org_id}/invitations/{invitation_id}.
func (*Client) RevokeMagicLink ¶
func (c *Client) RevokeMagicLink(ctx context.Context, callerToken, linkToken string) (*EnterpriseMessageResponse, error)
RevokeMagicLink revokes a specific magic link by token. DELETE /auth/passwordless/magic-link/{token}.
func (*Client) RevokeOrgSessions ¶
func (c *Client) RevokeOrgSessions(ctx context.Context, orgID, callerToken string) (*MessageResponse, error)
RevokeOrgSessions revokes ALL sessions in an organization (requires org.admin). DELETE /organizations/{org_id}/sessions.
func (*Client) RevokePermission ¶
func (c *Client) RevokePermission(ctx context.Context, userID, orgID, permission, callerToken string) (*MessageResponse, error)
RevokePermission revokes an explicitly-granted permission (not role-inherited). POST /permissions/revoke. Requires users.write. Like GrantPermission, the server reads user_id, org_id and permission from REQUIRED query parameters.
func (*Client) RevokeSigningKey ¶
func (c *Client) RevokeSigningKey(ctx context.Context, kid string, req KeyRevocationRequest, callerToken string) (*KeyRevocationResponse, error)
RevokeSigningKey revokes a signing key by kid. POST /admin/jwks/revoke/{kid}.
func (*Client) RevokeToken ¶
func (c *Client) RevokeToken(ctx context.Context, callerToken, tokenToRevoke, hint string) (*RevokeResult, error)
RevokeToken revokes a user-issued access or refresh token. POST /auth/revoke. The token to revoke is supplied in the body; the caller's own bearer token (callerToken) authenticates the request.
func (*Client) RevokeTokenPublic ¶
RevokeTokenPublic revokes a token via the RFC 7009 public endpoint POST /token/revoke (form-encoded, no caller auth required).
func (*Client) RevokeUserSessions ¶
func (c *Client) RevokeUserSessions(ctx context.Context, orgID, userID, callerToken string) (*SessionRevokeResponse, error)
RevokeUserSessions revokes a single user's sessions (requires org.admin). DELETE /organizations/{org_id}/users/{user_id}/sessions.
func (*Client) RotateSigningKeys ¶
func (c *Client) RotateSigningKeys(ctx context.Context, req KeyRotationRequest, callerToken string) (*KeyRotationResponse, error)
RotateSigningKeys rotates the signing key set. POST /admin/jwks/rotate.
func (*Client) SAMLAnalytics ¶
func (c *Client) SAMLAnalytics(ctx context.Context, callerToken string) (*SAMLAnalyticsResponse, error)
SAMLAnalytics returns SAML usage analytics. GET /saml/analytics. Requires saml.read / system.admin.
func (*Client) SAMLAssertionConsumer ¶
func (c *Client) SAMLAssertionConsumer(ctx context.Context, form url.Values) (*SAMLAssertionResult, error)
SAMLAssertionConsumer processes a SAML response at the ACS (form-encoded), returning the resulting assertion/token payload. POST /saml/acs.
func (*Client) SAMLMetadata ¶
SAMLMetadata fetches the IdP metadata XML. GET /saml/metadata.
func (*Client) SAMLSPMetadata ¶
SAMLSPMetadata fetches a service provider's metadata XML. GET /saml/sp/{sp_id}/metadata.
func (*Client) SAMLSSOPost ¶
SAMLSSOPost performs a POST-binding SSO submission (form-encoded). POST /saml/sso.
func (*Client) SAMLSSORedirect ¶
SAMLSSORedirect performs an IdP-initiated/redirect-binding SSO GET, returning the raw response body (typically an HTML/redirect). GET /saml/sso.
func (*Client) SAMLSingleLogout ¶
SAMLSingleLogout processes a single-logout request/response. POST /saml/slo.
func (*Client) SendMagicLink ¶
func (c *Client) SendMagicLink(ctx context.Context, form url.Values) (*MagicLinkSendResponse, error)
SendMagicLink sends a login magic link (form-encoded). POST /auth/passwordless/magic-link/send.
func (*Client) SendTestEmail ¶
func (c *Client) SendTestEmail(ctx context.Context, orgID string, req TestEmailRequest, callerToken string) (*TestEmailSentResponse, error)
SendTestEmail sends a test email using an org's configuration. POST /organizations/{org_id}/emails/test. Requires org.admin.
func (*Client) SendVerificationEmail ¶
func (c *Client) SendVerificationEmail(ctx context.Context, req VerifyEmailSendRequest) error
SendVerificationEmail triggers an email-verification message. POST /auth/verify-email/send.
func (*Client) SetPasswordPolicy ¶
func (c *Client) SetPasswordPolicy(ctx context.Context, req PasswordPolicyRequest, callerToken string) (*PasswordPolicySetResponse, error)
SetPasswordPolicy sets a password policy. POST /admin/password-policy.
func (*Client) SetupOrgHierarchy ¶
func (c *Client) SetupOrgHierarchy(ctx context.Context, storeID string, req OrgHierarchyRequest, callerToken string) (*ZanzibarMessageResponse, error)
SetupOrgHierarchy configures org hierarchy tuples (requires zanzibar.admin). POST /zanzibar/stores/{store_id}/hierarchy/setup.
func (*Client) SetupTeamMembership ¶
func (c *Client) SetupTeamMembership(ctx context.Context, storeID string, req TeamMembershipRequest, callerToken string) (*ZanzibarMessageResponse, error)
SetupTeamMembership writes a team-membership tuple (requires zanzibar.admin). POST /zanzibar/stores/{store_id}/teams/membership.
func (*Client) SigningKey ¶
SigningKey returns the cached signing key with the given kid, transparently refreshing the key set once if the kid is not found (handles key rotation).
func (*Client) Status ¶
func (c *Client) Status(ctx context.Context) (*ServiceStatusResponse, error)
Status returns service status. GET /status (public).
func (*Client) Store ¶ added in v0.3.0
func (c *Client) Store(storeID, callerToken string) *ZanzibarStore
Store binds a store id and caller token so you stop repeating them.
store := client.Store("my-store", userToken)
ok, err := store.Can(ctx, "user", "alice", "view", "doc", "123")
callerToken may be "" to use the client's configured service key.
func (*Client) SubmitReport ¶
func (c *Client) SubmitReport(ctx context.Context, req LeakReportSubmission) (*LeakReportSubmissionResponse, error)
SubmitReport submits an abuse/leak report. POST /reports (public).
func (*Client) SuperAdminActiveGrants ¶
func (c *Client) SuperAdminActiveGrants(ctx context.Context, callerToken string) (*SuperAdminActiveGrantsResponse, error)
SuperAdminActiveGrants lists active elevated grants (requires system.admin). GET /super-admin/active-grants.
func (*Client) SuperAdminApprove ¶
func (c *Client) SuperAdminApprove(ctx context.Context, req ApprovalRequestModel, callerToken string) (*MessageResponse, error)
SuperAdminApprove approves/denies a pending grant (must be a different admin than the requester). POST /super-admin/approve.
func (*Client) SuperAdminAuditLog ¶
func (c *Client) SuperAdminAuditLog(ctx context.Context, callerToken string) (*MessageResponse, error)
SuperAdminAuditLog returns the super-admin audit log (requires system.admin). GET /super-admin/audit-log.
func (*Client) SuperAdminCleanupExpired ¶
func (c *Client) SuperAdminCleanupExpired(ctx context.Context, callerToken string) (*SuperAdminCleanupResponse, error)
SuperAdminCleanupExpired purges expired grants (requires system.admin). POST /super-admin/cleanup-expired.
func (*Client) SuperAdminExtend ¶
func (c *Client) SuperAdminExtend(ctx context.Context, req SuperAdminExtendRequestModel, callerToken string) (*SuperAdminExtendResponse, error)
SuperAdminExtend extends an elevated grant's expiry (requires system.admin). POST /super-admin/extend.
func (*Client) SuperAdminGrant ¶
func (c *Client) SuperAdminGrant(ctx context.Context, req SuperAdminGrantRequestModel, callerToken string) (*SuperAdminGrantResponse, error)
SuperAdminGrant creates a time-bound elevated grant (requires system.admin). POST /super-admin/grant.
func (*Client) SuperAdminRevoke ¶
func (c *Client) SuperAdminRevoke(ctx context.Context, req SuperAdminRevokeRequestModel, callerToken string) (*SuperAdminRevokeResponse, error)
SuperAdminRevoke revokes an elevated grant (requires system.admin). POST /super-admin/revoke.
func (*Client) SupportedProviderTypes ¶
SupportedProviderTypes lists provider types the service supports. GET /providers/types/supported. PUBLIC.
func (*Client) SwitchOrganization ¶
SwitchOrganization re-issues tokens scoped to a different org/tenant. POST /auth/switch-organization. token must belong to a member of orgID.
func (*Client) TestEventSubscription ¶
func (c *Client) TestEventSubscription(ctx context.Context, subscriptionID, token string) (*EventSubscriptionTestResponse, error)
TestEventSubscription triggers a test delivery for a subscription. POST /events/subscriptions/{subscription_id}/test. Requires events.test.
func (*Client) TestProvider ¶
func (c *Client) TestProvider(ctx context.Context, req ProviderTestRequest, callerToken string) (*ProviderTestResponse, error)
TestProvider tests a provider's connectivity/config (requires org.admin). POST /providers/test.
func (*Client) ToggleEventSubscription ¶
func (c *Client) ToggleEventSubscription(ctx context.Context, subscriptionID, token string) (*EventSubscription, error)
ToggleEventSubscription enables/disables a subscription. POST /events/subscriptions/{subscription_id}/toggle. Requires events.update.
func (*Client) UpdateAPIKey ¶
func (c *Client) UpdateAPIKey(ctx context.Context, keyID string, req APIKeyUpdate, callerToken string) (*MessageResponse, error)
UpdateAPIKey updates an API key's metadata/permissions. PUT /api-keys/{key_id}.
func (*Client) UpdateClientRegistration ¶
func (c *Client) UpdateClientRegistration(ctx context.Context, clientID string, req ClientRegistration) (*ClientRegistrationResponse, error)
UpdateClientRegistration updates a dynamically-registered client. PUT /auth/oauth/register/{client_id}.
func (*Client) UpdateEventSubscription ¶
func (c *Client) UpdateEventSubscription(ctx context.Context, subscriptionID string, req EventSubscriptionUpdate, token string) (*EventSubscription, error)
UpdateEventSubscription partially updates a webhook subscription. PATCH /events/subscriptions/{subscription_id}. Requires events.update.
func (*Client) UpdateJITConfig ¶
func (c *Client) UpdateJITConfig(ctx context.Context, config map[string]any, callerToken string) (*MessageResponse, error)
UpdateJITConfig updates just-in-time provisioning config (requires org.admin). PUT /federation/jit/config.
func (*Client) UpdateLoginConfig ¶
func (c *Client) UpdateLoginConfig(ctx context.Context, orgID string, req LoginConfigUpdate, callerToken string) (*LoginConfigResponse, error)
UpdateLoginConfig updates a tenant's hosted-login configuration. PUT /organizations/{org_id}/login-config.
func (*Client) UpdateMyProfile ¶
UpdateMyProfile applies a partial update to the caller's profile. PUT /users/me.
func (*Client) UpdateNetworkPolicy ¶
func (c *Client) UpdateNetworkPolicy(ctx context.Context, policyID string, req UpdateNetworkPolicyRequest, callerToken string) (*NetworkPolicyStatusResponse, error)
UpdateNetworkPolicy updates a network policy. PUT /network-policy/{policy_id}.
func (*Client) UpdateOrgEmailConfig ¶
func (c *Client) UpdateOrgEmailConfig(ctx context.Context, orgID string, req OrgEmailConfigUpdate, callerToken string) (*OrgEmailConfigResponse, error)
UpdateOrgEmailConfig updates an org's email configuration. PUT /organizations/{org_id}/emails/config. Requires org.admin.
func (*Client) UpdateOrgEmailTemplate ¶
func (c *Client) UpdateOrgEmailTemplate(ctx context.Context, orgID, templateType string, req OrgEmailTemplateUpdate, callerToken string) (*OrgEmailTemplateResponse, error)
UpdateOrgEmailTemplate updates one of an org's email templates. PUT /organizations/{org_id}/emails/templates/{template_type}. Requires org.admin.
func (*Client) UpdateOrgUserRole ¶
func (c *Client) UpdateOrgUserRole(ctx context.Context, orgID, userID string, req OrgRoleUpdate, callerToken string) (*RoleUpdateResponse, error)
UpdateOrgUserRole changes a member's role/permissions (requires users.write). PUT /organizations/{org_id}/users/{user_id}.
func (*Client) UpdateOrganization ¶
func (c *Client) UpdateOrganization(ctx context.Context, orgID string, req OrganizationUpdate, callerToken string) (*MessageResponse, error)
UpdateOrganization updates an organization. PUT /organizations/{org_id}.
func (*Client) UpdatePasswordAge ¶
func (c *Client) UpdatePasswordAge(ctx context.Context, req PasswordAgeUpdate, callerToken string) (*PasswordAgeUpdateResponse, error)
UpdatePasswordAge sets a user's password age (test/admin helper). POST /admin/users/password-age.
func (*Client) UpdateProvider ¶
func (c *Client) UpdateProvider(ctx context.Context, providerID string, req ProviderConfigUpdate, callerToken string) (*MessageResponse, error)
UpdateProvider updates a provider config (requires org.admin). PUT /providers/{provider_id}.
func (*Client) UpdateProviderStatus ¶
func (c *Client) UpdateProviderStatus(ctx context.Context, req ProviderStatusUpdateRequest, callerToken string) (*ProviderStatusUpdateResponse, error)
UpdateProviderStatus enables/disables a provider (requires org.admin). POST /admin/providers/status.
func (*Client) UpdateSAMLAttributeMappings ¶
func (c *Client) UpdateSAMLAttributeMappings(ctx context.Context, req SAMLAttributeMappingUpdate, callerToken string) (*EnterpriseMessageResponse, error)
UpdateSAMLAttributeMappings updates the SAML attribute mappings. PUT /saml/attributes/mappings. Requires saml.admin / system.admin.
func (*Client) UpdateSAMLSP ¶
func (c *Client) UpdateSAMLSP(ctx context.Context, spID string, req SAMLServiceProviderConfig, callerToken string) (*SAMLSPUpdateResponse, error)
UpdateSAMLSP updates a service provider. PUT /saml/sp/{sp_id}. Requires saml.admin.
func (*Client) UpdateSSOConfig ¶
func (c *Client) UpdateSSOConfig(ctx context.Context, config map[string]any, callerToken string) (*SSOConfigUpdateResponse, error)
UpdateSSOConfig updates the org SSO configuration (requires org.admin). PUT /federation/sso/config.
func (*Client) UpdateSSODomain ¶
func (c *Client) UpdateSSODomain(ctx context.Context, domain string, req SSODomainConfigRequest, callerToken string) (*SSODomainConfigResponse, error)
UpdateSSODomain updates an SSO domain config (requires org.admin). PUT /federation/sso/domains/{domain}.
func (*Client) UpdateTeam ¶
func (c *Client) UpdateTeam(ctx context.Context, teamID string, req TeamUpdate, callerToken string) (*MessageResponse, error)
UpdateTeam updates a team (requires teams.write). PUT /teams/{team_id}.
func (*Client) UpdateTeamMemberRole ¶
func (c *Client) UpdateTeamMemberRole(ctx context.Context, teamID, userID string, req TeamMemberRoleUpdate, callerToken string) (*MessageResponse, error)
UpdateTeamMemberRole changes a team member's role (requires teams.write). PUT /teams/{team_id}/members/{user_id}.
func (*Client) UpdateUser ¶
func (c *Client) UpdateUser(ctx context.Context, userID string, upd UserUpdate, callerToken string) (*MessageResponse, error)
UpdateUser updates a user by id (requires users.write). PUT /users/{user_id}.
func (*Client) UpdateWebAuthnCredential ¶
func (c *Client) UpdateWebAuthnCredential(ctx context.Context, token, credentialID string, req WebAuthnCredentialUpdate) (*EnterpriseMessageResponse, error)
UpdateWebAuthnCredential renames one of the caller's credentials. PUT /auth/passwordless/webauthn/credentials/{credential_id}.
func (*Client) ValidateAPIKey ¶
func (c *Client) ValidateAPIKey(ctx context.Context, req ValidateAPIKeyRequest) (*APIKeyValidation, error)
ValidateAPIKey validates a service API key. POST /auth/validate-api-key.
func (*Client) ValidatePasswordResetToken ¶
func (c *Client) ValidatePasswordResetToken(ctx context.Context, token string) (*PasswordResetValidateResponse, error)
ValidatePasswordResetToken validates a reset token before showing the form. GET /auth/password-reset/validate.
func (*Client) ValidatePermissions ¶
func (c *Client) ValidatePermissions(ctx context.Context, perms []string) (*PermissionValidationResponse, error)
ValidatePermissions checks whether permission strings are registered/valid. POST /permissions/registry/validate. PUBLIC.
func (*Client) ValidateToken ¶
ValidateToken resolves a bearer credential to an Actor.
The credential may be a user JWT or a service/agent API key (ab0t_sk_…). The auth service resolves these at DIFFERENT endpoints — JWTs at POST /auth/validate-token, API keys at POST /auth/validate-api-key (the token endpoint does not resolve API keys). ValidateToken detects an API key by its prefix (IsAPIKey) and routes accordingly, adapting the API-key validation result into the same Actor shape, so a caller (and the resource server's Authenticate middleware) can treat both credential types uniformly.
The configured expected audience (WithExpectedAudience) is applied if set.
func (*Client) ValidateTokenWith ¶
ValidateTokenWith performs a fully-specified validation, allowing inline permission and resource assertions. POST /auth/validate-token.
func (*Client) VerifyMagicLink ¶
func (c *Client) VerifyMagicLink(ctx context.Context, form url.Values) (*PasswordlessAuthResponse, error)
VerifyMagicLink verifies a magic-link token and returns a token set (form-encoded). POST /auth/passwordless/magic-link/verify.
func (*Client) VerifyRecoveryCode ¶
func (c *Client) VerifyRecoveryCode(ctx context.Context, form url.Values) (*PasswordlessAuthResponse, error)
VerifyRecoveryCode authenticates using an MFA recovery code (form-encoded). POST /auth/passwordless/recovery-codes/verify.
func (*Client) VerifyUserEmail ¶
func (c *Client) VerifyUserEmail(ctx context.Context, userID, callerToken string) (*MessageResponse, error)
VerifyUserEmail force-marks a user's email verified (requires users.write). POST /users/{user_id}/verify-email.
func (*Client) VisualizeHierarchy ¶
func (c *Client) VisualizeHierarchy(ctx context.Context, storeID string, req VisualizationRequest, callerToken string) (*HierarchyVisualizationResponse, error)
VisualizeHierarchy renders an org/relationship hierarchy graph. POST /zanzibar/stores/{store_id}/visualize/hierarchy.
func (*Client) VisualizePermissions ¶
func (c *Client) VisualizePermissions(ctx context.Context, storeID, userID, callerToken string) (*PermissionsVisualizationResponse, error)
VisualizePermissions renders a user's permissions graph. The target user is passed as the `user_id` query parameter (required by the server). POST /zanzibar/stores/{store_id}/visualize/permissions.
func (*Client) WatchStatus ¶
func (c *Client) WatchStatus(ctx context.Context, storeID, callerToken string) (*WatchStatusResponse, error)
WatchStatus returns the change-stream/watch status for a store. GET /zanzibar/stores/{store_id}/watch/status.
func (*Client) WebAuthnAuthenticateFinish ¶
func (c *Client) WebAuthnAuthenticateFinish(ctx context.Context, assertion map[string]any) (*PasswordlessAuthResponse, error)
WebAuthnAuthenticateFinish completes a passkey authentication and returns a token set. POST /auth/passwordless/webauthn/authenticate/finish.
func (*Client) WebAuthnAuthenticateStart ¶
func (c *Client) WebAuthnAuthenticateStart(ctx context.Context, req map[string]any) (map[string]any, error)
WebAuthnAuthenticateStart begins a passkey authentication, returning the request options. POST /auth/passwordless/webauthn/authenticate/start.
func (*Client) WebAuthnConfig ¶
func (c *Client) WebAuthnConfig(ctx context.Context) (*WebAuthnConfigResponse, error)
WebAuthnConfig returns the relying-party WebAuthn configuration. GET /auth/passwordless/webauthn/config.
func (*Client) WebAuthnRegisterFinish ¶
func (c *Client) WebAuthnRegisterFinish(ctx context.Context, token string, credential map[string]any) (*WebAuthnRegistrationResult, error)
WebAuthnRegisterFinish completes a passkey registration with the authenticator's attestation. POST /auth/passwordless/webauthn/register/finish.
func (*Client) WebAuthnRegisterStart ¶
func (c *Client) WebAuthnRegisterStart(ctx context.Context, token string, req map[string]any) (map[string]any, error)
WebAuthnRegisterStart begins a passkey registration, returning the creation options the authenticator needs. POST /auth/passwordless/webauthn/register/start.
func (*Client) WriteAndDeleteRelationships ¶
func (c *Client) WriteAndDeleteRelationships(ctx context.Context, storeID string, req TransactRelationshipsRequest, token string) (*WriteOperationResponse, error)
WriteAndDeleteRelationships applies writes and deletes atomically and returns the resulting consistency token (WriteOperationResponse.ConsistencyToken) for read-after-write. Requires zanzibar.admin. POST /zanzibar/stores/{store_id}/relationships/transact.
SERVER-GAP: this endpoint does NOT exist in the auth service OpenAPI as of 2026-07-12 — the server exposes only separate POST and DELETE on /zanzibar/stores/{store_id}/relationships (no atomic combined transaction). Forward-looking; will 404 until the server implements it. Until then, use WriteRelationships + DeleteRelationships (non-atomic).
func (*Client) WriteAuthorizationModel ¶
func (c *Client) WriteAuthorizationModel(ctx context.Context, storeID string, req WriteAuthorizationModelRequest, callerToken string) (*WriteAuthorizationModelResponse, error)
WriteAuthorizationModel registers an authorization model (object types, relations, userset rewrites, wildcards) as a new immutable version and returns its id. Requires zanzibar.admin. POST /zanzibar/stores/{store_id}/authorization-models.
SERVER-GAP: this endpoint does NOT exist in the auth service OpenAPI as of 2026-07-12 — the service has no authorization-model management (it uses /zanzibar/stores/{store_id}/namespaces instead). Forward-looking; will 404 until the server implements it.
func (*Client) WriteRelationships ¶
func (c *Client) WriteRelationships(ctx context.Context, storeID string, req RelationshipRequest, token string) (*WriteOperationResponse, error)
WriteRelationships writes a single relationship tuple (requires zanzibar.admin). POST /zanzibar/stores/{store_id}/relationships.
func (*Client) ZanzibarCheck ¶
func (c *Client) ZanzibarCheck(ctx context.Context, storeID string, req CheckPermissionRequest, callerToken string) (*CheckPermissionResponse, error)
ZanzibarCheck performs a single permission check. POST /zanzibar/stores/{store_id}/check.
func (*Client) ZanzibarCheckBulk ¶
func (c *Client) ZanzibarCheckBulk(ctx context.Context, storeID string, req BulkCheckRequest, callerToken string) (BulkCheckResults, error)
ZanzibarCheckBulk performs multiple checks in one call. POST /zanzibar/stores/{store_id}/check/bulk. The results are returned IN REQUEST ORDER, one per element of req.Checks; index them with the same offset you built the request with, or use BulkCheckResults.Allowed(i).
func (*Client) ZanzibarCheckWildcard ¶
func (c *Client) ZanzibarCheckWildcard(ctx context.Context, storeID string, q url.Values, callerToken string) (*WildcardCheckResponse, error)
ZanzibarCheckWildcard evaluates a wildcard permission check. GET /zanzibar/stores/{store_id}/check/wildcard. The server reads the check parameters from the query string (e.g. user_id, permission).
func (*Client) ZanzibarExpand ¶
func (c *Client) ZanzibarExpand(ctx context.Context, storeID string, req ExpandRequest, callerToken string) (*ExpandResponse, error)
ZanzibarExpand expands a permission into its userset tree. POST /zanzibar/stores/{store_id}/expand.
func (*Client) ZanzibarGrant ¶
func (c *Client) ZanzibarGrant(ctx context.Context, storeID string, req PermissionGrantRequest, callerToken string) (*WriteOperationResponse, error)
ZanzibarGrant grants a permission via a relationship tuple (requires zanzibar.admin). POST /zanzibar/stores/{store_id}/permissions/grant.
func (*Client) ZanzibarListObjects ¶
func (c *Client) ZanzibarListObjects(ctx context.Context, storeID string, req ListObjectsRequest, callerToken string) (*ListObjectsResponse, error)
ZanzibarListObjects lists objects a subject can access via a permission. POST /zanzibar/stores/{store_id}/list-objects.
func (*Client) ZanzibarListUsers ¶
func (c *Client) ZanzibarListUsers(ctx context.Context, storeID string, req ListUsersRequest, callerToken string) (*ListUsersResponse, error)
ZanzibarListUsers lists subjects with a permission on an object. POST /zanzibar/stores/{store_id}/list-users.
func (*Client) ZanzibarRevoke ¶
func (c *Client) ZanzibarRevoke(ctx context.Context, storeID string, req PermissionGrantRequest, callerToken string) (*WriteOperationResponse, error)
ZanzibarRevoke revokes a permission relationship (requires zanzibar.admin). DELETE /zanzibar/stores/{store_id}/permissions/revoke.
type ClientRegistration ¶
type ClientRegistration struct {
RedirectURIs []string `json:"redirect_uris,omitempty"`
ClientName string `json:"client_name,omitempty"`
GrantTypes []string `json:"grant_types,omitempty"`
ResponseTypes []string `json:"response_types,omitempty"`
Scope string `json:"scope,omitempty"`
TokenEndpointAuthMethod string `json:"token_endpoint_auth_method,omitempty"`
Contacts []string `json:"contacts,omitempty"`
LogoURI string `json:"logo_uri,omitempty"`
PolicyURI string `json:"policy_uri,omitempty"`
}
ClientRegistration is the body for RFC 7591 dynamic client registration.
type ClientRegistrationResponse ¶
type ClientRegistrationResponse struct {
ClientID string `json:"client_id"`
ClientSecret string `json:"client_secret,omitempty"`
ClientIDIssuedAt int64 `json:"client_id_issued_at,omitempty"`
ClientSecretExpiresAt int64 `json:"client_secret_expires_at,omitempty"`
RegistrationAccessToken string `json:"registration_access_token,omitempty"`
RegistrationClientURI string `json:"registration_client_uri,omitempty"`
RedirectURIs []string `json:"redirect_uris,omitempty"`
ClientName string `json:"client_name,omitempty"`
GrantTypes []string `json:"grant_types,omitempty"`
Scope string `json:"scope,omitempty"`
}
ClientRegistrationResponse is the RFC 7591 registration result.
type CreateNetworkPolicyRequest ¶
type CreateNetworkPolicyRequest struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
Mode string `json:"mode,omitempty"`
CIDRs []string `json:"cidrs"`
Enabled bool `json:"enabled,omitempty"`
Priority int `json:"priority,omitempty"`
}
CreateNetworkPolicyRequest is the body for POST /network-policy/.
type DelegateTokenRequest ¶
type DelegateTokenRequest struct {
TargetUserID string `json:"target_user_id"`
Permissions []string `json:"permissions,omitempty"`
OrgID string `json:"org_id,omitempty"`
}
DelegateTokenRequest is the body for POST /auth/delegate (mint an act-as token).
type DelegationCheckResponse ¶
type DelegationCheckResponse struct {
CanDelegate bool `json:"can_delegate"`
Permissions []string `json:"permissions,omitempty"`
Reason string `json:"reason,omitempty"`
}
DelegationCheckResponse is the result of GET /delegation/check/{target_user_id}.
type DelegationEntry ¶
type DelegationEntry struct {
ID string `json:"id"`
ActorID string `json:"actor_id,omitempty"`
TargetUserID string `json:"target_user_id,omitempty"`
Permissions []string `json:"permissions,omitempty"`
ExpiresAt string `json:"expires_at,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
}
DelegationEntry is one delegation grant from GET /delegation/list/{user_id}.
type DelegationGrant ¶
type DelegationGrant struct {
ActorID string `json:"actor_id"` // who may act
TargetUserID string `json:"target_user_id"` // on whose behalf
Permissions []string `json:"permissions,omitempty"`
ExpiresAt string `json:"expires_at,omitempty"`
Reason string `json:"reason,omitempty"`
}
DelegationGrant is the body for POST /delegation/grant.
type DelegationResponse ¶
type DelegationResponse struct {
ID string `json:"id,omitempty"`
ActorID string `json:"actor_id,omitempty"`
TargetUserID string `json:"target_user_id,omitempty"`
Permissions []string `json:"permissions,omitempty"`
ExpiresAt string `json:"expires_at,omitempty"`
Message string `json:"message,omitempty"`
}
DelegationResponse is the result of POST /delegation/grant.
type Device ¶
type Device struct {
ID string `json:"id"`
Name string `json:"name,omitempty"`
Type string `json:"type,omitempty"`
LastSeenAt string `json:"last_seen_at,omitempty"`
Trusted bool `json:"trusted,omitempty"`
}
Device is one entry returned by the device listing.
type DeviceListResponse ¶
type DeviceListResponse struct {
Devices []Device `json:"devices"`
}
DeviceListResponse lists a user's known devices.
type DomainTokenResponse ¶
type DomainTokenResponse struct {
Token string `json:"token"`
Domain string `json:"domain,omitempty"`
ExpiresIn int `json:"expires_in,omitempty"`
}
DomainTokenResponse is the result of POST /federation/sso/create-token.
type ElevatePrivilegesRequest ¶
type ElevatePrivilegesRequest struct {
UserID string `json:"user_id"`
Permissions []string `json:"permissions"`
DurationSeconds int `json:"duration_seconds,omitempty"`
Reason string `json:"reason,omitempty"`
}
ElevatePrivilegesRequest is the body for POST /admin/users/elevate-privileges.
type ElevatePrivilegesResponse ¶
type ElevatePrivilegesResponse struct {
UserID string `json:"user_id,omitempty"`
Granted []string `json:"granted,omitempty"`
ExpiresAt string `json:"expires_at,omitempty"`
Message string `json:"message,omitempty"`
}
ElevatePrivilegesResponse is the result of elevating a user's privileges.
type EmailConfigDeleteResponse ¶
type EmailConfigDeleteResponse struct {
Message string `json:"message,omitempty"`
Success bool `json:"success,omitempty"`
}
EmailConfigDeleteResponse is the result of deleting an org email config.
type EmailHistoryEntry ¶
type EmailHistoryEntry struct {
ID string `json:"id,omitempty"`
To string `json:"to,omitempty"`
Template string `json:"template,omitempty"`
Status string `json:"status,omitempty"`
Subject string `json:"subject,omitempty"`
SentAt string `json:"sent_at,omitempty"`
Provider string `json:"provider,omitempty"`
Error string `json:"error,omitempty"`
}
EmailHistoryEntry is one sent-email record.
type EmailHistoryResponse ¶
type EmailHistoryResponse struct {
Emails []EmailHistoryEntry `json:"emails"`
Total int `json:"total,omitempty"`
}
EmailHistoryResponse lists sent emails.
type EmailStatsResponse ¶
type EmailStatsResponse struct {
Sent int `json:"sent,omitempty"`
Delivered int `json:"delivered,omitempty"`
Failed int `json:"failed,omitempty"`
Bounced int `json:"bounced,omitempty"`
Stats map[string]any `json:"stats,omitempty"`
}
EmailStatsResponse reports aggregate email statistics.
type EmailTemplateDeleteResponse ¶
type EmailTemplateDeleteResponse struct {
Message string `json:"message,omitempty"`
Success bool `json:"success,omitempty"`
}
EmailTemplateDeleteResponse is the result of deleting an org email template.
type EmergencyOverrideCreateResponse ¶
type EmergencyOverrideCreateResponse struct {
OverrideID string `json:"override_id"`
ExpiresAt string `json:"expires_at,omitempty"`
Message string `json:"message,omitempty"`
}
EmergencyOverrideCreateResponse is the result of creating an override.
type EmergencyOverrideRequest ¶
type EmergencyOverrideRequest struct {
IP string `json:"ip"`
Reason string `json:"reason,omitempty"`
TTLSeconds int `json:"ttl_seconds,omitempty"`
}
EmergencyOverrideRequest is the body for POST /network-policy/emergency-override.
type EmergencyRevokeRequest ¶
type EmergencyRevokeRequest struct {
KeyIDs []string `json:"key_ids,omitempty"`
OrgID string `json:"org_id,omitempty"`
AllKeys bool `json:"all_keys,omitempty"`
Reason string `json:"reason,omitempty"`
}
EmergencyRevokeRequest is the body for POST /admin/api-keys/emergency-revoke.
type EmergencyRevokeResponse ¶
type EmergencyRevokeResponse struct {
RevokedCount int `json:"revoked_count,omitempty"`
Message string `json:"message,omitempty"`
}
EmergencyRevokeResponse is the result of emergency API-key revocation.
type EnterpriseMessageResponse ¶
type EnterpriseMessageResponse struct {
Message string `json:"message,omitempty"`
Success bool `json:"success,omitempty"`
Detail string `json:"detail,omitempty"`
}
EnterpriseMessageResponse is the {message,...} envelope returned by the enterprise (passwordless/SAML/federation) endpoints.
type ErrUntypedID ¶ added in v0.2.0
type ErrUntypedID struct {
Field string // which request field ("subject", "object", …)
Value string
}
ErrUntypedID reports an id that is missing its "type:" prefix. Build ids with Object() / Subject() rather than concatenating strings.
func (*ErrUntypedID) Error ¶ added in v0.2.0
func (e *ErrUntypedID) Error() string
type EventSubscription ¶
type EventSubscription struct {
ID string `json:"id"`
URL string `json:"url,omitempty"`
EventTypes []string `json:"event_types,omitempty"`
Active bool `json:"active,omitempty"`
Headers map[string]string `json:"headers,omitempty"`
Description string `json:"description,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
UpdatedAt string `json:"updated_at,omitempty"`
}
EventSubscription is a webhook subscription.
type EventSubscriptionCreate ¶
type EventSubscriptionCreate struct {
URL string `json:"url"`
EventTypes []string `json:"event_types"`
Secret string `json:"secret,omitempty"`
Active bool `json:"active,omitempty"`
Headers map[string]string `json:"headers,omitempty"`
Description string `json:"description,omitempty"`
}
EventSubscriptionCreate is the body for POST /events/subscriptions.
type EventSubscriptionListResponse ¶
type EventSubscriptionListResponse struct {
Subscriptions []EventSubscription `json:"subscriptions"`
Total int `json:"total,omitempty"`
}
EventSubscriptionListResponse lists webhook subscriptions.
type EventSubscriptionStatsResponse ¶
type EventSubscriptionStatsResponse struct {
Delivered int `json:"delivered,omitempty"`
Failed int `json:"failed,omitempty"`
Pending int `json:"pending,omitempty"`
Stats map[string]any `json:"stats,omitempty"`
}
EventSubscriptionStatsResponse reports delivery statistics.
type EventSubscriptionTestResponse ¶
type EventSubscriptionTestResponse struct {
Success bool `json:"success,omitempty"`
StatusCode int `json:"status_code,omitempty"`
ResponseBody string `json:"response_body,omitempty"`
Message string `json:"message,omitempty"`
}
EventSubscriptionTestResponse is the result of a test delivery.
type EventSubscriptionUpdate ¶
type EventSubscriptionUpdate struct {
URL *string `json:"url,omitempty"`
EventTypes *[]string `json:"event_types,omitempty"`
Secret *string `json:"secret,omitempty"`
Active *bool `json:"active,omitempty"`
Headers *map[string]string `json:"headers,omitempty"`
Description *string `json:"description,omitempty"`
}
EventSubscriptionUpdate is the body for PATCH /events/subscriptions/{id}.
type EventTypeInfo ¶
type EventTypeInfo struct {
Type string `json:"type"`
Description string `json:"description,omitempty"`
Category string `json:"category,omitempty"`
}
EventTypeInfo describes one emittable event type.
type EventTypesResponse ¶
type EventTypesResponse struct {
EventTypes []EventTypeInfo `json:"event_types"`
}
EventTypesResponse lists available event types.
type ExpandRequest ¶
type ExpandRequest struct {
Permission string `json:"permission"`
Object string `json:"object"`
OrgID string `json:"org_id,omitempty"`
MaxDepth int `json:"max_depth,omitempty"`
}
ExpandRequest is the body for POST /zanzibar/stores/{store_id}/expand. Matches OpenAPI schema ExpandRequest (required: permission, object).
type ExpandResponse ¶
type ExpandResponse struct {
Object string `json:"object"`
Permission string `json:"permission"`
Subjects []string `json:"subjects,omitempty"`
UsersetTree map[string]any `json:"userset_tree,omitempty"`
}
ExpandResponse is the result of expanding a permission into its userset tree. Matches OpenAPI schema ExpandResponse (required: object, permission).
type FederationStatsResponse ¶
type FederationStatsResponse struct {
ActiveSessions int `json:"active_sessions,omitempty"`
Domains int `json:"domains,omitempty"`
Providers int `json:"providers,omitempty"`
Stats map[string]any `json:"stats,omitempty"`
}
FederationStatsResponse is the result of GET /federation/stats.
type ForcePasswordResetRequest ¶
type ForcePasswordResetRequest struct {
OrgID string `json:"org_id,omitempty"`
UserIDs []string `json:"user_ids,omitempty"`
AllUsers bool `json:"all_users,omitempty"`
}
ForcePasswordResetRequest is the body for POST /admin/password-policy/force-reset.
type ForcePasswordResetResponse ¶
type ForcePasswordResetResponse struct {
Message string `json:"message,omitempty"`
AffectedCount int `json:"affected_count,omitempty"`
}
ForcePasswordResetResponse is the result of forcing password resets.
type ForwardAuthDecision ¶
type ForwardAuthDecision struct {
// Allowed is true when the forward-auth endpoint returned a 2xx.
Allowed bool
// StatusCode is the HTTP status the auth service returned.
StatusCode int
// Body is the raw response body (may carry identity headers/JSON).
Body string
}
ForwardAuthDecision reports a proxy auth decision plus echoed headers.
type GlobalEmailConfigResponse ¶
type GlobalEmailConfigResponse struct {
Provider string `json:"provider,omitempty"`
FromAddress string `json:"from_address,omitempty"`
FromName string `json:"from_name,omitempty"`
Configured bool `json:"configured,omitempty"`
Settings map[string]any `json:"settings,omitempty"`
}
GlobalEmailConfigResponse is the system-wide email configuration.
type HealthCheckResponse ¶
type HealthCheckResponse struct {
Status string `json:"status"`
Version string `json:"version,omitempty"`
Components map[string]string `json:"components,omitempty"`
}
HealthCheckResponse is the result of GET /health.
type HierarchyTeam ¶ added in v0.9.0
type HierarchyTeam struct {
ID string `json:"id,omitempty"`
Type string `json:"type,omitempty"`
Members []HierarchyUser `json:"members,omitempty"`
}
HierarchyTeam is one team inside an organization in a hierarchy response.
type HierarchyUser ¶ added in v0.9.0
type HierarchyUser struct {
ID string `json:"id,omitempty"`
Type string `json:"type,omitempty"`
Role string `json:"role,omitempty"`
}
HierarchyUser is one user inside a team in a hierarchy response.
type HierarchyVisualizationResponse ¶
type HierarchyVisualizationResponse struct {
ID string `json:"id"`
Type string `json:"type,omitempty"`
Children []any `json:"children,omitempty"`
Users []map[string]any `json:"users,omitempty"`
Teams []map[string]any `json:"teams,omitempty"`
Permissions []any `json:"permissions,omitempty"`
}
HierarchyVisualizationResponse is a hierarchy tree node. Matches OpenAPI schema HierarchyVisualizationResponse (required: id). Children and Permissions are left generic because the OpenAPI leaves their item schema untyped; Users/Teams are objects.
type HostedLoginMessageResponse ¶
type HostedLoginMessageResponse struct {
Message string `json:"message,omitempty"`
Success bool `json:"success,omitempty"`
}
HostedLoginMessageResponse is the message envelope returned by hosted-login auth endpoints (org-scoped logout / reset-password).
type Introspection ¶
type Introspection struct {
Active bool `json:"active"`
Scope string `json:"scope,omitempty"`
ClientID string `json:"client_id,omitempty"`
Username string `json:"username,omitempty"`
TokenType string `json:"token_type,omitempty"`
Subject string `json:"sub,omitempty"`
OrgID string `json:"org_id,omitempty"`
Issuer string `json:"iss,omitempty"`
JTI string `json:"jti,omitempty"`
Audience any `json:"aud,omitempty"` // string or []string per RFC 7662
Exp int64 `json:"exp,omitempty"`
Iat int64 `json:"iat,omitempty"`
}
Introspection is the RFC 7662 response from POST /token/introspect.
type InvitationListItem ¶
type InvitationListItem struct {
ID string `json:"id"`
Email string `json:"email"`
Role string `json:"role,omitempty"`
Status string `json:"status,omitempty"`
InvitedBy string `json:"invited_by,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
ExpiresAt string `json:"expires_at,omitempty"`
}
InvitationListItem is one entry from GET /organizations/{org_id}/invitations.
type JITConfigResponse ¶
type JITConfigResponse struct {
Enabled bool `json:"enabled,omitempty"`
DefaultRole string `json:"default_role,omitempty"`
AllowedDomains []string `json:"allowed_domains,omitempty"`
Config map[string]any `json:"config,omitempty"`
}
JITConfigResponse is the result of GET /federation/jit/config (just-in-time provisioning).
type JWK ¶
type JWK struct {
Kty string `json:"kty"` // key type: "RSA", "EC", "oct"
Use string `json:"use,omitempty"` // "sig" or "enc"
Kid string `json:"kid,omitempty"` // key id
Alg string `json:"alg,omitempty"` // e.g. "RS256", "ES256"
// RSA.
N string `json:"n,omitempty"`
E string `json:"e,omitempty"`
// EC.
Crv string `json:"crv,omitempty"`
X string `json:"x,omitempty"`
Y string `json:"y,omitempty"`
// X.509 chain (optional).
X5c []string `json:"x5c,omitempty"`
X5t string `json:"x5t,omitempty"`
}
JWK is a single JSON Web Key (RFC 7517). Only the commonly-needed fields are modeled; unknown fields are ignored. For RSA keys N and E are base64url; for EC keys Crv, X, and Y are populated.
type JWKS ¶
type JWKS struct {
Keys []JWK `json:"keys"`
}
JWKS is a JSON Web Key Set (GET /.well-known/jwks.json).
type JwksHealthResponse ¶
type JwksHealthResponse struct {
Healthy bool `json:"healthy"`
ActiveKeys int `json:"active_keys,omitempty"`
Message string `json:"message,omitempty"`
}
JwksHealthResponse is the result of GET /health/jwks.
type JwksMetricsResponse ¶
type JwksMetricsResponse struct {
ActiveKeys int `json:"active_keys,omitempty"`
RevokedKeys int `json:"revoked_keys,omitempty"`
LastRotation string `json:"last_rotation,omitempty"`
NextRotation string `json:"next_rotation,omitempty"`
Metrics map[string]any `json:"metrics,omitempty"`
}
JwksMetricsResponse reports JWKS operational metrics.
type JwksRecoverResponse ¶
type JwksRecoverResponse struct {
Recovered bool `json:"recovered,omitempty"`
Message string `json:"message,omitempty"`
}
JwksRecoverResponse is the result of POST /health/jwks/recover.
type KeyActivateResponse ¶
type KeyActivateResponse struct {
Kid string `json:"kid,omitempty"`
Active bool `json:"active,omitempty"`
Message string `json:"message,omitempty"`
}
KeyActivateResponse is the result of POST /admin/jwks/activate/{kid}.
type KeyCleanupRequest ¶
type KeyCleanupRequest struct {
OlderThanDays int `json:"older_than_days,omitempty"`
DryRun bool `json:"dry_run,omitempty"`
}
KeyCleanupRequest is the body for POST /admin/jwks/cleanup.
type KeyCleanupResponse ¶
type KeyCleanupResponse struct {
RemovedCount int `json:"removed_count,omitempty"`
RemovedKids []string `json:"removed_kids,omitempty"`
Message string `json:"message,omitempty"`
}
KeyCleanupResponse is the result of cleaning up old keys.
type KeyGenerateResponse ¶
type KeyGenerateResponse struct {
Kid string `json:"kid,omitempty"`
Message string `json:"message,omitempty"`
}
KeyGenerateResponse is the result of generating a key.
type KeyGenerationRequest ¶
type KeyGenerationRequest struct {
Algorithm string `json:"algorithm,omitempty"`
Activate bool `json:"activate,omitempty"`
}
KeyGenerationRequest is the body for POST /admin/jwks/generate.
type KeyRevocationRequest ¶
type KeyRevocationRequest struct {
Reason string `json:"reason,omitempty"`
}
KeyRevocationRequest is the body for POST /admin/jwks/revoke/{kid}.
type KeyRevocationResponse ¶
type KeyRevocationResponse struct {
Kid string `json:"kid,omitempty"`
Revoked bool `json:"revoked,omitempty"`
Message string `json:"message,omitempty"`
}
KeyRevocationResponse is the result of revoking a signing key.
type KeyRotationRequest ¶
type KeyRotationRequest struct {
Algorithm string `json:"algorithm,omitempty"`
Force bool `json:"force,omitempty"`
}
KeyRotationRequest is the body for POST /admin/jwks/rotate.
type KeyRotationResponse ¶
type KeyRotationResponse struct {
NewKid string `json:"new_kid,omitempty"`
Message string `json:"message,omitempty"`
}
KeyRotationResponse is the result of rotating signing keys.
type LeakReport ¶
type LeakReport struct {
ID string `json:"id"`
Type string `json:"type,omitempty"`
Description string `json:"description,omitempty"`
Status string `json:"status,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
}
LeakReport is one abuse report entry.
type LeakReportActionResponse ¶
type LeakReportActionResponse struct {
ReportID string `json:"report_id,omitempty"`
Status string `json:"status,omitempty"`
Message string `json:"message,omitempty"`
}
LeakReportActionResponse is the result of dismiss/resolve.
type LeakReportListResponse ¶
type LeakReportListResponse struct {
Reports []LeakReport `json:"reports"`
Total int `json:"total,omitempty"`
}
LeakReportListResponse lists abuse reports.
type LeakReportSubmission ¶
type LeakReportSubmission struct {
Type string `json:"type,omitempty"`
Description string `json:"description,omitempty"`
URL string `json:"url,omitempty"`
Evidence string `json:"evidence,omitempty"`
ReporterEmail string `json:"reporter_email,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
}
LeakReportSubmission is the body for POST /reports.
type LeakReportSubmissionResponse ¶
type LeakReportSubmissionResponse struct {
ReportID string `json:"report_id"`
Message string `json:"message,omitempty"`
Status string `json:"status,omitempty"`
}
LeakReportSubmissionResponse is the result of submitting an abuse report.
type ListAuthorizationModelsResponse ¶
type ListAuthorizationModelsResponse struct {
Models []AuthorizationModelResponse `json:"models"`
ContinuationToken string `json:"continuation_token,omitempty"`
}
ListAuthorizationModelsResponse lists model versions, newest first.
type ListObjectsRequest ¶
type ListObjectsRequest struct {
Subject string `json:"subject"`
Permission string `json:"permission"`
ObjectType string `json:"object_type"`
OrgID string `json:"org_id,omitempty"`
MaxResults int `json:"max_results,omitempty"`
ConsistencyToken string `json:"consistency_token,omitempty"`
}
ListObjectsRequest is the body for POST /zanzibar/stores/{store_id}/list-objects. Matches OpenAPI schema ListObjectsRequest (required: subject, permission, object_type). MaxResults caps the result set (1..1000, server default 1000).
type ListObjectsResponse ¶
type ListObjectsResponse struct {
Objects []string `json:"objects,omitempty"`
Subject string `json:"subject"`
Permission string `json:"permission"`
ObjectType string `json:"object_type"`
ResultCount int `json:"result_count,omitempty"`
// ContinuationToken is reserved for future use by the server (currently always
// empty); it is NOT accepted on the request side.
ContinuationToken string `json:"continuation_token,omitempty"`
}
ListObjectsResponse lists the object ids a subject can access. Matches OpenAPI schema ListObjectsResponse (required: subject, permission, object_type).
type ListUsersRequest ¶
type ListUsersRequest struct {
Object string `json:"object"`
Permission string `json:"permission"`
OrgID string `json:"org_id,omitempty"`
MaxResults int `json:"max_results,omitempty"`
ExpandGroups *bool `json:"expand_groups,omitempty"`
ConsistencyToken string `json:"consistency_token,omitempty"`
}
ListUsersRequest is the body for POST /zanzibar/stores/{store_id}/list-users. Matches OpenAPI schema ListUsersRequest (required: object, permission). ExpandGroups defaults to true server-side; leave nil to accept that default.
type ListUsersResponse ¶
type ListUsersResponse struct {
Users []string `json:"users,omitempty"`
Object string `json:"object"`
Permission string `json:"permission"`
ResultCount int `json:"result_count,omitempty"`
// ContinuationToken is reserved for future use (currently always empty).
ContinuationToken string `json:"continuation_token,omitempty"`
}
ListUsersResponse lists the subject ids that can access an object. Matches OpenAPI schema ListUsersResponse (required: object, permission).
type LoginConfig ¶
type LoginConfig struct {
OrgID string `json:"org_id,omitempty"`
LogoURL string `json:"logo_url,omitempty"`
PrimaryColor string `json:"primary_color,omitempty"`
BackgroundColor string `json:"background_color,omitempty"`
AllowPassword bool `json:"allow_password,omitempty"`
AllowSignup bool `json:"allow_signup,omitempty"`
AllowPasswordless bool `json:"allow_passwordless,omitempty"`
TermsURL string `json:"terms_url,omitempty"`
PrivacyURL string `json:"privacy_url,omitempty"`
CustomCSS string `json:"custom_css,omitempty"`
Settings map[string]any `json:"settings,omitempty"`
}
LoginConfig describes a tenant's hosted-login branding and behaviour.
type LoginConfigResponse ¶
type LoginConfigResponse struct {
Config LoginConfig `json:"config"`
}
LoginConfigResponse wraps the tenant login configuration.
type LoginConfigUpdate ¶
type LoginConfigUpdate struct {
LogoURL *string `json:"logo_url,omitempty"`
PrimaryColor *string `json:"primary_color,omitempty"`
BackgroundColor *string `json:"background_color,omitempty"`
AllowPassword *bool `json:"allow_password,omitempty"`
AllowSignup *bool `json:"allow_signup,omitempty"`
AllowPasswordless *bool `json:"allow_passwordless,omitempty"`
TermsURL *string `json:"terms_url,omitempty"`
PrivacyURL *string `json:"privacy_url,omitempty"`
CustomCSS *string `json:"custom_css,omitempty"`
Settings *map[string]any `json:"settings,omitempty"`
}
LoginConfigUpdate is the body for PUT /organizations/{org_id}/login-config.
type LoginRequest ¶
type LoginRequest struct {
Email string `json:"email"`
Password string `json:"password"`
// OrgID selects a specific organization for a multi-org user. Optional.
OrgID string `json:"org_id,omitempty"`
// ProviderType selects an auth provider (e.g. "internal", "google").
// Defaults server-side to "internal".
ProviderType string `json:"provider_type,omitempty"`
}
LoginRequest is the body for POST /auth/login.
type LogoutPropagationResponse ¶
type LogoutPropagationResponse struct {
Success bool `json:"success,omitempty"`
LoggedOutOf []string `json:"logged_out_of,omitempty"`
Message string `json:"message,omitempty"`
}
LogoutPropagationResponse is the result of POST /federation/sso/propagate-logout.
type LogoutResult ¶
type LogoutResult struct {
Success bool `json:"success,omitempty"`
Message string `json:"message,omitempty"`
}
LogoutResult is the response from POST /auth/logout.
type MagicLinkAnalyticsResponse ¶
type MagicLinkAnalyticsResponse struct {
Sent int `json:"sent,omitempty"`
Verified int `json:"verified,omitempty"`
Expired int `json:"expired,omitempty"`
Stats map[string]any `json:"stats,omitempty"`
}
MagicLinkAnalyticsResponse is the result of GET .../magic-link/analytics.
type MagicLinkConfigResponse ¶
type MagicLinkConfigResponse struct {
Enabled bool `json:"enabled,omitempty"`
TTLSeconds int `json:"ttl_seconds,omitempty"`
MaxActive int `json:"max_active,omitempty"`
}
MagicLinkConfigResponse is the result of GET .../magic-link/config.
type MagicLinkSendResponse ¶
type MagicLinkSendResponse struct {
Message string `json:"message,omitempty"`
Success bool `json:"success,omitempty"`
ExpiresIn int `json:"expires_in,omitempty"`
}
MagicLinkSendResponse is the result of sending a magic link.
type MeshConsumerRegistration ¶
type MeshConsumerRegistration struct {
Enabled bool `json:"enabled,omitempty"`
OrgSlug string `json:"org_slug,omitempty"`
RegisterURL string `json:"register_url,omitempty"`
Tiers []MeshProviderTier `json:"tiers,omitempty"`
}
MeshConsumerRegistration describes how a consumer signs up to a provider.
type MeshProvider ¶
type MeshProvider struct {
ServiceID string `json:"service_id,omitempty"`
DisplayName string `json:"display_name,omitempty"`
ConsumerRegistration *MeshConsumerRegistration `json:"consumer_registration,omitempty"`
DocsURL string `json:"docs_url,omitempty"`
// ConnectPrompt is the natural-language instruction an agent can follow to
// connect to this provider.
ConnectPrompt string `json:"connect_prompt,omitempty"`
SchemaURL string `json:"schema_url,omitempty"`
// LLMsTxtURL points at the provider's llms.txt (agent-facing description).
LLMsTxtURL string `json:"llms_txt_url,omitempty"`
SupportURL string `json:"support_url,omitempty"`
QuickstartURL string `json:"quickstart_url,omitempty"`
UpdatedAt string `json:"updated_at,omitempty"`
}
MeshProvider is a published provider entry in the mesh directory. Matches OpenAPI schema MeshProvider (no required fields — the server may return a sparse entry, so treat every field as optional).
type MeshProviderPublishRequest ¶
type MeshProviderPublishRequest struct {
ServiceID string `json:"service_id"`
DisplayName string `json:"display_name"`
// RegisterURL is where a consumer goes to sign up.
RegisterURL string `json:"register_url"`
OrgSlug string `json:"org_slug"`
Tiers []MeshProviderTierInput `json:"tiers,omitempty"`
SignupEnabled bool `json:"signup_enabled,omitempty"`
DocsURL string `json:"docs_url,omitempty"`
ConnectPrompt string `json:"connect_prompt,omitempty"`
SchemaURL string `json:"schema_url,omitempty"`
LLMsTxtURL string `json:"llms_txt_url,omitempty"`
SupportURL string `json:"support_url,omitempty"`
QuickstartURL string `json:"quickstart_url,omitempty"`
// PublicMesh lists the provider in the PUBLIC directory. Leaving it false
// publishes privately.
PublicMesh bool `json:"public_mesh,omitempty"`
// PrivilegedPerms declares permissions the publisher knows are privileged.
PrivilegedPerms []string `json:"privileged_perms,omitempty"`
}
MeshProviderPublishRequest is the body for POST /mesh/providers. Matches OpenAPI schema MeshProviderPublishRequest (required: service_id, display_name, register_url, org_slug).
type MeshProviderPublishResponse ¶
type MeshProviderPublishResponse struct {
Valid bool `json:"valid"`
ServiceID string `json:"service_id,omitempty"`
Listed bool `json:"listed,omitempty"`
Reason string `json:"reason,omitempty"`
// DocsURLWarning reports that the docs URL looked unreachable or malformed.
DocsURLWarning bool `json:"docs_url_warning,omitempty"`
// PrivilegeWarning reports that a declared tier grants privileged
// permissions; PrivilegeViolations names them.
PrivilegeWarning bool `json:"privilege_warning,omitempty"`
PrivilegeViolations []string `json:"privilege_violations,omitempty"`
}
MeshProviderPublishResponse is the result of POST /mesh/providers. Matches OpenAPI schema MeshProviderPublishResponse (required: valid).
NOTE the shape of the contract: a 200 does NOT mean "published". Valid reports whether the submission was accepted and Listed whether it actually appears in the directory; Reason carries the explanation when it does not. Always check Valid and Listed rather than relying on the absence of an error.
type MeshProviderTier ¶
type MeshProviderTier struct {
Name string `json:"name"`
// Default marks the tier a consumer gets if it does not choose one.
Default bool `json:"default,omitempty"`
// PermissionCount is server-computed; it is not settable on publish.
PermissionCount int `json:"permission_count,omitempty"`
Permissions []string `json:"permissions,omitempty"`
// PrivilegedAck records that the publisher explicitly acknowledged that this
// tier grants privileged permissions.
PrivilegedAck bool `json:"privileged_ack,omitempty"`
}
MeshProviderTier is one named permission tier a provider offers, as returned by a read. Matches OpenAPI schema MeshProviderTier (required: name).
type MeshProviderTierInput ¶
type MeshProviderTierInput struct {
Name string `json:"name"`
Default bool `json:"default,omitempty"`
Permissions []string `json:"permissions,omitempty"`
PrivilegedAck bool `json:"privileged_ack,omitempty"`
}
MeshProviderTierInput is a tier as supplied on publish. It is deliberately a separate type from MeshProviderTier: PermissionCount is server-computed and sending it is meaningless.
type MeshProvidersListResponse ¶
type MeshProvidersListResponse struct {
Providers []MeshProvider `json:"providers,omitempty"`
}
MeshProvidersListResponse is the result of GET /mesh/providers.
type MessageDetailResponse ¶
type MessageDetailResponse struct {
Message string `json:"message,omitempty"`
Success bool `json:"success,omitempty"`
Status string `json:"status,omitempty"`
UserID string `json:"user_id,omitempty"`
}
MessageDetailResponse adds a structured detail/status to a message (used by user activate/deactivate).
type MessageResponse ¶
type MessageResponse struct {
Message string `json:"message,omitempty"`
Success bool `json:"success,omitempty"`
}
MessageResponse is the generic {"message": ...} envelope returned by many mutating endpoints across the auth service.
type NamespaceDetailResponse ¶
type NamespaceDetailResponse struct {
Name string `json:"name"`
Relations map[string]any `json:"relations,omitempty"`
Permissions map[string]any `json:"permissions,omitempty"`
ParentNamespace string `json:"parent_namespace,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
Version *int `json:"version,omitempty"`
}
NamespaceDetailResponse is one namespace's full definition. Matches OpenAPI schema NamespaceDetailResponse (required: name).
type NamespaceListResponse ¶
type NamespaceListResponse struct {
Namespaces []NamespaceSummary `json:"namespaces,omitempty"`
}
NamespaceListResponse lists the namespaces in a store. Matches OpenAPI schema NamespaceListResponse.
type NamespaceRequest ¶
type NamespaceRequest struct {
Name string `json:"name"`
Relations map[string]any `json:"relations"`
Permissions map[string]any `json:"permissions"`
ParentNamespace string `json:"parent_namespace,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
}
NamespaceRequest is the body for POST /zanzibar/stores/{store_id}/namespaces. Matches OpenAPI schema NamespaceRequest (required: name, relations, permissions). Relations and Permissions are the namespace's relation and permission (userset-rewrite) definitions.
type NamespaceSummary ¶
type NamespaceSummary struct {
Name string `json:"name"`
Relations []string `json:"relations,omitempty"`
Permissions []string `json:"permissions,omitempty"`
ParentNamespace string `json:"parent_namespace,omitempty"`
Version *int `json:"version,omitempty"`
}
NamespaceSummary is one entry of a namespace listing. Matches OpenAPI schema NamespaceSummary (required: name).
type NetworkOverride ¶
type NetworkOverride struct {
ID string `json:"id"`
IP string `json:"ip,omitempty"`
Reason string `json:"reason,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
ExpiresAt string `json:"expires_at,omitempty"`
}
NetworkOverride is one emergency override entry.
type NetworkPolicy ¶
type NetworkPolicy struct {
ID string `json:"id"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Mode string `json:"mode,omitempty"` // allowlist | blocklist
CIDRs []string `json:"cidrs,omitempty"`
Enabled bool `json:"enabled,omitempty"`
Priority int `json:"priority,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
}
NetworkPolicy is an IP/network access policy.
type NetworkPolicyCreateResponse ¶
type NetworkPolicyCreateResponse struct {
PolicyID string `json:"policy_id"`
Message string `json:"message,omitempty"`
}
NetworkPolicyCreateResponse is the result of creating a network policy.
type NetworkPolicyListResponse ¶
type NetworkPolicyListResponse struct {
Policies []NetworkPolicy `json:"policies"`
Total int `json:"total,omitempty"`
}
NetworkPolicyListResponse lists network policies.
type NetworkPolicyStatusResponse ¶
type NetworkPolicyStatusResponse struct {
Success bool `json:"success,omitempty"`
Message string `json:"message,omitempty"`
Status string `json:"status,omitempty"`
}
NetworkPolicyStatusResponse is the generic status envelope for update/delete/override/allowlist mutations.
type NetworkViolation ¶
type NetworkViolation struct {
IP string `json:"ip,omitempty"`
PolicyID string `json:"policy_id,omitempty"`
Path string `json:"path,omitempty"`
Timestamp string `json:"timestamp,omitempty"`
Reason string `json:"reason,omitempty"`
}
NetworkViolation is one recorded access violation.
type NextRotationResponse ¶
type NextRotationResponse struct {
NextRotation string `json:"next_rotation,omitempty"`
}
NextRotationResponse is the result of GET /admin/jwks/next-rotation.
type OAuthAuthorize ¶
type OAuthAuthorize struct {
AuthorizationURL string `json:"authorization_url"`
State string `json:"state,omitempty"`
Provider string `json:"provider,omitempty"`
// CodeVerifier is returned only when the server generated PKCE on the
// caller's behalf; otherwise empty.
CodeVerifier string `json:"code_verifier,omitempty"`
}
OAuthAuthorize is the result of starting an OAuth/OIDC flow (OAuthProviderAuthorizeResponse). AuthorizationURL is where the caller should redirect the user-agent.
type OAuthAuthorizeParams ¶
type OAuthAuthorizeParams struct {
// Provider is the upstream IdP identifier (e.g. "google", "okta").
Provider string `json:"-"`
// RedirectURI is where the IdP returns the user after consent.
RedirectURI string `json:"redirect_uri,omitempty"`
// State is an opaque CSRF token echoed back to the callback.
State string `json:"state,omitempty"`
// Scope is a space-delimited list of requested scopes.
Scope string `json:"scope,omitempty"`
// OrgID scopes the flow to a specific organization/tenant.
OrgID string `json:"org_id,omitempty"`
// CodeChallenge / CodeChallengeMethod enable PKCE.
CodeChallenge string `json:"code_challenge,omitempty"`
CodeChallengeMethod string `json:"code_challenge_method,omitempty"`
// LoginHint pre-fills the IdP login (e.g. an email).
LoginHint string `json:"login_hint,omitempty"`
}
OAuthAuthorizeParams configures the start of an OAuth2/OIDC authorization (GET /auth/oauth/{provider}/authorize). Fields map to standard OAuth2 query parameters; zero-valued fields are omitted.
type OAuthCallbackParams ¶
type OAuthCallbackParams struct {
Provider string `json:"-"`
Code string `json:"code,omitempty"`
State string `json:"state,omitempty"`
RedirectURI string `json:"redirect_uri,omitempty"`
CodeVerifier string `json:"code_verifier,omitempty"`
// Error / ErrorDescription are populated when the IdP denied the request.
Error string `json:"error,omitempty"`
ErrorDescription string `json:"error_description,omitempty"`
}
OAuthCallbackParams carries the values returned by the IdP to the callback endpoint (POST /auth/oauth/{provider}/callback). They are sent as form values.
type OAuthProviderAuthorizeResponse ¶
type OAuthProviderAuthorizeResponse struct {
AuthorizationURL string `json:"authorization_url,omitempty"`
Provider string `json:"provider,omitempty"`
State string `json:"state,omitempty"`
}
OAuthProviderAuthorizeResponse is returned by GET /auth/oauth/{provider}/authorize.
type Observer ¶ added in v0.5.0
type Observer func(RequestInfo)
Observer is called once per completed HTTP attempt.
It runs on the calling goroutine, inside the request path, so it must be fast and must not block — a slow observer slows every request. It must also be safe for concurrent use if the client is shared, which it is designed to be.
A panic in an Observer is NOT recovered. That is deliberate: swallowing it would hide a bug in consumer code at the exact place a consumer is least likely to look, and a panic in an observability hook should be as loud as any other.
type OpenIDConfiguration ¶
type OpenIDConfiguration struct {
Issuer string `json:"issuer"`
AuthorizationEndpoint string `json:"authorization_endpoint,omitempty"`
TokenEndpoint string `json:"token_endpoint,omitempty"`
UserinfoEndpoint string `json:"userinfo_endpoint,omitempty"`
JWKSURI string `json:"jwks_uri,omitempty"`
RegistrationEndpoint string `json:"registration_endpoint,omitempty"`
ScopesSupported []string `json:"scopes_supported,omitempty"`
ResponseTypesSupported []string `json:"response_types_supported,omitempty"`
GrantTypesSupported []string `json:"grant_types_supported,omitempty"`
SubjectTypesSupported []string `json:"subject_types_supported,omitempty"`
IDTokenSigningAlgValuesSupported []string `json:"id_token_signing_alg_values_supported,omitempty"`
TokenEndpointAuthMethodsSupported []string `json:"token_endpoint_auth_methods_supported,omitempty"`
CodeChallengeMethodsSupported []string `json:"code_challenge_methods_supported,omitempty"`
}
OpenIDConfiguration is the OIDC discovery document.
type Option ¶
type Option func(*Client)
Option configures a Client.
func WithAPIKey ¶
WithAPIKey sets the service API key (prefix "ab0t_sk_") sent as a bearer token on calls that require service-to-service auth (e.g. CheckPermission). Per-call user tokens always override this default.
func WithBackoff ¶
WithBackoff configures the exponential backoff used between retries. base is the initial delay; max caps the per-attempt delay. The transport honors a Retry-After header on 429/503 responses when present.
func WithBaseURL ¶
WithBaseURL overrides the auth service base URL.
func WithExpectedAudience ¶
WithExpectedAudience sets a default `aud` assertion applied to token/api-key validation, ensuring tokens were minted for this service.
func WithHTTPClient ¶
WithHTTPClient supplies a custom *http.Client (transport, proxy, etc.). If the supplied client has a zero Timeout, the default timeout is applied.
func WithMaxRetries ¶
WithMaxRetries sets how many times a retryable request (idempotent GET, or any request returning 429/5xx) is retried with exponential backoff. 0 disables retries.
func WithObserver ¶ added in v0.5.0
WithObserver installs a callback invoked once per completed HTTP attempt.
client := authclient.New("", authclient.WithObserver(func(i authclient.RequestInfo) {
slog.Info("auth call",
"method", i.Method, "endpoint", i.Endpoint, "status", i.Status,
"ms", i.Duration.Milliseconds(), "attempt", i.Attempt, "err", i.Err)
}))
Passing nil clears any previously set observer. With none set the client behaves exactly as before — the hook is not consulted at all.
func WithTimeout ¶
WithTimeout sets the per-request timeout enforced via the http.Client. A non-positive value disables the client-level timeout (callers should then rely on context deadlines).
type OrgClientSafe ¶
type OrgClientSafe struct {
ClientID string `json:"client_id"`
ClientName string `json:"client_name,omitempty"`
RedirectURIs []string `json:"redirect_uris,omitempty"`
GrantTypes []string `json:"grant_types,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
}
OrgClientSafe is the safe (non-secret) view of an OAuth client in an org.
type OrgClientSafeResponse ¶
type OrgClientSafeResponse struct {
Clients []OrgClientSafe `json:"clients"`
Total int `json:"total,omitempty"`
}
OrgClientSafeResponse is the result of GET /organizations/{org_id}/clients.
type OrgEmailConfig ¶
type OrgEmailConfig struct {
Provider string `json:"provider,omitempty"`
FromAddress string `json:"from_address,omitempty"`
FromName string `json:"from_name,omitempty"`
ReplyTo string `json:"reply_to,omitempty"`
Settings map[string]any `json:"settings,omitempty"`
}
OrgEmailConfig is a per-organisation email configuration.
type OrgEmailConfigResponse ¶
type OrgEmailConfigResponse struct {
Config OrgEmailConfig `json:"config"`
}
OrgEmailConfigResponse wraps an org's email configuration.
type OrgEmailConfigUpdate ¶
type OrgEmailConfigUpdate struct {
Provider *string `json:"provider,omitempty"`
FromAddress *string `json:"from_address,omitempty"`
FromName *string `json:"from_name,omitempty"`
ReplyTo *string `json:"reply_to,omitempty"`
APIKey *string `json:"api_key,omitempty"`
Settings *map[string]any `json:"settings,omitempty"`
}
OrgEmailConfigUpdate is the body for PUT /organizations/{org_id}/emails/config.
type OrgEmailTemplate ¶
type OrgEmailTemplate struct {
Type string `json:"type,omitempty"`
Subject string `json:"subject,omitempty"`
HTMLBody string `json:"html_body,omitempty"`
TextBody string `json:"text_body,omitempty"`
Enabled bool `json:"enabled,omitempty"`
}
OrgEmailTemplate is a per-organisation email template.
type OrgEmailTemplateResponse ¶
type OrgEmailTemplateResponse struct {
Template *OrgEmailTemplate `json:"template,omitempty"`
Templates []OrgEmailTemplate `json:"templates,omitempty"`
}
OrgEmailTemplateResponse wraps one or more org email templates.
type OrgEmailTemplateUpdate ¶
type OrgEmailTemplateUpdate struct {
Subject *string `json:"subject,omitempty"`
HTMLBody *string `json:"html_body,omitempty"`
TextBody *string `json:"text_body,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
}
OrgEmailTemplateUpdate is the body for updating an org email template.
type OrgHierarchyNode ¶
type OrgHierarchyNode struct {
ID string `json:"id"`
Name string `json:"name"`
Slug string `json:"slug,omitempty"`
ParentID string `json:"parent_id,omitempty"`
Type string `json:"type,omitempty"`
Children []OrgHierarchyNode `json:"children,omitempty"`
}
OrgHierarchyNode is a node in an organization tree.
type OrgHierarchyRequest ¶
type OrgHierarchyRequest struct {
OrgID string `json:"org_id"`
ParentOrgID string `json:"parent_org_id,omitempty"`
WorkspaceID string `json:"workspace_id,omitempty"`
}
OrgHierarchyRequest is the body for POST /zanzibar/stores/{store_id}/hierarchy/setup. Matches OpenAPI schema OrgHierarchyRequest (required: org_id).
type OrgHierarchyResponse ¶
type OrgHierarchyResponse struct {
Organization *OrgInfo `json:"organization"`
Teams []HierarchyTeam `json:"teams,omitempty"`
Children []OrgHierarchyResponse `json:"children,omitempty"`
UserCount int `json:"user_count,omitempty"`
TeamCount int `json:"team_count,omitempty"`
}
OrgHierarchyResponse is the result of GET /organizations/{org_id}/hierarchy.
CONTRACT NOTE: an earlier release of this SDK declared this as {root, organizations}, which no version of the service has ever returned — the spec defines {organization, teams, children, user_count, team_count} with `organization` required. Every field would have decoded to its zero value, and silently: JSON decoding does not complain about names it does not recognise, so a caller got an empty tree rather than an error. This is the same class of defect as the bulk-check mismatch fixed in v0.2.0, and the reason `make drift` exists.
Children are the SUB-ORGANIZATIONS: this is how companies-of-companies are represented on the wire.
func (*OrgHierarchyResponse) WalkOrgTree ¶ added in v0.9.0
func (r *OrgHierarchyResponse) WalkOrgTree(fn func(node *OrgHierarchyResponse, depth int))
WalkOrgTree visits every organization in the hierarchy depth-first, including the root, calling fn with the node and its depth.
Provided because "how many companies are under this one" and "flatten the tree for an audit" are the two things every caller does with this response, and both are recursive — which is exactly the code people get subtly wrong.
type OrgInfo ¶ added in v0.9.0
type OrgInfo struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Slug string `json:"slug,omitempty"`
ParentID string `json:"parent_id,omitempty"`
Domain string `json:"domain,omitempty"`
Status string `json:"status,omitempty"`
BillingType string `json:"billing_type,omitempty"`
Industry string `json:"industry,omitempty"`
Size string `json:"size,omitempty"`
Timezone string `json:"timezone,omitempty"`
Website string `json:"website,omitempty"`
LogoURL string `json:"logo_url,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
UpdatedAt string `json:"updated_at,omitempty"`
}
OrgInfo describes one organization in a hierarchy response.
ParentID is the nesting primitive: organizations form a TREE. A company can own sub-companies, each with their own teams and users. Nothing in this SDK exposed that before, so consumers modelled a flat tenancy the service never had.
type OrgLoginRequest ¶
OrgLoginRequest is the body for POST /organizations/{slug}/auth/login.
type OrgMember ¶
type OrgMember struct {
UserID string `json:"user_id"`
Email string `json:"email,omitempty"`
Name string `json:"name,omitempty"`
Role string `json:"role,omitempty"`
Status string `json:"status,omitempty"`
Permissions []string `json:"permissions,omitempty"`
JoinedAt string `json:"joined_at,omitempty"`
}
OrgMember is one organization membership entry.
type OrgPasswordResetRequest ¶
type OrgPasswordResetRequest struct {
Email string `json:"email"`
}
OrgPasswordResetRequest is the body for POST /organizations/{slug}/auth/reset-password.
type OrgProviderInfo ¶
type OrgProviderInfo struct {
ID string `json:"id"`
Type string `json:"type,omitempty"`
Name string `json:"name,omitempty"`
Priority int `json:"priority,omitempty"`
}
OrgProviderInfo is the safe provider metadata returned to a hosted login page.
type OrgProvidersResponse ¶
type OrgProvidersResponse struct {
Providers []OrgProviderInfo `json:"providers"`
}
OrgProvidersResponse is the result of GET /organizations/{slug}/auth/providers.
type OrgRegisterRequest ¶
type OrgRegisterRequest struct {
Email string `json:"email"`
Password string `json:"password"`
Name string `json:"name,omitempty"`
FirstName string `json:"first_name,omitempty"`
LastName string `json:"last_name,omitempty"`
}
OrgRegisterRequest is the body for POST /organizations/{slug}/auth/register.
type OrgRoleUpdate ¶
type OrgRoleUpdate struct {
Role string `json:"role,omitempty"`
Permissions []string `json:"permissions,omitempty"`
}
OrgRoleUpdate is the body for PUT /organizations/{org_id}/users/{user_id}.
type OrgSession ¶
type OrgSession struct {
ID string `json:"id"`
UserID string `json:"user_id"`
IPAddress string `json:"ip_address,omitempty"`
UserAgent string `json:"user_agent,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
LastSeenAt string `json:"last_seen_at,omitempty"`
ExpiresAt string `json:"expires_at,omitempty"`
}
OrgSession is one active session row.
type OrgSessionsResponse ¶
type OrgSessionsResponse struct {
Sessions []OrgSession `json:"sessions"`
Total int `json:"total,omitempty"`
}
OrgSessionsResponse is the result of GET /organizations/{org_id}/sessions.
type OrgUserResponse ¶
OrgUserResponse is the result of GET /organizations/{org_id}/users.
type Organization ¶
type Organization struct {
ID string `json:"id"`
Name string `json:"name"`
Slug string `json:"slug,omitempty"`
Domain string `json:"domain,omitempty"`
ParentID string `json:"parent_id,omitempty"`
ServiceAudience string `json:"service_audience,omitempty"`
BillingType string `json:"billing_type,omitempty"`
Status string `json:"status,omitempty"`
Timezone string `json:"timezone,omitempty"`
Settings map[string]any `json:"settings,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
}
Organization is the result of GET /organizations/{org_id}.
type OrganizationCreate ¶
type OrganizationCreate struct {
Name string `json:"name"`
Slug string `json:"slug,omitempty"`
Domain string `json:"domain,omitempty"`
ParentID string `json:"parent_id,omitempty"`
BillingType string `json:"billing_type,omitempty"`
ServiceAudience string `json:"service_audience,omitempty"`
Timezone string `json:"timezone,omitempty"`
Settings map[string]any `json:"settings,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
}
OrganizationCreate is the body for POST /organizations/.
type OrganizationInvite ¶
type OrganizationInvite struct {
Email string `json:"email"`
Role string `json:"role,omitempty"`
TeamIDs []string `json:"team_ids,omitempty"`
Message string `json:"message,omitempty"`
Resend bool `json:"resend,omitempty"`
}
OrganizationInvite is the body for POST /organizations/{org_id}/invite.
type OrganizationUpdate ¶
type OrganizationUpdate struct {
Name *string `json:"name,omitempty"`
Domain *string `json:"domain,omitempty"`
BillingType *string `json:"billing_type,omitempty"`
Status *string `json:"status,omitempty"`
Timezone *string `json:"timezone,omitempty"`
Settings *map[string]any `json:"settings,omitempty"`
Metadata *map[string]any `json:"metadata,omitempty"`
}
OrganizationUpdate is the body for PUT /organizations/{org_id}.
type OverrideListResponse ¶
type OverrideListResponse struct {
Overrides []NetworkOverride `json:"overrides"`
}
OverrideListResponse lists emergency overrides.
type PasswordAgeUpdate ¶
PasswordAgeUpdate is the body for POST /admin/users/password-age (test helper).
type PasswordAgeUpdateResponse ¶
type PasswordAgeUpdateResponse struct {
Message string `json:"message,omitempty"`
UserID string `json:"user_id,omitempty"`
}
PasswordAgeUpdateResponse is the result of POST /admin/users/password-age.
type PasswordAuditEventsResponse ¶
type PasswordAuditEventsResponse struct {
Events []map[string]any `json:"events"`
Total int `json:"total,omitempty"`
}
PasswordAuditEventsResponse is the result of GET /admin/audit/password-events.
type PasswordComplianceResponse ¶
type PasswordComplianceResponse struct {
Compliant int `json:"compliant,omitempty"`
NonCompliant int `json:"non_compliant,omitempty"`
Details map[string]any `json:"details,omitempty"`
}
PasswordComplianceResponse is the result of GET /admin/reports/password-compliance.
type PasswordPolicyGetResponse ¶
type PasswordPolicyGetResponse struct {
OrgID string `json:"org_id,omitempty"`
Policy *PasswordPolicyRequest `json:"policy,omitempty"`
}
PasswordPolicyGetResponse is the result of GET /admin/password-policy/{org_id}.
type PasswordPolicyRequest ¶
type PasswordPolicyRequest struct {
OrgID string `json:"org_id,omitempty"`
MinLength int `json:"min_length,omitempty"`
RequireUppercase bool `json:"require_uppercase,omitempty"`
RequireLowercase bool `json:"require_lowercase,omitempty"`
RequireNumbers bool `json:"require_numbers,omitempty"`
RequireSymbols bool `json:"require_symbols,omitempty"`
MaxAgeDays int `json:"max_age_days,omitempty"`
HistoryCount int `json:"history_count,omitempty"`
}
PasswordPolicyRequest is the body for POST /admin/password-policy.
type PasswordPolicySetResponse ¶
type PasswordPolicySetResponse struct {
Message string `json:"message,omitempty"`
Policy *PasswordPolicyRequest `json:"policy,omitempty"`
}
PasswordPolicySetResponse is the result of setting a password policy.
type PasswordReset ¶
PasswordReset is the body for POST /users/request-password-reset, POST /auth/password-reset, and POST /auth/check-permission's reset flows.
type PasswordResetConfirm ¶
type PasswordResetConfirm struct {
Token string `json:"token"`
NewPassword string `json:"new_password"`
}
PasswordResetConfirm is the body for POST /users/reset-password and POST /auth/password-reset/confirm.
type PasswordResetConfirmResponse ¶
type PasswordResetConfirmResponse struct {
Message string `json:"message,omitempty"`
Success bool `json:"success,omitempty"`
}
PasswordResetConfirmResponse is the result of confirming a password reset.
type PasswordResetResponse ¶
type PasswordResetResponse struct {
Message string `json:"message,omitempty"`
Success bool `json:"success,omitempty"`
}
PasswordResetResponse is the result of requesting a password reset.
type PasswordResetValidateResponse ¶
type PasswordResetValidateResponse struct {
Valid bool `json:"valid"`
Email string `json:"email,omitempty"`
Message string `json:"message,omitempty"`
}
PasswordResetValidateResponse is the result of validating a reset token.
type PasswordlessAuthResponse ¶
type PasswordlessAuthResponse struct {
AccessToken string `json:"access_token,omitempty"`
RefreshToken string `json:"refresh_token,omitempty"`
TokenType string `json:"token_type,omitempty"`
ExpiresIn int `json:"expires_in,omitempty"`
User *TokenUserInfo `json:"user,omitempty"`
}
PasswordlessAuthResponse is the token payload returned by a successful passwordless authentication (WebAuthn, magic link or recovery code).
type PermissionCheckRequest ¶
type PermissionCheckRequest struct {
UserID string `json:"user_id"`
Permission string `json:"permission"`
OrgID string `json:"org_id,omitempty"`
ResourceType string `json:"resource_type,omitempty"`
ResourceID string `json:"resource_id,omitempty"`
}
PermissionCheckRequest is the body for POST /permissions/check and POST /auth/check-permission.
type PermissionDecision ¶
type PermissionDecision struct {
Allowed bool `json:"allowed"`
Reason string `json:"reason,omitempty"`
Source string `json:"source,omitempty"`
EffectivePermissions []string `json:"effective_permissions,omitempty"`
}
PermissionDecision is the result of a permission check.
type PermissionGrantRequest ¶
type PermissionGrantRequest struct {
Subject string `json:"subject"`
Permission string `json:"permission"`
Resource string `json:"resource"`
ExpiresAt *time.Time `json:"expires_at,omitempty"`
Conditions map[string]any `json:"conditions,omitempty"`
}
PermissionGrantRequest is the body for POST/DELETE /zanzibar/stores/{store_id}/permissions/{grant,revoke}. Matches OpenAPI schema PermissionGrantRequest (required: subject, permission, resource). Subject and Resource are combined typed strings ("user:alice", "doc:123").
NOTE: this is the ZANZIBAR grant shape. The account/RBAC grant/revoke (/permissions/{grant,revoke}) take query parameters, not this body — see GrantPermission/RevokePermission in roles.go.
type PermissionValidationRequest ¶
type PermissionValidationRequest struct {
Permissions []string `json:"permissions"`
}
PermissionValidationRequest is the body for POST /permissions/registry/validate.
type PermissionValidationResponse ¶
type PermissionValidationResponse struct {
Valid bool `json:"valid"`
Results map[string]bool `json:"results,omitempty"`
Invalid []string `json:"invalid,omitempty"`
}
PermissionValidationResponse is the result of validating permission strings.
type PermissionsVisualizationResponse ¶
type PermissionsVisualizationResponse struct {
UserID string `json:"user_id"`
DirectPermissions []map[string]any `json:"direct_permissions,omitempty"`
InheritedFrom []map[string]any `json:"inherited_from,omitempty"`
}
PermissionsVisualizationResponse is a user's permission graph. Matches OpenAPI schema PermissionsVisualizationResponse (required: user_id).
type PolicyEvaluationResult ¶
type PolicyEvaluationResult struct {
Allowed bool `json:"allowed"`
IP string `json:"ip,omitempty"`
MatchedID string `json:"matched_policy_id,omitempty"`
Reason string `json:"reason,omitempty"`
}
PolicyEvaluationResult is the result of GET /network-policy/evaluate.
type Provider ¶
type Provider struct {
ID string `json:"id"`
Name string `json:"name,omitempty"`
Type string `json:"type,omitempty"`
Enabled bool `json:"enabled,omitempty"`
Priority int `json:"priority,omitempty"`
Domain string `json:"domain,omitempty"`
IssuerURL string `json:"issuer_url,omitempty"`
Config map[string]any `json:"config,omitempty"`
}
Provider is a provider configuration record (response shape is permissive).
type ProviderConfigCreate ¶
type ProviderConfigCreate struct {
Name string `json:"name"`
Type string `json:"type"` // e.g. "oidc", "saml", "google", "okta"
Enabled bool `json:"enabled,omitempty"`
Priority int `json:"priority,omitempty"`
ClientID string `json:"client_id,omitempty"`
ClientSecret string `json:"client_secret,omitempty"`
IssuerURL string `json:"issuer_url,omitempty"`
Domain string `json:"domain,omitempty"`
Config map[string]any `json:"config,omitempty"`
}
ProviderConfigCreate is the body for POST /providers/.
type ProviderConfigUpdate ¶
type ProviderConfigUpdate struct {
Name *string `json:"name,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
Priority *int `json:"priority,omitempty"`
ClientID *string `json:"client_id,omitempty"`
ClientSecret *string `json:"client_secret,omitempty"`
IssuerURL *string `json:"issuer_url,omitempty"`
Domain *string `json:"domain,omitempty"`
Config *map[string]any `json:"config,omitempty"`
}
ProviderConfigUpdate is the body for PUT /providers/{provider_id}.
type ProviderStatusUpdateRequest ¶
type ProviderStatusUpdateRequest struct {
ProviderID string `json:"provider_id"`
Enabled bool `json:"enabled"`
Reason string `json:"reason,omitempty"`
}
ProviderStatusUpdateRequest is the body for POST /admin/providers/status.
type ProviderStatusUpdateResponse ¶
type ProviderStatusUpdateResponse struct {
ProviderID string `json:"provider_id,omitempty"`
Enabled bool `json:"enabled,omitempty"`
Message string `json:"message,omitempty"`
}
ProviderStatusUpdateResponse is the result of updating provider status.
type ProviderTestRequest ¶
type ProviderTestRequest struct {
ProviderID string `json:"provider_id,omitempty"`
Type string `json:"type,omitempty"`
Config map[string]any `json:"config,omitempty"`
}
ProviderTestRequest is the body for POST /providers/test.
type ProviderTestResponse ¶
type ProviderTestResponse struct {
Success bool `json:"success"`
Message string `json:"message,omitempty"`
Details map[string]any `json:"details,omitempty"`
}
ProviderTestResponse is the result of a provider connectivity test.
type PublicLoginConfig ¶
type PublicLoginConfig struct {
OrgSlug string `json:"org_slug,omitempty"`
OrgName string `json:"org_name,omitempty"`
LogoURL string `json:"logo_url,omitempty"`
PrimaryColor string `json:"primary_color,omitempty"`
BackgroundColor string `json:"background_color,omitempty"`
AllowPassword bool `json:"allow_password,omitempty"`
AllowSignup bool `json:"allow_signup,omitempty"`
AllowPasswordless bool `json:"allow_passwordless,omitempty"`
Providers []OrgProviderInfo `json:"providers,omitempty"`
}
PublicLoginConfig is the public subset of a tenant's login config.
type PushedAuthorizationResponse ¶
type PushedAuthorizationResponse struct {
RequestURI string `json:"request_uri"`
ExpiresIn int `json:"expires_in,omitempty"`
}
PushedAuthorizationResponse is the RFC 9126 PAR result.
type QuotaCheckResponse ¶
type QuotaCheckResponse struct {
ResourceType string `json:"resource_type,omitempty"`
Allowed bool `json:"allowed"`
Used int64 `json:"used,omitempty"`
Limit int64 `json:"limit,omitempty"`
Remaining int64 `json:"remaining,omitempty"`
}
QuotaCheckResponse is the result of GET /quotas/check/{resource_type}.
type QuotaTier ¶
type QuotaTier struct {
Name string `json:"name"`
Limits map[string]int64 `json:"limits,omitempty"`
Price string `json:"price,omitempty"`
}
QuotaTier describes one subscription tier.
type QuotaTiersResponse ¶
type QuotaTiersResponse struct {
Tiers []QuotaTier `json:"tiers"`
}
QuotaTiersResponse is the result of GET /quotas/tiers.
type QuotaUsageItem ¶
type QuotaUsageItem struct {
ResourceType string `json:"resource_type"`
Used int64 `json:"used"`
Limit int64 `json:"limit"`
Remaining int64 `json:"remaining,omitempty"`
Percent float64 `json:"percent,omitempty"`
}
QuotaUsageItem is usage for one resource type.
type QuotaUsageResponse ¶
type QuotaUsageResponse struct {
Tier string `json:"tier,omitempty"`
Usage []QuotaUsageItem `json:"usage"`
}
QuotaUsageResponse is the result of GET /quotas/my-usage.
type RecentAlertsResponse ¶
type RecentAlertsResponse struct {
Alerts []AlertEntry `json:"alerts"`
}
RecentAlertsResponse lists recent alerts.
type RecoveryCodesResponse ¶
type RecoveryCodesResponse struct {
Codes []string `json:"codes"`
Generated int `json:"generated,omitempty"`
}
RecoveryCodesResponse is the result of generating MFA recovery codes.
type RefreshRequest ¶
type RefreshRequest struct {
RefreshToken string `json:"refresh_token"`
}
RefreshRequest is the body for POST /auth/refresh.
type RegisterRequest ¶
type RegisterRequest struct {
Email string `json:"email"`
Password string `json:"password"`
Name string `json:"name,omitempty"`
OrgID string `json:"org_id,omitempty"`
ProviderType string `json:"provider_type,omitempty"`
}
RegisterRequest is the body for POST /auth/register.
type RegisteredService ¶
type RegisteredService struct {
Service string `json:"service"`
Permissions []string `json:"permissions,omitempty"`
Description string `json:"description,omitempty"`
}
RegisteredService describes a service that has registered permissions.
type RegisteredServicesResponse ¶
type RegisteredServicesResponse struct {
Services []RegisteredService `json:"services"`
Total int `json:"total,omitempty"`
}
RegisteredServicesResponse is the result of GET /permissions/registry/services.
type RegistryStatsResponse ¶
type RegistryStatsResponse struct {
TotalServices int `json:"total_services,omitempty"`
TotalPermissions int `json:"total_permissions,omitempty"`
}
RegistryStatsResponse is the result of GET /permissions/registry/stats.
type RelationshipEntry ¶
type RelationshipEntry struct {
Relation string `json:"relation"`
Subject string `json:"subject"`
Context map[string]any `json:"context,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
ExpiresAt string `json:"expires_at,omitempty"`
}
RelationshipEntry is a stored relationship tuple as returned by reads. Matches OpenAPI schema RelationshipEntry (required: relation, subject). CreatedAt/ExpiresAt are left as raw strings because the server's OpenAPI types them as anyOf[str, date-time, null] — a plain string is a valid value.
type RelationshipRequest ¶
type RelationshipRequest struct {
Object string `json:"object"`
Relation string `json:"relation"`
Subject string `json:"subject"`
Context map[string]any `json:"context,omitempty"`
ExpiresAt *time.Time `json:"expires_at,omitempty"`
}
RelationshipRequest is a SINGLE relationship tuple: object#relation@subject. Body for POST/DELETE /zanzibar/stores/{store_id}/relationships.
Matches OpenAPI schema RelationshipRequest (required: object, relation, subject). Object/Subject are combined typed strings ("doc:123", "user:alice"); build them with Object()/Subject().
type RelationshipsPage ¶
type RelationshipsPage struct {
Object string `json:"object"`
Relationships []RelationshipEntry `json:"relationships,omitempty"`
ContinuationToken string `json:"continuation_token,omitempty"`
}
RelationshipsPage is the (nominally cursored) form of RelationshipsResponse.
SERVER-GAP (pagination): the auth service does NOT paginate list-relationships (see ListRelationshipsPaged). ContinuationToken is forward-looking and always comes back empty from the current server. It matches RelationshipsResponse on the wire: {object, relationships:[]RelationshipEntry}.
type RelationshipsResponse ¶
type RelationshipsResponse struct {
Object string `json:"object"`
Relationships []RelationshipEntry `json:"relationships,omitempty"`
}
RelationshipsResponse lists the tuples for an object. Matches OpenAPI schema RelationshipsResponse (required: object).
type RequestInfo ¶ added in v0.5.0
type RequestInfo struct {
// Method is the HTTP method, e.g. "POST".
Method string
// Endpoint is the request path with any query string stripped — a stable,
// low-cardinality label suitable as a metric dimension. Path parameters are
// NOT templated, so ids do appear here; aggregate accordingly.
Endpoint string
// Status is the HTTP status code, or 0 when the request never got a response
// (connection failure, timeout, cancelled context — Err says which).
Status int
// Duration is how long this attempt took.
Duration time.Duration
// Attempt is 0 for the first try, 1 for the first retry, and so on.
Attempt int
// Retrying reports whether the client is about to retry after this attempt.
// Exactly one RequestInfo per logical call has Retrying == false.
Retrying bool
// Err is the transport error, if any. A non-2xx response is NOT an error
// here — check Status. This field means the request did not complete.
Err error
// RequestID is the service's correlation id from the response, when present.
// Quote it in a bug report; it is how the service finds your call in its logs.
RequestID string
}
RequestInfo describes one completed HTTP attempt. A call that is retried produces one RequestInfo per attempt, so retry behaviour is visible rather than hidden inside a single "slow call".
type Resource ¶
Resource is an optional fine-grained target for a permission decision. Zero value means "no specific resource".
type RevocationAuditEntry ¶
type RevocationAuditEntry struct {
ID string `json:"id,omitempty"`
Type string `json:"type,omitempty"`
Subject string `json:"subject,omitempty"`
Actor string `json:"actor,omitempty"`
Reason string `json:"reason,omitempty"`
Timestamp string `json:"timestamp,omitempty"`
}
RevocationAuditEntry is one entry from GET /admin/audit/revocations.
type RevokeResult ¶
type RevokeResult struct {
Revoked bool `json:"revoked,omitempty"`
Message string `json:"message,omitempty"`
}
RevokeResult is the response from POST /auth/revoke and /token/revoke. Per RFC 7009 the revocation endpoint may return an empty body; in that case Revoked defaults to false but a nil error indicates success.
type RevokedKeysListResponse ¶
type RevokedKeysListResponse struct {
RevokedKeys []map[string]any `json:"revoked_keys"`
Total int `json:"total,omitempty"`
}
RevokedKeysListResponse is the result of GET /admin/jwks/revoked.
type RoleDefinition ¶
type RoleDefinition struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
Permissions []string `json:"permissions,omitempty"`
}
RoleDefinition describes a role and the permissions it grants.
type RoleUpdateResponse ¶
type RoleUpdateResponse struct {
Message string `json:"message,omitempty"`
UserID string `json:"user_id,omitempty"`
Role string `json:"role,omitempty"`
}
RoleUpdateResponse is the result of changing a member's role.
type RolesResponse ¶
type RolesResponse struct {
Roles map[string]RoleDefinition `json:"roles"`
}
RolesResponse is the result of GET /permissions/roles (map keyed by role name).
type RotationStatusResponse ¶
type RotationStatusResponse struct {
Rotating bool `json:"rotating,omitempty"`
CurrentKid string `json:"current_kid,omitempty"`
LastRotated string `json:"last_rotated,omitempty"`
}
RotationStatusResponse is the result of GET /admin/jwks/rotation-status.
type SAMLAnalyticsResponse ¶
type SAMLAnalyticsResponse struct {
TotalLogins int `json:"total_logins,omitempty"`
ActiveSessions int `json:"active_sessions,omitempty"`
Stats map[string]any `json:"stats,omitempty"`
}
SAMLAnalyticsResponse reports SAML usage analytics.
type SAMLAssertionResult ¶
type SAMLAssertionResult struct {
AccessToken string `json:"access_token,omitempty"`
RefreshToken string `json:"refresh_token,omitempty"`
NameID string `json:"name_id,omitempty"`
SessionIndex string `json:"session_index,omitempty"`
Attributes map[string]any `json:"attributes,omitempty"`
RelayState string `json:"relay_state,omitempty"`
}
SAMLAssertionResult is the result of the assertion-consumer service.
type SAMLAttributeMappingResponse ¶
SAMLAttributeMappingResponse is the SAML attribute-mapping configuration.
type SAMLAttributeMappingUpdate ¶
SAMLAttributeMappingUpdate is the body for PUT /saml/attributes/mappings.
type SAMLCertificate ¶
type SAMLCertificate struct {
Use string `json:"use,omitempty"`
Fingerprint string `json:"fingerprint,omitempty"`
NotBefore string `json:"not_before,omitempty"`
NotAfter string `json:"not_after,omitempty"`
Active bool `json:"active,omitempty"`
}
SAMLCertificate describes a signing/encryption certificate.
type SAMLCertificateGenerateResponse ¶
type SAMLCertificateGenerateResponse struct {
Certificate string `json:"certificate,omitempty"`
Fingerprint string `json:"fingerprint,omitempty"`
Message string `json:"message,omitempty"`
}
SAMLCertificateGenerateResponse is the result of generating a certificate.
type SAMLCertificateStatusResponse ¶
type SAMLCertificateStatusResponse struct {
Certificates []SAMLCertificate `json:"certificates"`
}
SAMLCertificateStatusResponse reports certificate status.
type SAMLLogoutResult ¶
type SAMLLogoutResult struct {
Success bool `json:"success,omitempty"`
RedirectURL string `json:"redirect_url,omitempty"`
Message string `json:"message,omitempty"`
}
SAMLLogoutResult is the result of a SAML single-logout.
type SAMLSPDetailResponse ¶
type SAMLSPDetailResponse struct {
ServiceProvider SAMLServiceProvider `json:"service_provider"`
}
SAMLSPDetailResponse wraps a service-provider detail.
type SAMLSPListResponse ¶
type SAMLSPListResponse struct {
ServiceProviders []SAMLServiceProvider `json:"service_providers"`
Total int `json:"total,omitempty"`
}
SAMLSPListResponse lists registered service providers.
type SAMLSPRegistrationResponse ¶
type SAMLSPRegistrationResponse struct {
SPID string `json:"sp_id"`
EntityID string `json:"entity_id,omitempty"`
MetadataURL string `json:"metadata_url,omitempty"`
Message string `json:"message,omitempty"`
}
SAMLSPRegistrationResponse is the result of registering a service provider.
type SAMLSPUpdateResponse ¶
type SAMLSPUpdateResponse struct {
SPID string `json:"sp_id,omitempty"`
Message string `json:"message,omitempty"`
Success bool `json:"success,omitempty"`
}
SAMLSPUpdateResponse is the result of updating a service provider.
type SAMLServiceProvider ¶
type SAMLServiceProvider struct {
SPID string `json:"sp_id"`
EntityID string `json:"entity_id,omitempty"`
Name string `json:"name,omitempty"`
ACSURL string `json:"acs_url,omitempty"`
SLOURL string `json:"slo_url,omitempty"`
NameIDFormat string `json:"name_id_format,omitempty"`
Status string `json:"status,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
}
SAMLServiceProvider is a registered service provider (detail view).
type SAMLServiceProviderConfig ¶
type SAMLServiceProviderConfig struct {
EntityID string `json:"entity_id"`
Name string `json:"name,omitempty"`
ACSURL string `json:"acs_url,omitempty"`
SLOURL string `json:"slo_url,omitempty"`
MetadataURL string `json:"metadata_url,omitempty"`
MetadataXML string `json:"metadata_xml,omitempty"`
NameIDFormat string `json:"name_id_format,omitempty"`
WantAssertionsSigned bool `json:"want_assertions_signed,omitempty"`
SignAuthnRequests bool `json:"sign_authn_requests,omitempty"`
AllowedRedirectURLs []string `json:"allowed_redirect_urls,omitempty"`
AttributeMapping map[string]string `json:"attribute_mapping,omitempty"`
}
SAMLServiceProviderConfig is the body for POST /saml/sp/register and the shape used to update a service provider.
type SAMLSession ¶
type SAMLSession struct {
SessionIndex string `json:"session_index,omitempty"`
NameID string `json:"name_id,omitempty"`
SPEntityID string `json:"sp_entity_id,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
}
SAMLSession is one active SAML session.
type SAMLSessionListResponse ¶
type SAMLSessionListResponse struct {
Sessions []SAMLSession `json:"sessions"`
}
SAMLSessionListResponse lists active SAML sessions.
type SSOConfigResponse ¶
type SSOConfigResponse struct {
Enabled bool `json:"enabled,omitempty"`
Config map[string]any `json:"config,omitempty"`
}
SSOConfigResponse is the result of GET /federation/sso/config.
type SSOConfigUpdateResponse ¶
type SSOConfigUpdateResponse struct {
Message string `json:"message,omitempty"`
Config map[string]any `json:"config,omitempty"`
}
SSOConfigUpdateResponse is the result of PUT /federation/sso/config.
type SSODomainConfigRequest ¶
type SSODomainConfigRequest struct {
ProviderID string `json:"provider_id,omitempty"`
Enabled bool `json:"enabled,omitempty"`
Config map[string]any `json:"config,omitempty"`
}
SSODomainConfigRequest is the body for POST/PUT /federation/sso/domains/{domain}.
type SSODomainConfigResponse ¶
type SSODomainConfigResponse struct {
Domain string `json:"domain"`
ProviderID string `json:"provider_id,omitempty"`
Enabled bool `json:"enabled,omitempty"`
Config map[string]any `json:"config,omitempty"`
}
SSODomainConfigResponse is one domain's SSO configuration.
type SSODomainListResponse ¶
type SSODomainListResponse struct {
Domains []SSODomainConfigResponse `json:"domains"`
Total int `json:"total,omitempty"`
}
SSODomainListResponse is the result of GET /federation/sso/domains.
type SSOPropagateResponse ¶
type SSOPropagateResponse struct {
Success bool `json:"success,omitempty"`
PropagatedTo []string `json:"propagated_to,omitempty"`
Message string `json:"message,omitempty"`
}
SSOPropagateResponse is the result of POST /federation/sso/propagate.
type SSOSession ¶
type SSOSession struct {
ID string `json:"id"`
UserID string `json:"user_id,omitempty"`
Provider string `json:"provider,omitempty"`
Domain string `json:"domain,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
ExpiresAt string `json:"expires_at,omitempty"`
}
SSOSession is one federated SSO session.
type SSOSessionCreateResponse ¶
type SSOSessionCreateResponse struct {
Session SSOSession `json:"session"`
SessionID string `json:"session_id,omitempty"`
}
SSOSessionCreateResponse is the result of POST /federation/sso/sessions.
type SSOSessionDetailResponse ¶
type SSOSessionDetailResponse struct {
Session SSOSession `json:"session"`
}
SSOSessionDetailResponse is the result of GET /federation/sso/sessions/{id}.
type SSOSessionListResponse ¶
type SSOSessionListResponse struct {
Sessions []SSOSession `json:"sessions"`
Total int `json:"total,omitempty"`
}
SSOSessionListResponse is the result of GET /federation/sso/sessions.
type SelfDeleteRequest ¶
type SelfDeleteRequest struct {
ConfirmEmail string `json:"confirm_email"`
}
SelfDeleteRequest is the confirmation body for DELETE /users/me. Matches OpenAPI schema SelfDeleteRequest (required: confirm_email).
ConfirmEmail MUST exactly match the authenticated caller's own account email. It is the irreversible-action guard — the same "type your address to confirm" pattern a UI would use. A mismatch is rejected and NO state changes.
type SelfDeleteResponse ¶
type SelfDeleteResponse struct {
Success bool `json:"success,omitempty"`
Message string `json:"message,omitempty"`
UserID string `json:"user_id,omitempty"`
}
SelfDeleteResponse is the result of DELETE /users/me.
The server's response body is not tightly specified, so the useful fields are modelled optimistically and Raw retains anything else. Treat a nil error as the authoritative signal that the deletion was accepted.
type ServiceAccountCreate ¶
type ServiceAccountCreate struct {
Name string `json:"name"`
OrgID string `json:"org_id,omitempty"`
Permissions []string `json:"permissions,omitempty"`
Description string `json:"description,omitempty"`
}
ServiceAccountCreate is the body for POST /admin/users/create-service-account.
type ServiceAccountResponse ¶
type ServiceAccountResponse struct {
UserID string `json:"user_id,omitempty"`
Name string `json:"name,omitempty"`
APIKey string `json:"api_key,omitempty"`
Permissions []string `json:"permissions,omitempty"`
Message string `json:"message,omitempty"`
}
ServiceAccountResponse is the result of creating a service account.
type ServiceDiscoveryResponse ¶
type ServiceDiscoveryResponse struct {
Service string `json:"service,omitempty"`
Version string `json:"version,omitempty"`
Endpoints map[string]string `json:"endpoints,omitempty"`
Links map[string]string `json:"links,omitempty"`
}
ServiceDiscoveryResponse is the result of GET / (root discovery).
type ServicePermissionRegister ¶
type ServicePermissionRegister struct {
Service string `json:"service"`
Permissions []string `json:"permissions"`
Description string `json:"description,omitempty"`
}
ServicePermissionRegister is the body for POST /permissions/registry/register.
type ServicePermissionResponse ¶
type ServicePermissionResponse struct {
Service string `json:"service,omitempty"`
Permissions []string `json:"permissions,omitempty"`
Message string `json:"message,omitempty"`
}
ServicePermissionResponse is the result of registering service permissions.
type ServiceStatusResponse ¶
type ServiceStatusResponse struct {
Status string `json:"status"`
Uptime string `json:"uptime,omitempty"`
Details map[string]any `json:"details,omitempty"`
}
ServiceStatusResponse is the result of GET /status.
type SessionRevokeResponse ¶
type SessionRevokeResponse struct {
Message string `json:"message,omitempty"`
RevokedCount int `json:"revoked_count,omitempty"`
}
SessionRevokeResponse is the result of revoking a user's sessions.
type SuperAdminActiveGrantsResponse ¶
type SuperAdminActiveGrantsResponse struct {
Grants []map[string]any `json:"grants"`
Total int `json:"total,omitempty"`
}
SuperAdminActiveGrantsResponse is the result of GET /super-admin/active-grants.
type SuperAdminCleanupResponse ¶
type SuperAdminCleanupResponse struct {
CleanedCount int `json:"cleaned_count,omitempty"`
Message string `json:"message,omitempty"`
}
SuperAdminCleanupResponse is the result of POST /super-admin/cleanup-expired.
type SuperAdminExtendRequestModel ¶
type SuperAdminExtendRequestModel struct {
GrantID string `json:"grant_id"`
AdditionalSeconds int `json:"additional_seconds,omitempty"`
Reason string `json:"reason,omitempty"`
}
SuperAdminExtendRequestModel is the body for POST /super-admin/extend.
type SuperAdminExtendResponse ¶
type SuperAdminExtendResponse struct {
GrantID string `json:"grant_id,omitempty"`
ExpiresAt string `json:"expires_at,omitempty"`
Message string `json:"message,omitempty"`
}
SuperAdminExtendResponse is the result of POST /super-admin/extend.
type SuperAdminGrantRequestModel ¶
type SuperAdminGrantRequestModel struct {
UserID string `json:"user_id"`
Permissions []string `json:"permissions"`
DurationSeconds int `json:"duration_seconds,omitempty"`
Reason string `json:"reason,omitempty"`
RequiresApproval bool `json:"requires_approval,omitempty"`
}
SuperAdminGrantRequestModel is the body for POST /super-admin/grant.
type SuperAdminGrantResponse ¶
type SuperAdminGrantResponse struct {
GrantID string `json:"grant_id,omitempty"`
UserID string `json:"user_id,omitempty"`
Status string `json:"status,omitempty"`
ExpiresAt string `json:"expires_at,omitempty"`
Message string `json:"message,omitempty"`
}
SuperAdminGrantResponse is the result of POST /super-admin/grant.
type SuperAdminRevokeRequestModel ¶
type SuperAdminRevokeRequestModel struct {
GrantID string `json:"grant_id,omitempty"`
UserID string `json:"user_id,omitempty"`
Reason string `json:"reason,omitempty"`
}
SuperAdminRevokeRequestModel is the body for POST /super-admin/revoke.
type SuperAdminRevokeResponse ¶
type SuperAdminRevokeResponse struct {
GrantID string `json:"grant_id,omitempty"`
Revoked bool `json:"revoked,omitempty"`
Message string `json:"message,omitempty"`
}
SuperAdminRevokeResponse is the result of POST /super-admin/revoke.
type SwitchOrganizationRequest ¶
type SwitchOrganizationRequest struct {
OrgID string `json:"org_id"`
}
SwitchOrganizationRequest is the body for POST /auth/switch-organization.
type Team ¶
type Team struct {
ID string `json:"id"`
OrgID string `json:"org_id,omitempty"`
Name string `json:"name"`
Slug string `json:"slug,omitempty"`
Description string `json:"description,omitempty"`
ParentID string `json:"parent_id,omitempty"`
MemberCount int `json:"member_count,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
}
Team is a team/group within an organization.
type TeamCreate ¶
type TeamCreate struct {
Name string `json:"name"`
Slug string `json:"slug,omitempty"`
Description string `json:"description,omitempty"`
ParentID string `json:"parent_id,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
}
TeamCreate is the body for POST /organizations/{org_id}/teams.
type TeamMember ¶
type TeamMember struct {
UserID string `json:"user_id"`
Email string `json:"email,omitempty"`
Name string `json:"name,omitempty"`
Role string `json:"role,omitempty"`
AddedAt string `json:"added_at,omitempty"`
}
TeamMember is one team member entry.
type TeamMemberAdd ¶
TeamMemberAdd is the body for POST /teams/{team_id}/members.
type TeamMemberRoleUpdate ¶
type TeamMemberRoleUpdate struct {
Role string `json:"role"`
}
TeamMemberRoleUpdate is the body for PUT /teams/{team_id}/members/{user_id}.
type TeamMembershipRequest ¶
type TeamMembershipRequest struct {
UserID string `json:"user_id"`
TeamID string `json:"team_id"`
Role string `json:"role,omitempty"`
}
TeamMembershipRequest is the body for POST /zanzibar/stores/{store_id}/teams/membership. Matches OpenAPI schema TeamMembershipRequest (required: user_id, team_id) — a SINGLE membership, not a batch.
type TeamPermissionsResponse ¶
type TeamPermissionsResponse struct {
TeamID string `json:"team_id,omitempty"`
Permissions []string `json:"permissions"`
}
TeamPermissionsResponse is the result of GET /teams/{team_id}/permissions.
type TeamUpdate ¶
type TeamUpdate struct {
Name *string `json:"name,omitempty"`
Description *string `json:"description,omitempty"`
Metadata *map[string]any `json:"metadata,omitempty"`
}
TeamUpdate is the body for PUT /teams/{team_id}.
type TempAllowlistCreateResponse ¶
type TempAllowlistCreateResponse struct {
EntryID string `json:"entry_id"`
ExpiresAt string `json:"expires_at,omitempty"`
Message string `json:"message,omitempty"`
}
TempAllowlistCreateResponse is the result of creating a temp allowlist entry.
type TempAllowlistEntry ¶
type TempAllowlistEntry struct {
ID string `json:"id"`
IP string `json:"ip,omitempty"`
Reason string `json:"reason,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
ExpiresAt string `json:"expires_at,omitempty"`
}
TempAllowlistEntry is one temporary allowlist entry.
type TempAllowlistListResponse ¶
type TempAllowlistListResponse struct {
Entries []TempAllowlistEntry `json:"entries"`
}
TempAllowlistListResponse lists temporary allowlist entries.
type TempAllowlistRequest ¶
type TempAllowlistRequest struct {
IP string `json:"ip"`
Reason string `json:"reason,omitempty"`
TTLSeconds int `json:"ttl_seconds,omitempty"`
}
TempAllowlistRequest is the body for POST /network-policy/temp-allowlist.
type TemplatePreviewResponse ¶
type TemplatePreviewResponse struct {
Subject string `json:"subject,omitempty"`
HTMLBody string `json:"html_body,omitempty"`
TextBody string `json:"text_body,omitempty"`
}
TemplatePreviewResponse is the rendered preview of an email template.
type TemplateTypeInfo ¶
type TemplateTypeInfo struct {
Type string `json:"type"`
Description string `json:"description,omitempty"`
Variables []string `json:"variables,omitempty"`
}
TemplateTypeInfo describes one available email template type.
type TemplateTypesResponse ¶
type TemplateTypesResponse struct {
TemplateTypes []TemplateTypeInfo `json:"template_types"`
}
TemplateTypesResponse lists available template types.
type TestEmailRequest ¶
TestEmailRequest is the body for POST /organizations/{org_id}/emails/test.
type TestEmailSentResponse ¶
type TestEmailSentResponse struct {
Message string `json:"message,omitempty"`
Success bool `json:"success,omitempty"`
EmailID string `json:"email_id,omitempty"`
}
TestEmailSentResponse is the result of sending a test email.
type TokenResponse ¶
type TokenResponse struct {
AccessToken string `json:"access_token,omitempty"`
TokenType string `json:"token_type,omitempty"`
ExpiresIn int `json:"expires_in,omitempty"`
RefreshToken string `json:"refresh_token,omitempty"`
IDToken string `json:"id_token,omitempty"`
Scope string `json:"scope,omitempty"`
}
TokenResponse is the OAuth2 token-endpoint response (POST /auth/oauth/token, /token/refresh, provider callbacks). It mirrors the standard token payload.
type TokenSet ¶
type TokenSet struct {
AccessToken string `json:"access_token"`
RefreshToken string `json:"refresh_token"`
TokenType string `json:"token_type,omitempty"` // "bearer"
ExpiresIn int `json:"expires_in,omitempty"` // seconds
User TokenUserInfo `json:"user"`
Audience []string `json:"audience,omitempty"`
}
TokenSet is the result of Login / Refresh / SwitchOrganization (LoginResponse / TokenResponse in the API).
type TokenSource ¶
TokenSource supplies (and can refresh) a bearer token. A CLI/agent implements or uses this to carry credentials across calls.
type TokenUserInfo ¶
type TokenUserInfo struct {
ID string `json:"id"`
Email string `json:"email"`
Name string `json:"name,omitempty"`
OrgID string `json:"org_id,omitempty"`
IsDelegated bool `json:"is_delegated,omitempty"`
}
TokenUserInfo is the embedded user summary returned with a token set.
type TokenValidationRequest ¶
type TokenValidationRequest struct {
Token string `json:"token"`
RequiredPermissions []string `json:"required_permissions,omitempty"`
ResourceType string `json:"resource_type,omitempty"`
ResourceID string `json:"resource_id,omitempty"`
ExpectedAudience string `json:"expected_audience,omitempty"`
IncludePermissions bool `json:"include_permissions,omitempty"`
}
TokenValidationRequest is the body for POST /auth/validate-token.
type TransactRelationshipsRequest ¶
type TransactRelationshipsRequest struct {
Writes []RelationshipRequest `json:"writes,omitempty"`
Deletes []RelationshipRequest `json:"deletes,omitempty"`
}
TransactRelationshipsRequest writes and deletes tuples in ONE atomic (all-or-nothing) transaction — e.g. re-parenting an object requires deleting the old edge and writing the new one together. Each write/delete is a single RelationshipRequest tuple (combined `object`/`subject` strings).
type UpdateNetworkPolicyRequest ¶
type UpdateNetworkPolicyRequest struct {
Name *string `json:"name,omitempty"`
Description *string `json:"description,omitempty"`
Mode *string `json:"mode,omitempty"`
CIDRs *[]string `json:"cidrs,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
Priority *int `json:"priority,omitempty"`
}
UpdateNetworkPolicyRequest is the body for PUT /network-policy/{policy_id}.
type User ¶
type User struct {
ID string `json:"id"`
Email string `json:"email"`
Name string `json:"name,omitempty"`
Status string `json:"status,omitempty"`
EmailVerified bool `json:"email_verified,omitempty"`
Phone string `json:"phone,omitempty"`
AvatarURL string `json:"avatar_url,omitempty"`
Timezone string `json:"timezone,omitempty"`
Language string `json:"language,omitempty"`
ProviderType string `json:"provider_type,omitempty"`
OrgID string `json:"org_id,omitempty"` // UserResponse
ActiveOrgID string `json:"active_org_id,omitempty"` // UserProfile
Organizations []UserOrganizationInfo `json:"organizations,omitempty"` // UserProfile
Metadata map[string]any `json:"metadata,omitempty"`
}
User is the profile returned by GET /users/{user_id}, /users/me, /auth/me. Fields are a superset that tolerates both UserProfile and UserResponse.
type UserOrganizationInfo ¶
type UserOrganizationInfo struct {
ID string `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
Role string `json:"role"`
IsPersonal bool `json:"is_personal"`
IsDefault bool `json:"is_default"`
JoinedAt string `json:"joined_at,omitempty"`
Permissions []string `json:"permissions"`
ParentID string `json:"parent_id,omitempty"`
WorkspaceType string `json:"workspace_type,omitempty"`
}
UserOrganizationInfo is one membership entry (GET /users/me/organizations).
type UserPermissions ¶
type UserPermissions struct {
UserID string `json:"user_id"`
OrgID string `json:"org_id,omitempty"`
Permissions []string `json:"permissions,omitempty"`
}
UserPermissions is the result of GET /permissions/user/{user_id}.
type UserUpdate ¶
type UserUpdate struct {
Name *string `json:"name,omitempty"`
Phone *string `json:"phone,omitempty"`
AvatarURL *string `json:"avatar_url,omitempty"`
Timezone *string `json:"timezone,omitempty"`
Language *string `json:"language,omitempty"`
Metadata *map[string]any `json:"metadata,omitempty"`
}
UserUpdate is the body for PUT /users/me and PUT /users/{user_id}. Only non-nil fields are sent, giving partial-update (PATCH-like) semantics.
type ValidPermissionsResponse ¶
type ValidPermissionsResponse struct {
Permissions []string `json:"permissions"`
Total int `json:"total,omitempty"`
}
ValidPermissionsResponse is the result of GET /permissions/registry/valid-permissions.
type ValidateAPIKeyRequest ¶
type ValidateAPIKeyRequest struct {
APIKey string `json:"api_key"`
RequiredPermissions []string `json:"required_permissions,omitempty"`
ExpectedAudience string `json:"expected_audience,omitempty"`
}
ValidateAPIKeyRequest is the body for POST /auth/validate-api-key.
type Validator ¶
Validator resolves a bearer token to an Actor (identity + tenant + perms). A resource server's request middleware should depend on this, not on *Client.
type VerifyEmailConfirmRequest ¶
type VerifyEmailConfirmRequest struct {
Token string `json:"token"`
}
VerifyEmailConfirmRequest is the body for POST /auth/verify-email/confirm.
type VerifyEmailSendRequest ¶
type VerifyEmailSendRequest struct {
Email string `json:"email,omitempty"`
OrgID string `json:"org_id,omitempty"`
}
VerifyEmailSendRequest is the body for POST /auth/verify-email/send.
type ViolationListResponse ¶
type ViolationListResponse struct {
Violations []NetworkViolation `json:"violations"`
Total int `json:"total,omitempty"`
}
ViolationListResponse lists access violations.
type VisualizationRequest ¶
type VisualizationRequest struct {
OrgID string `json:"org_id"`
IncludeUsers bool `json:"include_users,omitempty"`
IncludeTeams bool `json:"include_teams,omitempty"`
IncludePermissions bool `json:"include_permissions,omitempty"`
MaxDepth int `json:"max_depth,omitempty"`
}
VisualizationRequest is the body for POST /zanzibar/stores/{store_id}/visualize/hierarchy. Matches OpenAPI schema VisualizationRequest (required: org_id).
type WatchStatusResponse ¶
type WatchStatusResponse struct {
Available bool `json:"available"`
Channel string `json:"channel,omitempty"`
Message string `json:"message"`
}
WatchStatusResponse is the result of GET /zanzibar/stores/{store_id}/watch/status. Matches OpenAPI schema WatchStatusResponse (required: available, message).
type WebAuthnConfigResponse ¶
type WebAuthnConfigResponse struct {
RPID string `json:"rp_id,omitempty"`
RPName string `json:"rp_name,omitempty"`
Origin string `json:"origin,omitempty"`
Origins []string `json:"origins,omitempty"`
AttestationFormat string `json:"attestation,omitempty"`
UserVerification string `json:"user_verification,omitempty"`
Enabled bool `json:"enabled,omitempty"`
}
WebAuthnConfigResponse is the result of GET /auth/passwordless/webauthn/config.
type WebAuthnCredential ¶
type WebAuthnCredential struct {
ID string `json:"id"`
Name string `json:"name,omitempty"`
DeviceType string `json:"device_type,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
LastUsedAt string `json:"last_used_at,omitempty"`
BackedUp bool `json:"backed_up,omitempty"`
}
WebAuthnCredential is a registered passkey/credential.
type WebAuthnCredentialListResponse ¶
type WebAuthnCredentialListResponse struct {
Credentials []WebAuthnCredential `json:"credentials"`
}
WebAuthnCredentialListResponse lists a user's registered credentials.
type WebAuthnCredentialUpdate ¶
type WebAuthnCredentialUpdate struct {
Name string `json:"name"`
}
WebAuthnCredentialUpdate renames a credential.
type WebAuthnRegistrationResult ¶
type WebAuthnRegistrationResult struct {
CredentialID string `json:"credential_id,omitempty"`
Success bool `json:"success,omitempty"`
Message string `json:"message,omitempty"`
}
WebAuthnRegistrationResult is returned when finishing a WebAuthn registration.
type WildcardCheckResponse ¶
type WildcardCheckResponse struct {
Allowed bool `json:"allowed"`
}
WildcardCheckResponse is the result of GET /zanzibar/stores/{store_id}/check/wildcard. Matches OpenAPI schema WildcardCheckResponse (required: allowed).
type WriteAuthorizationModelRequest ¶
type WriteAuthorizationModelRequest struct {
Model AuthorizationModel `json:"model"`
}
WriteAuthorizationModelRequest is the body for POST .../authorization-models.
type WriteAuthorizationModelResponse ¶
type WriteAuthorizationModelResponse struct {
AuthorizationModelID string `json:"authorization_model_id"`
Message string `json:"message,omitempty"`
}
WriteAuthorizationModelResponse returns the immutable, versioned model id that subsequent checks and writes may pin to.
type WriteOperationResponse ¶
type WriteOperationResponse struct {
Success bool `json:"success"`
Message string `json:"message"`
// ConsistencyToken (a "zookie") identifies the revision this write produced.
// Feed it back as CheckPermissionRequest.ConsistencyToken (or the *Request
// consistency_token fields) to get a read-after-write consistent read. Empty
// if the server issues none.
ConsistencyToken string `json:"consistency_token,omitempty"`
}
WriteOperationResponse is the result of a tuple write/delete/grant/revoke. Matches OpenAPI schema WriteOperationResponse (required: success, message).
type ZanzibarMessageResponse ¶
type ZanzibarMessageResponse struct {
Message string `json:"message"`
}
ZanzibarMessageResponse is the generic Zanzibar message envelope. Matches OpenAPI schema ZanzibarMessageResponse (required: message).
type ZanzibarStore ¶ added in v0.3.0
type ZanzibarStore struct {
// contains filtered or unexported fields
}
ZanzibarStore is a Zanzibar store with its id and caller token already bound. Get one from Client.Store. It is safe for concurrent use if the underlying Client is; it holds no mutable state of its own.
func (*ZanzibarStore) As ¶ added in v0.3.0
func (s *ZanzibarStore) As(callerToken string) *ZanzibarStore
As returns a copy of this store bound to a different caller token — for per-request user tokens over a long-lived store handle.
func (*ZanzibarStore) Can ¶ added in v0.3.0
func (s *ZanzibarStore) Can(ctx context.Context, subjectType, subjectID, permission, objectType, objectID string) (bool, error)
Can reports whether subject may perform permission on object. This is the call you will make most.
ok, err := store.Can(ctx, "user", "alice", "view", "doc", "123")
FAILS CLOSED: any error returns false. Check the error — a false with a non-nil error means "could not decide", which is not the same as a denial and usually deserves a 503 rather than a 403.
func (*ZanzibarStore) CanAll ¶ added in v0.3.0
func (s *ZanzibarStore) CanAll(ctx context.Context, checks ...CheckPermissionRequest) (bool, error)
CanAll reports whether EVERY check is allowed, in one round trip.
FAILS CLOSED twice over: an error is false, and so is an empty checks slice — "nothing was asked" is not "everything is permitted".
func (*ZanzibarStore) CanAny ¶ added in v0.3.0
func (s *ZanzibarStore) CanAny(ctx context.Context, checks ...CheckPermissionRequest) (bool, error)
CanAny reports whether AT LEAST ONE check is allowed, in one round trip. An empty checks slice is false.
func (*ZanzibarStore) CanID ¶ added in v0.3.0
func (s *ZanzibarStore) CanID(ctx context.Context, subject, permission, object string) (bool, error)
CanID is Can for callers who already hold combined "type:id" strings.
func (*ZanzibarStore) ID ¶ added in v0.3.0
func (s *ZanzibarStore) ID() string
ID returns the bound store id.
func (*ZanzibarStore) Relate ¶ added in v0.3.0
func (s *ZanzibarStore) Relate(ctx context.Context, subjectType, subjectID, relation, objectType, objectID string) error
Relate writes one relationship tuple: subject #relation@ object.
err := store.Relate(ctx, "user", "alice", "owner", "doc", "123")
Idempotent server-side: writing a tuple that already exists is not an error.
func (*ZanzibarStore) RelateID ¶ added in v0.3.0
func (s *ZanzibarStore) RelateID(ctx context.Context, subject, relation, object string) error
RelateID is Relate for callers holding combined "type:id" strings.
func (*ZanzibarStore) RelateUntil ¶ added in v0.8.0
func (s *ZanzibarStore) RelateUntil(ctx context.Context, subject, relation, object string, expires time.Time) error
RelateUntil writes a relationship that expires.
Time-boxing exists on the wire and had no ergonomic path, so callers granted permanent access for temporary needs — a permissions leak created by the SDK's own surface rather than by anything the customer did wrong.
func (*ZanzibarStore) RelationsOn ¶ added in v0.3.0
func (s *ZanzibarStore) RelationsOn(ctx context.Context, objectType, objectID, relation string) ([]RelationshipEntry, error)
RelationsOn lists the stored relationship tuples on one object — what is actually written down, as opposed to what the check engine derives from it. Pass relation "" for all relations.
func (*ZanzibarStore) Unrelate ¶ added in v0.3.0
func (s *ZanzibarStore) Unrelate(ctx context.Context, subjectType, subjectID, relation, objectType, objectID string) error
Unrelate removes one relationship tuple. Removing an absent tuple is not an error.
func (*ZanzibarStore) UnrelateID ¶ added in v0.3.0
func (s *ZanzibarStore) UnrelateID(ctx context.Context, subject, relation, object string) error
UnrelateID is Unrelate for callers holding combined "type:id" strings.
func (*ZanzibarStore) WhatCan ¶ added in v0.3.0
func (s *ZanzibarStore) WhatCan(ctx context.Context, subject, permission, objectType string) ([]string, error)
WhatCan answers "which objects of this type may this subject act on?" — the query behind every filtered index page ("show me the documents alice can view").
Returns combined ids as the server gives them. A nil error with an empty slice means the subject may act on nothing, which is a real answer.
func (*ZanzibarStore) WhoCan ¶ added in v0.3.0
WhoCan answers "who may act on this object?" — the query behind every sharing dialog. Group memberships are expanded to their members by default.
func (*ZanzibarStore) Why ¶ added in v0.3.0
func (s *ZanzibarStore) Why(ctx context.Context, subject, permission, object string) (*CheckPermissionResponse, error)
Why is CanID with the server's explanation attached — the reason and the relationship path it followed. Use it when a decision is surprising and you want to see how the server got there, rather than guessing from the tuples.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package authclienttest provides test doubles for the ab0t Auth Service client.
|
Package authclienttest provides test doubles for the ab0t Auth Service client. |
|
Package authmw is net/http middleware that gates routes on the ab0t Auth Service.
|
Package authmw is net/http middleware that gates routes on the ab0t Auth Service. |
|
cmd
|
|
|
ab0t-auth
command
Command ab0t-auth is a command-line client for the ab0t Auth Service.
|
Command ab0t-auth is a command-line client for the ab0t Auth Service. |
|
examples
|
|
|
gate
command
Command gate is a complete, runnable example of the thing this SDK is mostly used for: putting an ab0t Auth Service check in front of an HTTP route.
|
Command gate is a complete, runnable example of the thing this SDK is mostly used for: putting an ab0t Auth Service check in front of an HTTP route. |