Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientService ¶
type ClientService interface {
Create(ctx context.Context, tenantID string, req domain.ClientCreateReq) (*domain.ClientResp, error)
Get(ctx context.Context, tenantID string, clientID string) (*domain.ClientResp, error)
List(ctx context.Context, tenantID string) ([]*domain.ClientResp, error)
GetClient(ctx context.Context, tenantID string, clientID string) (*domain.Client, error)
}
func NewClientService ¶
func NewClientService(repo repository.ClientRepository) ClientService
type MembershipService ¶
type MembershipService interface {
Create(ctx context.Context, tenantID string, req domain.MembershipCreateReq) (*domain.MembershipResp, error)
Remove(ctx context.Context, tenantID string, req domain.MembershipRemoveReq) (*domain.MembershipRemoveResp, error)
ListTenantIDsByUser(ctx context.Context, userID string) ([]string, error)
}
func NewMembershipService ¶
func NewMembershipService(userRepo repository.UserRepository, repo repository.MembershipRepository) MembershipService
type RoleService ¶
type RoleService interface {
Create(ctx context.Context, tenantID string, req domain.RoleCreateReq) (*domain.RoleResp, error)
List(ctx context.Context, tenantID string) ([]*domain.RoleResp, error)
ResolvePermissions(ctx context.Context, tenantID string, roles []string) ([]string, error)
}
func NewRoleService ¶
func NewRoleService(repo repository.RoleRepository) RoleService
type TenantService ¶
type TenantService interface {
Create(ctx context.Context, req domain.TenantCreateReq) (*domain.TenantResp, error)
Get(ctx context.Context, tenantID string) (*domain.TenantResp, error)
EnsureDefault(ctx context.Context) (*domain.TenantResp, error)
}
func NewTenantService ¶
func NewTenantService(repo repository.TenantRepository) TenantService
type UserService ¶
type UserService interface {
SignUp(ctx context.Context, req domain.SignUpReq) (*domain.SignUpResp, error)
SignIn(ctx context.Context, req domain.SignInReq) (*domain.SignInResp, error)
SignInWithOobCode(ctx context.Context, req domain.SignInWithOobCodeReq) (*domain.SignInResp, error)
Lookup(ctx context.Context, req domain.LookupReq) (*domain.LookupResp, error)
TokenExchange(ctx context.Context, req domain.TokenExchangeReq) (*domain.TokenExchangeResp, error)
JWKS(ctx context.Context) (map[string]any, error)
ValidateAccessToken(ctx context.Context, tokenString string, issuer string, audience string) (jwt.MapClaims, error)
SetStatus(ctx context.Context, email string, status string) (*domain.StatusResp, error)
RevokeTokens(ctx context.Context, email string, tenantID string, scope string) (*domain.RevokeResp, error)
UpdateUser(ctx context.Context, req domain.UpdateReq) (*domain.UpdateResp, error)
DeleteUser(ctx context.Context, req domain.DeleteReq) error
SendOob(ctx context.Context, req domain.SendOobReq) (*domain.SendOobResp, error)
SendOobForTenant(ctx context.Context, tenantID string, req domain.SendOobReq) (*domain.SendOobTenantResp, error)
ResetPassword(ctx context.Context, req domain.ResetPwdReq) error
GetAllUsers(ctx context.Context) ([]*domain.User, error)
}
UserService exposes all account-management operations used by the controllers.
func NewUserService ¶
func NewUserService(r repository.UserRepository, membershipRepo repository.MembershipRepository, roleSvc RoleService, clientSvc ClientService, jwtSecret string, issuerBaseURL string, defaultAudience string, jwksPrivateKey string, jwksKeyID string) UserService
NewUserService builds a service instance that signs JWTs with the provided secret.
Click to show internal directories.
Click to hide internal directories.