plugins

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2025 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.
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.
sso

Jump to

Keyboard shortcuts

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