schema

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package schema provides Ent schema definitions for SystemForge identity management.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIKey

type APIKey struct {
	ent.Schema
}

APIKey holds the schema definition for the APIKey entity. API keys provide server-to-server authentication without user interaction.

func (APIKey) Annotations

func (APIKey) Annotations() []schema.Annotation

Annotations of the APIKey.

func (APIKey) Edges

func (APIKey) Edges() []ent.Edge

Edges of the APIKey.

func (APIKey) Fields

func (APIKey) Fields() []ent.Field

Fields of the APIKey.

func (APIKey) Indexes

func (APIKey) Indexes() []ent.Index

Indexes of the APIKey.

func (APIKey) Mixin

func (APIKey) Mixin() []ent.Mixin

Mixin of the APIKey.

type Agent

type Agent struct {
	ent.Schema
}

Agent holds the schema definition for AI agent-specific principal data. This is a one-to-one extension of Principal where type="agent".

func (Agent) Annotations

func (Agent) Annotations() []schema.Annotation

Annotations of the Agent.

func (Agent) Edges

func (Agent) Edges() []ent.Edge

Edges of the Agent.

func (Agent) Fields

func (Agent) Fields() []ent.Field

Fields of the Agent.

func (Agent) Indexes

func (Agent) Indexes() []ent.Index

Indexes of the Agent.

func (Agent) Mixin

func (Agent) Mixin() []ent.Mixin

Mixin of the Agent.

type Application

type Application struct {
	ent.Schema
}

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.

func (Application) Edges

func (Application) Edges() []ent.Edge

Edges of the Application.

func (Application) Fields

func (Application) Fields() []ent.Field

Fields of the Application.

func (Application) Indexes

func (Application) Indexes() []ent.Index

Indexes of the Application.

func (Application) Mixin

func (Application) Mixin() []ent.Mixin

Mixin of the Application.

type BaseMixin

type BaseMixin struct {
	mixin.Schema
}

BaseMixin combines UUID and Timestamp mixins for convenience.

func (BaseMixin) Fields

func (BaseMixin) Fields() []ent.Field

Fields returns combined UUID and timestamp fields.

type Credential

type Credential struct {
	ent.Schema
}

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.

func (Credential) Edges

func (Credential) Edges() []ent.Edge

Edges of the Credential.

func (Credential) Fields

func (Credential) Fields() []ent.Field

Fields of the Credential.

func (Credential) Indexes

func (Credential) Indexes() []ent.Index

Indexes of the Credential.

type Human

type Human struct {
	ent.Schema
}

Human holds the schema definition for human-specific principal data. This is a one-to-one extension of Principal where type="human".

func (Human) Annotations

func (Human) Annotations() []schema.Annotation

Annotations of the Human.

func (Human) Edges

func (Human) Edges() []ent.Edge

Edges of the Human.

func (Human) Fields

func (Human) Fields() []ent.Field

Fields of the Human.

func (Human) Indexes

func (Human) Indexes() []ent.Index

Indexes of the Human.

func (Human) Mixin

func (Human) Mixin() []ent.Mixin

Mixin of the Human.

type Invite

type Invite struct {
	ent.Schema
}

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.

func (Invite) Edges

func (Invite) Edges() []ent.Edge

Edges of the Invite.

func (Invite) Fields

func (Invite) Fields() []ent.Field

Fields of the Invite.

func (Invite) Indexes

func (Invite) Indexes() []ent.Index

Indexes of the Invite.

func (Invite) Mixin

func (Invite) Mixin() []ent.Mixin

Mixin of the Invite.

type License

type License struct {
	ent.Schema
}

License holds the schema definition for a marketplace license entitlement.

func (License) Annotations

func (License) Annotations() []schema.Annotation

Annotations of the License.

func (License) Edges

func (License) Edges() []ent.Edge

Edges of the License.

func (License) Fields

func (License) Fields() []ent.Field

Fields of the License.

func (License) Indexes

func (License) Indexes() []ent.Index

Indexes of the License.

func (License) Mixin

func (License) Mixin() []ent.Mixin

Mixin of the License.

type Listing

type Listing struct {
	ent.Schema
}

Listing holds the schema definition for a marketplace product listing.

func (Listing) Annotations

func (Listing) Annotations() []schema.Annotation

Annotations of the Listing.

func (Listing) Edges

func (Listing) Edges() []ent.Edge

Edges of the Listing.

func (Listing) Fields

func (Listing) Fields() []ent.Field

Fields of the Listing.

func (Listing) Indexes

func (Listing) Indexes() []ent.Index

Indexes of the Listing.

func (Listing) Mixin

func (Listing) Mixin() []ent.Mixin

Mixin of the Listing.

type Membership

type Membership struct {
	ent.Schema
}

