schema

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package schema provides Ent schema definitions for CoreForge 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 added in v0.2.0

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 added in v0.2.0

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

Annotations of the Agent.

func (Agent) Edges added in v0.2.0

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

Edges of the Agent.

func (Agent) Fields added in v0.2.0

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

Fields of the Agent.

func (Agent) Indexes added in v0.2.0

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

Indexes of the Agent.

func (Agent) Mixin added in v0.2.0

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

Mixin of the Agent.

type Application added in v0.2.0

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 added in v0.2.0

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

Annotations of the Application.

func (Application) Edges added in v0.2.0

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

Edges of the Application.

func (Application) Fields added in v0.2.0

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

Fields of the Application.

func (Application) Indexes added in v0.2.0

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

Indexes of the Application.

func (Application) Mixin added in v0.2.0

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 added in v0.2.0

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 added in v0.2.0

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

Annotations of the Credential.

func (Credential) Edges added in v0.2.0

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

Edges of the Credential.

func (Credential) Fields added in v0.2.0

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

Fields of the Credential.

func (Credential) Indexes added in v0.2.0

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

Indexes of the Credential.

type Human added in v0.2.0

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 added in v0.2.0

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

Annotations of the Human.

func (Human) Edges added in v0.2.0

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

Edges of the Human.

func (Human) Fields added in v0.2.0

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

Fields of the Human.

func (Human) Indexes added in v0.2.0

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

Indexes of the Human.

func (Human) Mixin added in v0.2.0

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

Mixin of the Human.

type Invite added in v0.2.0

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 added in v0.2.0

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

Annotations of the Invite.

func (Invite) Edges added in v0.2.0

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

Edges of the Invite.

func (Invite) Fields added in v0.2.0

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

Fields of the Invite.

func (Invite) Indexes added in v0.2.0

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

Indexes of the Invite.

func (Invite) Mixin added in v0.2.0

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

Mixin of the Invite.

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 added in v0.2.0

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 added in v0.2.0

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

Annotations of the Principal.

func (Principal) Edges added in v0.2.0

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

Edges of the Principal.

func (Principal) Fields added in v0.2.0

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

Fields of the Principal.

func (Principal) Indexes added in v0.2.0

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

Indexes of the Principal.

func (Principal) Mixin added in v0.2.0

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

Mixin of the Principal.

type PrincipalMembership added in v0.2.0

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 added in v0.2.0

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

Annotations of the PrincipalMembership.

func (PrincipalMembership) Edges added in v0.2.0

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

Edges of the PrincipalMembership.

func (PrincipalMembership) Fields added in v0.2.0

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

Fields of the PrincipalMembership.

func (PrincipalMembership) Indexes added in v0.2.0

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

Indexes of the PrincipalMembership.

func (PrincipalMembership) Mixin added in v0.2.0

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

Mixin of the PrincipalMembership.

type PrincipalToken added in v0.2.0

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 added in v0.2.0

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

Annotations of the PrincipalToken.

func (PrincipalToken) Edges added in v0.2.0

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

Edges of the PrincipalToken.

func (PrincipalToken) Fields added in v0.2.0

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

Fields of the PrincipalToken.

func (PrincipalToken) Indexes added in v0.2.0

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 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 added in v0.2.0

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 added in v0.2.0

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

Annotations of the ServicePrincipal.

func (ServicePrincipal) Edges added in v0.2.0

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

Edges of the ServicePrincipal.

func (ServicePrincipal) Fields added in v0.2.0

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

Fields of the ServicePrincipal.

func (ServicePrincipal) Indexes added in v0.2.0

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

Indexes of the ServicePrincipal.

func (ServicePrincipal) Mixin added in v0.2.0

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

Mixin of the ServicePrincipal.

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