entschema

package
v0.5.4 Latest Latest
Warning

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

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

README

Ent Schema Mixins

entschema exposes OAuth and PAT Ent mixins for consumers that already own their Ent schema package.

Example:

package schema

import (
	"entgo.io/ent"
	kitschema "github.com/haakco/mcp-kit/entschema"
)

type OAuthClient struct{ ent.Schema }

func (OAuthClient) Mixin() []ent.Mixin {
	return []ent.Mixin{
		kitschema.OAuthClient{},
	}
}

The mixins intentionally include only kit-owned OAuth/PAT columns and indexes. Consumers should compose their own timestamp, UUID, soft-delete, and edge conventions alongside these mixins.

OAuthAuthorizationCode, OAuthAccessToken, and OAuthRefreshToken currently share the same discriminator-backed field shape so the first skills-mcp migration can stay schema-compatible while consumers can choose separate schema types later.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OAuthAccessToken

type OAuthAccessToken struct {
	// contains filtered or unexported fields
}

OAuthAccessToken provides fields for access-token session rows.

func (OAuthAccessToken) Fields

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

Fields returns session persistence fields.

func (OAuthAccessToken) Indexes

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

Indexes returns session indexes.

type OAuthAuthorizationCode

type OAuthAuthorizationCode struct {
	// contains filtered or unexported fields
}

OAuthAuthorizationCode provides fields for authorization-code session rows.

func (OAuthAuthorizationCode) Fields

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

Fields returns session persistence fields.

func (OAuthAuthorizationCode) Indexes

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

Indexes returns session indexes.

type OAuthClient

type OAuthClient struct {
	mixin.Schema
}

OAuthClient provides fields for OAuth dynamic clients.

func (OAuthClient) Fields

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

Fields returns the OAuth client persistence fields.

func (OAuthClient) Indexes

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

Indexes returns OAuth client indexes.

type OAuthRefreshToken

type OAuthRefreshToken struct {
	// contains filtered or unexported fields
}

OAuthRefreshToken provides fields for refresh-token session rows.

func (OAuthRefreshToken) Fields

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

Fields returns session persistence fields.

func (OAuthRefreshToken) Indexes

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

Indexes returns session indexes.

type OAuthSigningKey

type OAuthSigningKey struct {
	mixin.Schema
}

OAuthSigningKey provides fields for JWT signing key rotation.

func (OAuthSigningKey) Fields

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

Fields returns signing key persistence fields.

func (OAuthSigningKey) Indexes

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

Indexes returns signing key indexes.

type PersonalAccessToken

type PersonalAccessToken struct {
	mixin.Schema
}

PersonalAccessToken provides fields for hashed PAT storage.

func (PersonalAccessToken) Fields

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

Fields returns PAT persistence fields.

func (PersonalAccessToken) Indexes

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

Indexes returns PAT indexes.

Jump to

Keyboard shortcuts

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