Membership holds the schema definition for the Membership entity. It represents a user's membership in an organization with a specific role.

func (Membership) Annotations

func (Membership) Annotations() []schema.Annotation

Annotations of the Membership.

func (Membership) Edges

func (Membership) Edges() []ent.Edge

Edges of the Membership.

func (Membership) Fields

func (Membership) Fields() []ent.Field

Fields of the Membership.

func (Membership) Indexes

func (Membership) Indexes() []ent.Index

Indexes of the Membership.

func (Membership) Mixin

func (Membership) Mixin() []ent.Mixin

Mixin of the Membership.

type OAuthAccount

type OAuthAccount struct {
	ent.Schema
}

OAuthAccount holds the schema definition for the OAuthAccount entity. It stores OAuth provider connections for users, supporting multiple providers per user.

func (OAuthAccount) Annotations

func (OAuthAccount) Annotations() []schema.Annotation

Annotations of the OAuthAccount.

func (OAuthAccount) Edges

func (OAuthAccount) Edges() []ent.Edge

Edges of the OAuthAccount.

func (OAuthAccount) Fields

func (OAuthAccount) Fields() []ent.Field

Fields of the OAuthAccount.

func (OAuthAccount) Indexes

func (OAuthAccount) Indexes() []ent.Index

Indexes of the OAuthAccount.

func (OAuthAccount) Mixin

func (OAuthAccount) Mixin() []ent.Mixin

Mixin of the OAuthAccount.

type OAuthApp

type OAuthApp struct {
	ent.Schema
}

OAuthApp holds the schema definition for OAuth 2.0 applications/clients.

func (OAuthApp) Annotations

func (OAuthApp) Annotations() []schema.Annotation

Annotations of the OAuthApp.

func (OAuthApp) Edges

func (OAuthApp) Edges() []ent.Edge

Edges of the OAuthApp.

func (OAuthApp) Fields

func (OAuthApp) Fields() []ent.Field

Fields of the OAuthApp.

func (OAuthApp) Indexes

func (OAuthApp) Indexes() []ent.Index

Indexes of the OAuthApp.

type OAuthAppSecret

type OAuthAppSecret struct {
	ent.Schema
}

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) Edges

func (OAuthAppSecret) Edges() []ent.Edge

Edges 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

type OAuthAuthCode struct {
	ent.Schema
}

OAuthAuthCode holds OAuth 2.0 authorization codes.

func (OAuthAuthCode) Annotations

func (OAuthAuthCode) Annotations() []schema.Annotation

Annotations of the OAuthAuthCode.

func (OAuthAuthCode) Edges

func (OAuthAuthCode) Edges() []ent.Edge

Edges 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

type OAuthConsent struct {
	ent.Schema
}

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) Edges

func (OAuthConsent) Edges() []ent.Edge

Edges of the OAuthConsent.

func (OAuthConsent) Fields

func (OAuthConsent) Fields() []ent.Field

Fields of the OAuthConsent.

func (OAuthConsent) Indexes

func (OAuthConsent) Indexes() []ent.Index

Indexes of the OAuthConsent.

type OAuthToken

type OAuthToken struct {
	ent.Schema
}

OAuthToken holds OAuth 2.0 access and refresh tokens.

func (OAuthToken) Annotations

func (OAuthToken) Annotations() []schema.Annotation

Annotations of the OAuthToken.

func (OAuthToken) Edges

func (OAuthToken) Edges() []ent.Edge

Edges of the OAuthToken.

func (OAuthToken) Fields

func (OAuthToken) Fields() []ent.Field

Fields of the OAuthToken.

func (OAuthToken) Indexes

func (OAuthToken) Indexes() []ent.Index

Indexes of the OAuthToken.

type Organization

type Organization struct {
	ent.Schema
}

Organization holds the schema definition for the Organization entity.

func (Organization) Annotations

func (Organization) Annotations() []schema.Annotation

Annotations of the Organization.

func (Organization) Edges

func (Organization) Edges() []ent.Edge

Edges of the Organization.

func (Organization) Fields

func (Organization) Fields() []ent.Field

Fields of the Organization.

func (Organization) Indexes

func (Organization) Indexes() []ent.Index

Indexes of the Organization.

func (Organization) Mixin

func (Organization) Mixin() []ent.Mixin

Mixin of the Organization.

type Principal

type Principal struct {
	ent.Schema
}

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.

func (Principal) Edges

func (Principal) Edges() []ent.Edge

Edges of the Principal.

func (Principal) Fields

func (Principal) Fields() []ent.Field

Fields of the Principal.

func (Principal) Indexes

func (Principal) Indexes() []ent.Index

Indexes of the Principal.

func (Principal) Mixin

func (Principal) Mixin() []ent.Mixin

Mixin of the Principal.

type PrincipalMembership

type PrincipalMembership struct {
	ent.Schema
}

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

