Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBasicAuthNService ¶
func NewBasicAuthNService() *basicAuthNService
NewBasicAuthNService returns a naive, stateless implementation of AuthNService.
Types ¶
type IAuthNService ¶
type IAuthNService interface {
// Handlers of the events
HandlePolicyUpdatedEvent(ctx context.Context, method, sub, rtype, rid, act string) error
// auth service methods
GenToken(ctx context.Context, accnt dto.LoginRequest) dto.LoginResponse
// account service methods
CreateAccount(ctx context.Context, accnt dto.CreateAccountRequest) dto.CreateAccountResponse
ListAccount(ctx context.Context, aids []uint, qp *dto.BasicQueryParam) dto.ListAccountResponse
DeleteAccount(ctx context.Context, aid uint) (err error)
}
func New ¶
func New(logger *cl.CustomLogger, mws []Middleware, SvcConfs ...SvcConf) IAuthNService
New returns a Authn service implementation with all of the expected middlewares wired in.
type Middleware ¶
type Middleware func(IAuthNService) IAuthNService
Middleware represents service middleware type
func NewAuthzMW ¶
func NewAuthzMW(pe svcpe.PolicyEnforcer) Middleware
type SvcConf ¶
type SvcConf func(*basicAuthNService) error
func WithNATSEncodedConn ¶
func WithNATSEncodedConn(nc *nats.EncodedConn) SvcConf
func WithPolicyStorage ¶
func WithPolicyStorage(ps svcpe.PolicyStorage) SvcConf
func WithRepo ¶
func WithRepo(r repo.UserRepository) SvcConf
Click to show internal directories.
Click to hide internal directories.