Documentation
¶
Index ¶
- type HookFunc
- type HookRegistry
- func (r *HookRegistry) RegisterAfter(operation string, hook HookFunc)
- func (r *HookRegistry) RegisterBefore(operation string, hook HookFunc)
- func (r *HookRegistry) RunAfter(ctx context.Context, operation string, data interface{}) error
- func (r *HookRegistry) RunBefore(ctx context.Context, operation string, data interface{}) error
- type Plugin
- type PluginRegistry
- type PluginWithDependencies
- type PluginWithRoles
- type Registry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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
type 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
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) ListSorted ¶
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) ValidateDependencies ¶
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. |
|
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. |
|
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 |