type PrincipalToken struct {
	ent.Schema
}

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) Edges

func (PrincipalToken) Edges() []ent.Edge

Edges 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 RefreshToken

type RefreshToken struct {
	ent.Schema
}

RefreshToken holds the schema definition for the RefreshToken entity. It tracks JWT refresh tokens for token rotation and revocation.

func (RefreshToken) Annotations

func (RefreshToken) Annotations() []schema.Annotation

Annotations of the RefreshToken.

func (RefreshToken) Edges

func (RefreshToken) Edges() []ent.Edge

Edges of the RefreshToken.

func (RefreshToken) Fields

func (RefreshToken) Fields() []ent.Field

Fields of the RefreshToken.

func (RefreshToken) Indexes

func (RefreshToken) Indexes() []ent.Index

Indexes of the RefreshToken.

func (RefreshToken) Mixin

func (RefreshToken) Mixin() []ent.Mixin

Mixin of the RefreshToken.

type SeatAssignment

type SeatAssignment struct {
	ent.Schema
}

SeatAssignment holds the schema definition for a license seat assignment.

func (SeatAssignment) Annotations

func (SeatAssignment) Annotations() []schema.Annotation

Annotations of the SeatAssignment.

func (SeatAssignment) Edges

func (SeatAssignment) Edges() []ent.Edge

Edges 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 ServiceAccount

type ServiceAccount struct {
	ent.Schema
}

ServiceAccount represents a non-human identity for server-to-server OAuth. Used with JWT Bearer grant (RFC 7523) for machine-to-machine authentication.

func (ServiceAccount) Annotations

func (ServiceAccount) Annotations() []schema.Annotation

Annotations of the ServiceAccount.

func (ServiceAccount) Edges

func (ServiceAccount) Edges() []ent.Edge

Edges of the ServiceAccount.

func (ServiceAccount) Fields

func (ServiceAccount) Fields() []ent.Field

Fields of the ServiceAccount.

func (ServiceAccount) Indexes

func (ServiceAccount) Indexes() []ent.Index

Indexes of the ServiceAccount.

type ServiceAccountKeyPair

type ServiceAccountKeyPair struct {
	ent.Schema
}

ServiceAccountKeyPair holds RSA/EC key pairs for JWT Bearer authentication. Multiple keys can exist for rotation purposes.

func (ServiceAccountKeyPair) Annotations

func (ServiceAccountKeyPair) Annotations() []schema.Annotation

Annotations of the ServiceAccountKeyPair.

func (ServiceAccountKeyPair) Edges

func (ServiceAccountKeyPair) Edges() []ent.Edge

Edges of the ServiceAccountKeyPair.

func (ServiceAccountKeyPair) Fields

func (ServiceAccountKeyPair) Fields() []ent.Field

Fields of the ServiceAccountKeyPair.

func (ServiceAccountKeyPair) Indexes

func (ServiceAccountKeyPair) Indexes() []ent.Index

Indexes of the ServiceAccountKeyPair.

type ServicePrincipal

type ServicePrincipal struct {
	ent.Schema
}

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 Subscription

type Subscription struct {
	ent.Schema
}

Subscription holds the schema definition for a platform subscription.

func (Subscription) Annotations

func (Subscription) Annotations() []schema.Annotation

Annotations of the Subscription.

func (Subscription) Edges

func (Subscription) Edges() []ent.Edge

Edges of the Subscription.

func (Subscription) Fields

func (Subscription) Fields() []ent.Field

Fields of the Subscription.

func (Subscription) Indexes

func (Subscription) Indexes() []ent.Index

Indexes of the Subscription.

func (Subscription) Mixin

func (Subscription) Mixin() []ent.Mixin

Mixin of the Subscription.

type TimestampMixin

type TimestampMixin struct {
	mixin.Schema
}

TimestampMixin provides created_at and updated_at timestamp fields.

func (TimestampMixin) Fields

func (TimestampMixin) Fields() []ent.Field

Fields returns the timestamp fields.

type UUIDMixin

type UUIDMixin struct {
	mixin.Schema
}

UUIDMixin provides a UUID primary key field.

func (UUIDMixin) Fields

func (UUIDMixin) Fields() []ent.Field

Fields returns the UUID id field.

type User

type User struct {
	ent.Schema
}

User holds the schema definition for the User entity.

func (User) Annotations

func (User) Annotations() []schema.Annotation

Annotations of the User.

func (User) Edges

func (User) Edges() []ent.Edge

Edges of the User.

func (User) Fields

func (User) Fields() []ent.Field

Fields of the User.

func (User) Indexes

func (User) Indexes() []ent.Index

Indexes of the User.

func (User) Mixin

func (User) Mixin() []ent.Mixin

Mixin of the User.

Jump to

Keyboard shortcuts

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