Documentation
¶
Index ¶
- type Module
- func (m *Module) Configure(cfg coreConfig.Config) error
- func (m *Module) Dependencies() []string
- func (m *Module) GetAuthManager() backends.AuthenticationManager
- func (m *Module) GetAuthMiddleware() interfaces.AuthMiddleware
- func (m *Module) GetAuthorizationManager() *authorization.AuthorizationManager
- func (m *Module) GetMigrationSources(projectRoot string) []migrationRunner.Source
- func (m *Module) GetTokenIssuer() interfaces.TokenIssuer
- func (m *Module) GoogleSignin() interfaces.GoogleSignin
- func (m *Module) Initialize(ctx context.Context, db *gorm.DB, router *gin.Engine) error
- func (m *Module) Middleware() []gin.HandlerFunc
- func (m *Module) MigrationsDir() string
- func (m *Module) Name() string
- func (m *Module) Namespace() module.ModuleNamespace
- func (m *Module) NewConfig() coreConfig.Config
- func (m *Module) ProvidesMigrations() bool
- func (m *Module) Shutdown(ctx context.Context) error
- func (m *Module) Version() string
- func (m *Module) WithAuthHandler(handler interfaces.AuthHandler) *Module
- func (m *Module) WithAuthManager(manager backends.AuthenticationManager) *Module
- func (m *Module) WithAuthMiddleware(middleware interfaces.AuthMiddleware) *Module
- func (m *Module) WithAuthorizationManager(mgr *authorization.AuthorizationManager) *Module
- func (m *Module) WithConfig(cfg *config.Config) *Module
- func (m *Module) WithSocialSignupHandler(handler gin.HandlerFunc)
- func (m *Module) WithTokenIssuer(issuer interfaces.TokenIssuer) *Module
- func (m *Module) WithUserRepository(repo interfaces.UserRepository) *Module
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 (*Module) Configure ¶
func (m *Module) Configure(cfg coreConfig.Config) error
Configure configures the module
func (*Module) Dependencies ¶
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 ¶
Initialize initializes the auth module
func (*Module) Middleware ¶
func (m *Module) Middleware() []gin.HandlerFunc
Middleware returns the module's middleware
func (*Module) MigrationsDir ¶
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 (*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 ¶
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