plugins

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HookFunc

type HookFunc = core.HookFunc

HookFunc is a function that runs before/after an operation

type HookRegistry

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

HookRegistry manages hooks for various operations

func NewHookRegistry

func NewHookRegistry() *HookRegistry

NewHookRegistry creates a new hook registry

func (*HookRegistry) RegisterAfter

func (r *HookRegistry) RegisterAfter(operation string, hook HookFunc)

RegisterAfter registers an after hook

func (*HookRegistry) RegisterBefore

func (r *HookRegistry) RegisterBefore(operation string, hook HookFunc)

RegisterBefore registers a before hook

func (*HookRegistry) RunAfter

func (r *HookRegistry) RunAfter(ctx context.Context, operation string, data interface{}) error

RunAfter runs all after hooks for an operation

func (*HookRegistry) RunBefore

func (r *HookRegistry) RunBefore(ctx context.Context, operation string, data interface{}) error

RunBefore runs all before hooks for an operation

type Plugin

type Plugin = core.Plugin

Plugin defines the interface for authentication plugins

Plugins receive the Auth instance during Init, which provides access to: - Database: auth.GetDB() - Service Registry: auth.GetServiceRegistry() - Forge App: auth.GetForgeApp() - DI Container: auth.GetForgeApp().Container()

Plugins can resolve services from the DI container using the helper functions in the authsome package (e.g., authsome.ResolveUserService, authsome.ResolveAuditService)

type PluginRegistry

type PluginRegistry = core.PluginRegistry

func NewRegistry

func NewRegistry() PluginRegistry

NewRegistry creates a new plugin registry

type PluginWithDependencies

type PluginWithDependencies = core.PluginWithDependencies

PluginWithDependencies is an optional interface that plugins can implement to declare their dependencies. Plugins with dependencies will be automatically initialized after their dependencies using topological sort.

Example:

func (p *DashboardPlugin) Dependencies() []string {
    return []string{"multiapp"} // Dashboard requires multiapp plugin
}

type PluginWithRoles

type PluginWithRoles = core.PluginWithRoles

PluginWithRoles is an optional interface that plugins can implement to register roles in the role bootstrap system. Roles registered here will be automatically bootstrapped to the platform organization during server startup.

Example:

func (p *MyPlugin) RegisterRoles(registry *rbac.RoleRegistry) error {
    return registry.RegisterRole(&rbac.RoleDefinition{
        Name:        "custom_role",
        Description: "Custom Role",
        Permissions: []string{"view on custom_resource"},
    })
}

type Registry

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

Registry manages registered plugins

func (*Registry) Get

func (r *Registry) Get(id string) (Plugin, bool)

Get retrieves a plugin by ID

func (*Registry) List

func (r *Registry) List() []Plugin

List returns all registered plugins in registration order

func (*Registry) ListSorted

func (r *Registry) ListSorted() ([]Plugin, error)

ListSorted returns all registered plugins sorted by dependencies using topological sort Plugins with dependencies will be placed after their dependencies Returns an error if circular dependencies are detected or if a dependency is missing

func (*Registry) Register

func (r *Registry) Register(p Plugin) error

Register registers a plugin

func (*Registry) ValidateDependencies

func (r *Registry) ValidateDependencies() error

ValidateDependencies checks if all plugin dependencies are satisfied Returns an error describing any issues found

Directories

Path Synopsis
Package admin provides cross-cutting administrative operations for the AuthSome platform.
Package admin provides cross-cutting administrative operations for the AuthSome platform.
cms
Package cms provides a content management system plugin for AuthSome.
Package cms provides a content management system plugin for AuthSome.
core
Package core provides core types and utilities for the CMS plugin.
Package core provides core types and utilities for the CMS plugin.
handlers
Package handlers provides HTTP handlers for the CMS plugin.
Package handlers provides HTTP handlers for the CMS plugin.
pages
Package pages provides gomponent-based page templates for the CMS dashboard.
Package pages provides gomponent-based page templates for the CMS dashboard.
query
Package query provides a query language parser and builder for the CMS plugin.
Package query provides a query language parser and builder for the CMS plugin.
repository
Package repository implements the data access layer for the CMS plugin.
Package repository implements the data access layer for the CMS plugin.
schema
Package schema defines the database schema for the CMS plugin.
Package schema defines the database schema for the CMS plugin.
service
Package service implements the business logic layer for the CMS plugin.
Package service implements the business logic layer for the CMS plugin.
enterprise
stepup
Package stepup provides context-aware step-up authentication for AuthSome.
Package stepup provides context-aware step-up authentication for AuthSome.
Package passkey provides WebAuthn/FIDO2 passkey authentication.
Package passkey provides WebAuthn/FIDO2 passkey authentication.
Package secrets provides the secrets management plugin for AuthSome.
Package secrets provides the secrets management plugin for AuthSome.
core
Package core provides core types and utilities for the secrets plugin.
Package core provides core types and utilities for the secrets plugin.
schema
Package schema defines the database schema for the secrets plugin.
Package schema defines the database schema for the secrets plugin.
sso
Package subscription provides a comprehensive SaaS subscription and billing plugin for AuthSome.
Package subscription provides a comprehensive SaaS subscription and billing plugin for AuthSome.
core
Package core defines the core domain types for the subscription plugin.
Package core defines the core domain types for the subscription plugin.
errors
Package errors defines domain errors for the subscription plugin.
Package errors defines domain errors for the subscription plugin.
handlers
Package handlers provides HTTP handlers for the subscription plugin.
Package handlers provides HTTP handlers for the subscription plugin.
internal/hooks
Package hooks provides subscription-specific hook types and registry.
Package hooks provides subscription-specific hook types and registry.
migrations
Package migrations provides migration utilities for the subscription plugin.
Package migrations provides migration utilities for the subscription plugin.
providers
Package providers defines the payment provider abstraction for the subscription plugin.
Package providers defines the payment provider abstraction for the subscription plugin.
providers/mock
Package mock provides a mock payment provider for testing.
Package mock provides a mock payment provider for testing.
providers/paddle
Package paddle provides a stub implementation of the PaymentProvider interface for Paddle.
Package paddle provides a stub implementation of the PaymentProvider interface for Paddle.
providers/paypal
Package paypal provides a stub implementation of the PaymentProvider interface for PayPal.
Package paypal provides a stub implementation of the PaymentProvider interface for PayPal.
providers/stripe
Package stripe provides Stripe payment provider implementation.
Package stripe provides Stripe payment provider implementation.
providers/types
Package types defines shared types for payment providers.
Package types defines shared types for payment providers.
repository
Package repository provides data access interfaces and implementations for the subscription plugin.
Package repository provides data access interfaces and implementations for the subscription plugin.
schema
Package schema defines the database models for the subscription plugin.
Package schema defines the database models for the subscription plugin.
service
Package service provides business logic services for the subscription plugin.
Package service provides business logic services for the subscription plugin.
ui
Package ui provides Pine UI components for the subscription plugin dashboard
Package ui provides Pine UI components for the subscription plugin dashboard

Jump to

Keyboard shortcuts

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