Documentation
¶
Index ¶
- type AuthnApplicationCapabilities
- type AuthnModule
- func (m *AuthnModule) ApplicationCapabilities() AuthnApplicationCapabilities
- func (m *AuthnModule) CacheFamilyInspectors() []cachegovernance.FamilyInspector
- func (m *AuthnModule) Cleanup(ctx context.Context) error
- func (m *AuthnModule) InitializeWithDeps(deps AuthnModuleDeps) error
- func (m *AuthnModule) RuntimeCapabilities() AuthnRuntimeCapabilities
- func (m *AuthnModule) SessionManager() sessionDomain.Manager
- type AuthnModuleDeps
- type AuthnRuntimeCapabilities
- type AuthzApplicationCapabilities
- type AuthzModule
- type AuthzModuleDeps
- type AuthzRuntimeHealthReporter
- type IDPApplicationCapabilities
- type IDPModule
- func (m *IDPModule) ApplicationCapabilities() IDPApplicationCapabilities
- func (m *IDPModule) CacheFamilyInspectors() []cachegovernance.FamilyInspector
- func (m *IDPModule) InitializeWithDeps(deps IDPModuleDeps) error
- func (m *IDPModule) Repository() wechatappDomain.Repository
- func (m *IDPModule) SecretVault() wechatappDomain.SecretVault
- func (m *IDPModule) WechatAuthProvider() wechatapiPort.AuthProvider
- type IDPModuleDeps
- type KeyRotationScheduler
- type RoleNameReader
- type SuggestApplicationCapabilities
- type SuggestModule
- func (m *SuggestModule) ApplicationCapabilities() SuggestApplicationCapabilities
- func (m *SuggestModule) CheckHealth() error
- func (m *SuggestModule) Cleanup() error
- func (m *SuggestModule) InitializeWithDeps(deps SuggestModuleDeps) error
- func (m *SuggestModule) IsInitialized() bool
- func (m *SuggestModule) RuntimeCapabilities() SuggestRuntimeCapabilities
- type SuggestModuleDeps
- type SuggestRuntimeCapabilities
- type UserApplicationCapabilities
- type UserModule
- type UserModuleDeps
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthnApplicationCapabilities ¶
type AuthnApplicationCapabilities struct {
AccountService accountApp.AccountApplicationService
AccountOnboarder onboardingApp.AccountOnboarder
LoginService login.LoginApplicationService
LoginPreparationService loginprep.LoginPreparationService
TokenService token.TokenApplicationService
SessionService sessionApp.SessionApplicationService
KeyManagementApp *jwksApp.KeyManagementAppService
KeyPublishApp *jwksApp.KeyPublishAppService
KeyRotationApp *jwksApp.KeyRotationAppService
}
AuthnApplicationCapabilities contains authn application collaborators used by transports without exposing concrete transport objects from assembler.
type AuthnModule ¶
type AuthnModule struct {
// contains filtered or unexported fields
}
AuthnModule 认证模块
func (*AuthnModule) ApplicationCapabilities ¶
func (m *AuthnModule) ApplicationCapabilities() AuthnApplicationCapabilities
func (*AuthnModule) CacheFamilyInspectors ¶
func (m *AuthnModule) CacheFamilyInspectors() []cachegovernance.FamilyInspector
CacheFamilyInspectors 返回认证模块暴露的缓存族状态读取器。
func (*AuthnModule) InitializeWithDeps ¶
func (m *AuthnModule) InitializeWithDeps(deps AuthnModuleDeps) error
InitializeWithDeps initializes the module through typed dependencies.
func (*AuthnModule) RuntimeCapabilities ¶
func (m *AuthnModule) RuntimeCapabilities() AuthnRuntimeCapabilities
func (*AuthnModule) SessionManager ¶
func (m *AuthnModule) SessionManager() sessionDomain.Manager
SessionManager 返回认证模块创建的会话管理器。
type AuthnModuleDeps ¶
type AuthnModuleDeps struct {
DB *gorm.DB
RedisClient *redis.Client
PasswordHasher authentication.PasswordHasher
IDPModule *IDPModule
EventBus messaging.EventBus
EventPublisher event.Publisher
AppMode string
Auth apiserveroptions.AuthOptions
JWKS apiserveroptions.JWKSOptions
IDPOptions apiserveroptions.IDPOptions
SMS apiserveroptions.SMSOptions
}
AuthnModuleDeps contains the runtime dependencies required to assemble the authentication module.
type AuthnRuntimeCapabilities ¶
type AuthnRuntimeCapabilities struct {
RotationScheduler KeyRotationScheduler
}
type AuthzApplicationCapabilities ¶
type AuthzApplicationCapabilities struct {
ResourceCatalog authzResourceApp.Catalog
ResourceDirectory authzResourceApp.Directory
RoleCatalog authzRoleApp.Catalog
RoleDirectory authzRoleApp.Directory
PermissionCommands authzPolicyApp.PermissionCommands
PermissionReader authzPolicyApp.PermissionReader
RoleBindingCommands authzRolebindingApp.Commands
RoleBindingDirectory authzRolebindingApp.Directory
RouteAuthorization authn.RouteAuthorizationRuntime
RuntimeHealth AuthzRuntimeHealthReporter
AuthorizationChecker *authzAuthorizationApp.Checker
AuthorizationSnapshotReader *authzAuthorizationApp.SnapshotReader
}
type AuthzModule ¶
type AuthzModule struct {
// contains filtered or unexported fields
}
AuthzModule 授权模块
func (*AuthzModule) ApplicationCapabilities ¶
func (m *AuthzModule) ApplicationCapabilities() AuthzApplicationCapabilities
func (*AuthzModule) InitializeWithDeps ¶
func (m *AuthzModule) InitializeWithDeps(deps AuthzModuleDeps) error
InitializeWithDeps 初始化授权模块。
func (*AuthzModule) RoleNameReader ¶
func (m *AuthzModule) RoleNameReader() RoleNameReader
type AuthzModuleDeps ¶
type IDPApplicationCapabilities ¶
type IDPApplicationCapabilities struct {
WechatAppService wechatapp.WechatAppApplicationService
WechatAppCredentialService wechatapp.WechatAppCredentialApplicationService
WechatAppTokenService wechatapp.WechatAppTokenApplicationService
WechatAppRepository wechatappDomain.Repository
SecretVault wechatappDomain.SecretVault
}
type IDPModule ¶
type IDPModule struct {
// 应用服务(对外暴露)
WechatAppService wechatapp.WechatAppApplicationService
WechatAppCredentialService wechatapp.WechatAppCredentialApplicationService
WechatAppTokenService wechatapp.WechatAppTokenApplicationService
// contains filtered or unexported fields
}
IDPModule IDP 模块(Identity Provider) 负责组装 IDP 相关的所有组件
架构说明: - 直接在容器侧管理基础设施组件,无需中间聚合器 - 遵循六边形架构:Infrastructure -> Domain -> Application -> Interface
职责: - 微信应用管理(HTTP 接口) - 提供基础设施服务(供 authn 模块使用) - 认证功能由 authn 模块统一提供
func (*IDPModule) ApplicationCapabilities ¶
func (m *IDPModule) ApplicationCapabilities() IDPApplicationCapabilities
func (*IDPModule) CacheFamilyInspectors ¶
func (m *IDPModule) CacheFamilyInspectors() []cachegovernance.FamilyInspector
CacheFamilyInspectors 返回 IDP 模块暴露的缓存族状态读取器。
func (*IDPModule) InitializeWithDeps ¶
func (m *IDPModule) InitializeWithDeps(deps IDPModuleDeps) error
InitializeWithDeps 初始化 IDP 模块。
func (*IDPModule) Repository ¶
func (m *IDPModule) Repository() wechatappDomain.Repository
Repository 返回微信应用查询能力(供 authn 模块读取配置)
func (*IDPModule) SecretVault ¶
func (m *IDPModule) SecretVault() wechatappDomain.SecretVault
SecretVault 返回密钥托管能力(供 authn 模块解密 AppSecret)
func (*IDPModule) WechatAuthProvider ¶
func (m *IDPModule) WechatAuthProvider() wechatapiPort.AuthProvider
WechatAuthProvider 返回微信认证基础能力(调用微信 code2Session 等接口)
type IDPModuleDeps ¶
type KeyRotationScheduler ¶
type KeyRotationScheduler interface {
Start(ctx context.Context) error
Stop() error
IsRunning() bool
TriggerNow(ctx context.Context) error
}
KeyRotationScheduler is the runtime capability exposed by the authn module.
type RoleNameReader ¶
type SuggestApplicationCapabilities ¶
type SuggestApplicationCapabilities struct {
Service appsuggest.ProfileSuggestor
}
type SuggestModule ¶
type SuggestModule struct {
// contains filtered or unexported fields
}
SuggestModule 联想搜索模块
func (*SuggestModule) ApplicationCapabilities ¶
func (m *SuggestModule) ApplicationCapabilities() SuggestApplicationCapabilities
func (*SuggestModule) CheckHealth ¶
func (m *SuggestModule) CheckHealth() error
CheckHealth 检查是否已加载数据
func (*SuggestModule) InitializeWithDeps ¶
func (m *SuggestModule) InitializeWithDeps(deps SuggestModuleDeps) error
InitializeWithDeps 初始化联想模块。
func (*SuggestModule) IsInitialized ¶
func (m *SuggestModule) IsInitialized() bool
func (*SuggestModule) RuntimeCapabilities ¶
func (m *SuggestModule) RuntimeCapabilities() SuggestRuntimeCapabilities
type SuggestModuleDeps ¶
type SuggestModuleDeps struct {
DB *gorm.DB
Config appsuggest.Config
}
type SuggestRuntimeCapabilities ¶
type SuggestRuntimeCapabilities struct {
Cleanup func() error
}
type UserApplicationCapabilities ¶
type UserApplicationCapabilities struct {
UserCreator appuser.Creator
UserEditor appuser.Editor
UserStatusChanger appuser.StatusChanger
UserDirectory appuser.Directory
ProfileDirectory appprofile.Directory
MyProfiles appprofile.MyProfiles
ProfileLinkCommands appprofilelink.Commands
ProfileLinkDirectory appprofilelink.Directory
MyProfileLinks appprofilelink.MyProfileLinks
RoleNames RoleNameReader
}
type UserModule ¶
type UserModule struct {
// contains filtered or unexported fields
}
UserModule 用户模块 负责组装用户相关的所有组件
func (*UserModule) ApplicationCapabilities ¶
func (m *UserModule) ApplicationCapabilities() UserApplicationCapabilities
func (*UserModule) InitializeWithDeps ¶
func (m *UserModule) InitializeWithDeps(deps UserModuleDeps) error
InitializeWithDeps 初始化用户模块。
type UserModuleDeps ¶
type UserModuleDeps struct {
DB *gorm.DB
RoleNames RoleNameReader
SessionManager sessiondomain.Manager
}