auth

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: MIT Imports: 22 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Module

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

Module implements the NebularCore module interface for authentication

func New

func New(eventBus event.Bus) *Module

New creates a new authentication module

func (*Module) Configure

func (m *Module) Configure(cfg coreConfig.Config) error

Configure configures the module

func (*Module) Dependencies

func (m *Module) Dependencies() []string

Dependencies returns the module dependencies

func (*Module) GetAuthManager

func (m *Module) GetAuthManager() backends.AuthenticationManager

GetAuthManager returns the authentication manager

func (*Module) GetAuthMiddleware

func (m *Module) GetAuthMiddleware() interfaces.AuthMiddleware

GetAuthMiddleware returns the authentication middleware

func (*Module) GetAuthorizationManager

func (m *Module) GetAuthorizationManager() *authorization.AuthorizationManager

GetAuthorizationManager returns the shared authorization manager — host apps should reuse this instance (rather than constructing their own via authorization.NewAuthorizationManager) so role/permission state and the casbin enforcer stay single-instance across the whole process.

func (*Module) GetMigrationSources

func (m *Module) GetMigrationSources(projectRoot string) []migrationRunner.Source

func (*Module) GetTokenIssuer

func (m *Module) GetTokenIssuer() interfaces.TokenIssuer

GetTokenIssuer returns the token issuer

func (*Module) GoogleSignin

func (m *Module) GoogleSignin() interfaces.GoogleSignin

func (*Module) Initialize

func (m *Module) Initialize(
	ctx context.Context,
	db *gorm.DB,
	router *gin.Engine,
) error

Initialize initializes the auth module

func (*Module) Middleware

func (m *Module) Middleware() []gin.HandlerFunc

Middleware returns the module's middleware

func (*Module) MigrationsDir

func (m *Module) MigrationsDir() string

func (*Module) Name

func (m *Module) Name() string

Name returns the module name

func (*Module) Namespace

func (m *Module) Namespace() module.ModuleNamespace

Namespace implements module.Module.

func (*Module) NewConfig

func (m *Module) NewConfig() coreConfig.Config

NewConfig returns a new configuration instance

func (*Module) ProvidesMigrations

func (m *Module) ProvidesMigrations() bool

func (*Module) Shutdown

func (m *Module) Shutdown(ctx context.Context) error

Shutdown performs cleanup when the module is shutting down

func (*Module) Version

func (m *Module) Version() string

Version returns the module version

func (*Module) WithAuthHandler

func (m *Module) WithAuthHandler(handler interfaces.AuthHandler) *Module

WithAuthHandler sets the authentication handler

func (*Module) WithAuthManager

func (m *Module) WithAuthManager(manager backends.AuthenticationManager) *Module

WithAuthManager sets the authentication manager

func (*Module) WithAuthMiddleware

func (m *Module) WithAuthMiddleware(middleware interfaces.AuthMiddleware) *Module

WithAuthMiddleware sets the authentication middleware

func (*Module) WithAuthorizationManager

func (m *Module) WithAuthorizationManager(mgr *authorization.AuthorizationManager) *Module

WithAuthorizationManager sets the authorization manager (e.g. to inject a fake in tests)

func (*Module) WithConfig

func (m *Module) WithConfig(cfg *config.Config) *Module

WithConfig sets the module configuration

func (*Module) WithSocialSignupHandler

func (m *Module) WithSocialSignupHandler(handler gin.HandlerFunc)

func (*Module) WithTokenIssuer

func (m *Module) WithTokenIssuer(issuer interfaces.TokenIssuer) *Module

WithTokenIssuer sets the token issuer

func (*Module) WithUserRepository

func (m *Module) WithUserRepository(repo interfaces.UserRepository) *Module

WithUserRepository sets the user repository

Jump to

Keyboard shortcuts

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