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. |
|
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. |