Documentation
¶
Overview ¶
Package schema provides Ent schema definitions for SystemForge identity management.
Index ¶
- type AccessChange
- type Agent
- type AppRole
- type Application
- type BaseMixin
- type ClientAssertionJTI
- type ConsentGrant
- type Credential
- type ExternalIdentity
- type Human
- type Invite
- type License
- type Listing
- type LoginSession
- type LoginState
- type ManagerClaim
- type ManagerInvite
- type ManagerRelationship
- type OAuthApp
- type OAuthAppSecret
- type OAuthAuthCode
- type OAuthConsent
- type OAuthToken
- type Organization
- type Principal
- type PrincipalMembership
- type PrincipalToken
- type ResourceGrant
- type SeatAssignment
- type ServicePrincipal
- type SlugReservation
- type Subscription
- type TimeOrderedUUIDMixin
- type TimestampMixin
- type UUIDMixin
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessChange ¶ added in v0.14.0
AccessChange holds the schema definition for a record that a principal's access was reduced or ended (ADR-010). Relying parties refuse tokens issued before a recorded change, so the record outlives the change only for as long as such a token could exist; rows older than that are pruned (accesschange.Prune).
The principal and organization are plain identifiers, not edges: a row is written in the transaction that deletes or deactivates the thing it describes, and must survive it.
func (AccessChange) Annotations ¶ added in v0.14.0
func (AccessChange) Annotations() []schema.Annotation
Annotations of the AccessChange.
func (AccessChange) Fields ¶ added in v0.14.0
func (AccessChange) Fields() []ent.Field
Fields of the AccessChange.
func (AccessChange) Indexes ¶ added in v0.14.0
func (AccessChange) Indexes() []ent.Index
Indexes of the AccessChange.
func (AccessChange) Mixin ¶ added in v0.14.0
func (AccessChange) Mixin() []ent.Mixin
Mixin of the AccessChange.
type Agent ¶
Agent holds the schema definition for AI agent-specific principal data. This is a one-to-one extension of Principal where type="agent".
type AppRole ¶ added in v0.14.0
AppRole holds the schema definition for a principal's role in one application of an organization. The role is one of the roles the application declares in its authz.AppVocabulary; the service validates it, so the column is free text and new application roles need no migration.
func (AppRole) Annotations ¶ added in v0.14.0
func (AppRole) Annotations() []schema.Annotation
Annotations of the AppRole.
type Application ¶
Application holds the schema definition for OAuth application-specific principal data. This is a one-to-one extension of Principal where type="application".
func (Application) Annotations ¶
func (Application) Annotations() []schema.Annotation
Annotations of the Application.
type ClientAssertionJTI ¶ added in v0.14.0
ClientAssertionJTI records the JWT IDs of client assertions that have been used, so a signed assertion cannot be replayed before it expires (RFC 7523 section 3, as required by Fosite's client manager).
func (ClientAssertionJTI) Annotations ¶ added in v0.14.0
func (ClientAssertionJTI) Annotations() []schema.Annotation
Annotations of the ClientAssertionJTI.
func (ClientAssertionJTI) Fields ¶ added in v0.14.0
func (ClientAssertionJTI) Fields() []ent.Field
Fields of the ClientAssertionJTI.
func (ClientAssertionJTI) Indexes ¶ added in v0.14.0
func (ClientAssertionJTI) Indexes() []ent.Index
Indexes of the ClientAssertionJTI.
func (ClientAssertionJTI) Mixin ¶ added in v0.14.0
func (ClientAssertionJTI) Mixin() []ent.Mixin
Mixin of the ClientAssertionJTI.
type ConsentGrant ¶ added in v0.12.0
ConsentGrant records one scope a principal granted to an OAuth client on the SystemAuth consent page. One row per (principal, client, scope) keeps concurrent grants race-free without read-modify-write.
func (ConsentGrant) Annotations ¶ added in v0.12.0
func (ConsentGrant) Annotations() []schema.Annotation
Annotations of the ConsentGrant.
func (ConsentGrant) Fields ¶ added in v0.12.0
func (ConsentGrant) Fields() []ent.Field
Fields of the ConsentGrant.
func (ConsentGrant) Indexes ¶ added in v0.12.0
func (ConsentGrant) Indexes() []ent.Index
Indexes of the ConsentGrant.
type Credential ¶
Credential holds the schema definition for unified credentials. Credentials can be passwords, API keys, keypairs, WebAuthn credentials, or TOTP secrets.
func (Credential) Annotations ¶
func (Credential) Annotations() []schema.Annotation
Annotations of the Credential.
type ExternalIdentity ¶ added in v0.12.0
ExternalIdentity links a Principal to an upstream login identity (e.g. a GitHub or Google account). The (provider, subject) pair is the stable key used to find the principal on every social login; email is recorded for information and verified-email linking only.
func (ExternalIdentity) Annotations ¶ added in v0.12.0
func (ExternalIdentity) Annotations() []schema.Annotation
Annotations of the ExternalIdentity.
func (ExternalIdentity) Edges ¶ added in v0.12.0
func (ExternalIdentity) Edges() []ent.Edge
Edges of the ExternalIdentity.
func (ExternalIdentity) Fields ¶ added in v0.12.0
func (ExternalIdentity) Fields() []ent.Field
Fields of the ExternalIdentity.
func (ExternalIdentity) Indexes ¶ added in v0.12.0
func (ExternalIdentity) Indexes() []ent.Index
Indexes of the ExternalIdentity.
func (ExternalIdentity) Mixin ¶ added in v0.12.0
func (ExternalIdentity) Mixin() []ent.Mixin
Mixin of the ExternalIdentity.
type Human ¶
Human holds the schema definition for human-specific principal data. This is a one-to-one extension of Principal where type="human".
type Invite ¶
Invite holds the schema definition for organization invitations. Invites allow existing members to invite new users to join an organization.
func (Invite) Annotations ¶
func (Invite) Annotations() []schema.Annotation
Annotations of the Invite.
type License ¶
License holds the schema definition for a marketplace license entitlement.
func (License) Annotations ¶
func (License) Annotations() []schema.Annotation
Annotations of the License.
type Listing ¶
Listing holds the schema definition for a marketplace product listing.
func (Listing) Annotations ¶
func (Listing) Annotations() []schema.Annotation
Annotations of the Listing.
type LoginSession ¶ added in v0.12.0
LoginSession holds SystemAuth browser login sessions (the __Host-sf_login cookie). Only a SHA-256 hash of the opaque session token is stored.
func (LoginSession) Annotations ¶ added in v0.12.0
func (LoginSession) Annotations() []schema.Annotation
Annotations of the LoginSession.
func (LoginSession) Fields ¶ added in v0.12.0
func (LoginSession) Fields() []ent.Field
Fields of the LoginSession.
func (LoginSession) Indexes ¶ added in v0.12.0
func (LoginSession) Indexes() []ent.Index
Indexes of the LoginSession.
type LoginState ¶ added in v0.12.0
LoginState holds in-flight upstream OAuth logins started by SystemAuth social login. Rows are single-use and short-lived; only a SHA-256 hash of the OAuth state value is stored.
func (LoginState) Annotations ¶ added in v0.12.0
func (LoginState) Annotations() []schema.Annotation
Annotations of the LoginState.
func (LoginState) Fields ¶ added in v0.12.0
func (LoginState) Fields() []ent.Field
Fields of the LoginState.
func (LoginState) Indexes ¶ added in v0.12.0
func (LoginState) Indexes() []ent.Index
Indexes of the LoginState.
type ManagerClaim ¶ added in v0.14.0
ManagerClaim is a single-use code a manager issues so that a human with an email can become guardian of a managed principal (ADR-005). Claims are kept apart from credentials so a claim code can never sign anyone in.
func (ManagerClaim) Annotations ¶ added in v0.14.0
func (ManagerClaim) Annotations() []schema.Annotation
Annotations of the ManagerClaim.
func (ManagerClaim) Edges ¶ added in v0.14.0
func (ManagerClaim) Edges() []ent.Edge
Edges of the ManagerClaim.
func (ManagerClaim) Fields ¶ added in v0.14.0
func (ManagerClaim) Fields() []ent.Field
Fields of the ManagerClaim.
func (ManagerClaim) Indexes ¶ added in v0.14.0
func (ManagerClaim) Indexes() []ent.Index
Indexes of the ManagerClaim.
type ManagerInvite ¶ added in v0.14.0
ManagerInvite is a single-use invitation with which a human with a verified email offers to manage a self-managed human, who enters management only by accepting it while signed in (ADR-009). It is kept apart from organization invites, which grant membership, not authority over a person.
func (ManagerInvite) Annotations ¶ added in v0.14.0
func (ManagerInvite) Annotations() []schema.Annotation
Annotations of the ManagerInvite.
func (ManagerInvite) Fields ¶ added in v0.14.0
func (ManagerInvite) Fields() []ent.Field
Fields of the ManagerInvite.
func (ManagerInvite) Indexes ¶ added in v0.14.0
func (ManagerInvite) Indexes() []ent.Index
Indexes of the ManagerInvite.
type ManagerRelationship ¶ added in v0.14.0
ManagerRelationship records that one human principal manages another (ADR-005). A managed principal, a human without an email, always has at least one active manager, and a manager is a human with an email.
func (ManagerRelationship) Annotations ¶ added in v0.14.0
func (ManagerRelationship) Annotations() []schema.Annotation
Annotations of the ManagerRelationship.
func (ManagerRelationship) Edges ¶ added in v0.14.0
func (ManagerRelationship) Edges() []ent.Edge
Edges of the ManagerRelationship.
func (ManagerRelationship) Fields ¶ added in v0.14.0
func (ManagerRelationship) Fields() []ent.Field
Fields of the ManagerRelationship.
func (ManagerRelationship) Indexes ¶ added in v0.14.0
func (ManagerRelationship) Indexes() []ent.Index
Indexes of the ManagerRelationship.
func (ManagerRelationship) Mixin ¶ added in v0.14.0
func (ManagerRelationship) Mixin() []ent.Mixin
Mixin of the ManagerRelationship.
type OAuthApp ¶
OAuthApp holds the schema definition for OAuth 2.0 applications/clients.
func (OAuthApp) Annotations ¶
func (OAuthApp) Annotations() []schema.Annotation
Annotations of the OAuthApp.
type OAuthAppSecret ¶
OAuthAppSecret holds client secrets for OAuth apps. Multiple secrets can exist for rotation purposes.
func (OAuthAppSecret) Annotations ¶
func (OAuthAppSecret) Annotations() []schema.Annotation
Annotations of the OAuthAppSecret.
func (OAuthAppSecret) Fields ¶
func (OAuthAppSecret) Fields() []ent.Field
Fields of the OAuthAppSecret.
func (OAuthAppSecret) Indexes ¶
func (OAuthAppSecret) Indexes() []ent.Index
Indexes of the OAuthAppSecret.
type OAuthAuthCode ¶
OAuthAuthCode holds OAuth 2.0 authorization codes.
func (OAuthAuthCode) Annotations ¶
func (OAuthAuthCode) Annotations() []schema.Annotation
Annotations of the OAuthAuthCode.
func (OAuthAuthCode) Fields ¶
func (OAuthAuthCode) Fields() []ent.Field
Fields of the OAuthAuthCode.
func (OAuthAuthCode) Indexes ¶
func (OAuthAuthCode) Indexes() []ent.Index
Indexes of the OAuthAuthCode.
type OAuthConsent ¶
OAuthConsent tracks user consent for OAuth apps. First-party apps skip consent; third-party apps require explicit approval.
func (OAuthConsent) Annotations ¶
func (OAuthConsent) Annotations() []schema.Annotation
Annotations of the OAuthConsent.
func (OAuthConsent) Indexes ¶
func (OAuthConsent) Indexes() []ent.Index
Indexes of the OAuthConsent.
type OAuthToken ¶
OAuthToken holds OAuth 2.0 access and refresh tokens.
func (OAuthToken) Annotations ¶
func (OAuthToken) Annotations() []schema.Annotation
Annotations of the OAuthToken.
type Organization ¶
Organization holds the schema definition for the Organization entity.
func (Organization) Annotations ¶
func (Organization) Annotations() []schema.Annotation
Annotations of the Organization.
func (Organization) Indexes ¶
func (Organization) Indexes() []ent.Index
Indexes of the Organization.
type Principal ¶
Principal holds the schema definition for the Principal entity. Principal is the unified identity root representing any type of actor: human, application, agent, or service.
func (Principal) Annotations ¶
func (Principal) Annotations() []schema.Annotation
Annotations of the Principal.
type PrincipalMembership ¶
PrincipalMembership holds the schema definition for principal-organization memberships. This extends the existing Membership concept to support all principal types.
func (PrincipalMembership) Annotations ¶
func (PrincipalMembership) Annotations() []schema.Annotation
Annotations of the PrincipalMembership.
func (PrincipalMembership) Edges ¶
func (PrincipalMembership) Edges() []ent.Edge
Edges of the PrincipalMembership.
func (PrincipalMembership) Fields ¶
func (PrincipalMembership) Fields() []ent.Field
Fields of the PrincipalMembership.
func (PrincipalMembership) Indexes ¶
func (PrincipalMembership) Indexes() []ent.Index
Indexes of the PrincipalMembership.
func (PrincipalMembership) Mixin ¶
func (PrincipalMembership) Mixin() []ent.Mixin
Mixin of the PrincipalMembership.
type PrincipalToken ¶
PrincipalToken holds OAuth 2.0 access and refresh tokens for principals. This replaces OAuthToken with principal-centric token management.
func (PrincipalToken) Annotations ¶
func (PrincipalToken) Annotations() []schema.Annotation
Annotations of the PrincipalToken.
func (PrincipalToken) Fields ¶
func (PrincipalToken) Fields() []ent.Field
Fields of the PrincipalToken.
func (PrincipalToken) Indexes ¶
func (PrincipalToken) Indexes() []ent.Index
Indexes of the PrincipalToken.
type ResourceGrant ¶ added in v0.14.0
ResourceGrant holds the schema definition for a principal's role on one resource of an organization (ADR-008). A grant gives access to that resource without organization-wide access: a principal who is not a member of the organization holds a "collaborator" membership while it has any grant there.
The resource type is the application's definition name, "{app}_{type}", and the resource identifier is the application's own string, so the substrate stores grants for resources it knows nothing else about. The role is one of the resource roles viewer, contributor and maintainer (authz.ResourceRoles); the service validates it, so the column is free text and a new resource role needs no migration.
func (ResourceGrant) Annotations ¶ added in v0.14.0
func (ResourceGrant) Annotations() []schema.Annotation
Annotations of the ResourceGrant.
func (ResourceGrant) Edges ¶ added in v0.14.0
func (ResourceGrant) Edges() []ent.Edge
Edges of the ResourceGrant.
func (ResourceGrant) Fields ¶ added in v0.14.0
func (ResourceGrant) Fields() []ent.Field
Fields of the ResourceGrant.
func (ResourceGrant) Indexes ¶ added in v0.14.0
func (ResourceGrant) Indexes() []ent.Index
Indexes of the ResourceGrant.
func (ResourceGrant) Mixin ¶ added in v0.14.0
func (ResourceGrant) Mixin() []ent.Mixin
Mixin of the ResourceGrant.
type SeatAssignment ¶
SeatAssignment holds the schema definition for a license seat assignment.
func (SeatAssignment) Annotations ¶
func (SeatAssignment) Annotations() []schema.Annotation
Annotations of the SeatAssignment.
func (SeatAssignment) Fields ¶
func (SeatAssignment) Fields() []ent.Field
Fields of the SeatAssignment.
func (SeatAssignment) Indexes ¶
func (SeatAssignment) Indexes() []ent.Index
Indexes of the SeatAssignment.
func (SeatAssignment) Mixin ¶
func (SeatAssignment) Mixin() []ent.Mixin
Mixin of the SeatAssignment.
type ServicePrincipal ¶
ServicePrincipal holds the schema definition for backend service-specific principal data. This is a one-to-one extension of Principal where type="service".
func (ServicePrincipal) Annotations ¶
func (ServicePrincipal) Annotations() []schema.Annotation
Annotations of the ServicePrincipal.
func (ServicePrincipal) Edges ¶
func (ServicePrincipal) Edges() []ent.Edge
Edges of the ServicePrincipal.
func (ServicePrincipal) Fields ¶
func (ServicePrincipal) Fields() []ent.Field
Fields of the ServicePrincipal.
func (ServicePrincipal) Indexes ¶
func (ServicePrincipal) Indexes() []ent.Index
Indexes of the ServicePrincipal.
func (ServicePrincipal) Mixin ¶
func (ServicePrincipal) Mixin() []ent.Mixin
Mixin of the ServicePrincipal.
type SlugReservation ¶ added in v0.14.0
SlugReservation holds the schema definition for a slug an organization gave up. For the cooling-off period the slug resolves to the organization that released it, and only the principal who released it (or an organization that principal owns) may take it again (ADR-006).
func (SlugReservation) Annotations ¶ added in v0.14.0
func (SlugReservation) Annotations() []schema.Annotation
Annotations of the SlugReservation.
func (SlugReservation) Edges ¶ added in v0.14.0
func (SlugReservation) Edges() []ent.Edge
Edges of the SlugReservation.
func (SlugReservation) Fields ¶ added in v0.14.0
func (SlugReservation) Fields() []ent.Field
Fields of the SlugReservation.
func (SlugReservation) Indexes ¶ added in v0.14.0
func (SlugReservation) Indexes() []ent.Index
Indexes of the SlugReservation.
func (SlugReservation) Mixin ¶ added in v0.14.0
func (SlugReservation) Mixin() []ent.Mixin
Mixin of the SlugReservation.
type Subscription ¶
Subscription holds the schema definition for a platform subscription.
func (Subscription) Annotations ¶
func (Subscription) Annotations() []schema.Annotation
Annotations of the Subscription.
func (Subscription) Indexes ¶
func (Subscription) Indexes() []ent.Index
Indexes of the Subscription.
type TimeOrderedUUIDMixin ¶ added in v0.14.0
TimeOrderedUUIDMixin provides a UUIDv7 primary key field. Unlike UUIDMixin's random v4 IDs, v7 IDs sort in creation order, so ordering by (timestamp, id) is deterministic when timestamps tie, as they do on platforms with a coarse clock such as Windows. Use it on append-only records that are read back in the order they were written.
func (TimeOrderedUUIDMixin) Fields ¶ added in v0.14.0
func (TimeOrderedUUIDMixin) Fields() []ent.Field
Fields returns the UUIDv7 id field.
type TimestampMixin ¶
TimestampMixin provides created_at and updated_at timestamp fields.
func (TimestampMixin) Fields ¶
func (TimestampMixin) Fields() []ent.Field
Fields returns the timestamp fields.
Source Files
¶
- access_change.go
- agent.go
- app_role.go
- application.go
- client_assertion_jti.go
- consent_grant.go
- credential.go
- external_identity.go
- human.go
- invite.go
- license.go
- listing.go
- login_session.go
- login_state.go
- manager_claim.go
- manager_invite.go
- manager_relationship.go
- mixin.go
- oauth_app.go
- oauth_app_secret.go
- oauth_auth_code.go
- oauth_consent.go
- oauth_token.go
- organization.go
- principal.go
- principal_membership.go
- principal_token.go
- resource_grant.go
- seat_assignment.go
- service_principal.go
- slug_reservation.go
- subscription.go