service

package
v0.0.0-...-aec1c34 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2021 License: MIT Imports: 18 Imported by: 0

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

Jump to

Keyboard shortcuts

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