handler

package
v0.0.0-...-df3562f Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitRouter

func InitRouter(ctx context.Context, parentRouterGroup gin.IRouter, initPublicRouterFunc []InitRouterGroupFunc, initPrivateRouterFunc []InitRouterGroupFunc, corsConfig cors.Config, debugConfig *libconfig.DebugConfig, appName string) error

Types

type AuthHandler

type AuthHandler struct {
	// contains filtered or unexported fields
}

func NewAuthHandler

func NewAuthHandler(authenticationUsecase AuthenticationUsecase) *AuthHandler

func (*AuthHandler) GetUserInfo

func (h *AuthHandler) GetUserInfo(c *gin.Context)

func (*AuthHandler) RefreshToken

func (h *AuthHandler) RefreshToken(c *gin.Context)

type AuthenticationUsecase

type AuthenticationUsecase interface {
	GetUserInfo(ctx context.Context, bearerToken string) (*rsuserdomain.AppUserModel, error)
	RefreshToken(ctx context.Context, refreshToken string) (string, error)
}

type GoogleUserHandler

type GoogleUserHandler struct {
	// contains filtered or unexported fields
}

func NewGoogleAuthHandler

func NewGoogleAuthHandler(googleUserUsecase GoogleUserUsecase) *GoogleUserHandler

func (*GoogleUserHandler) Authorize

func (h *GoogleUserHandler) Authorize(c *gin.Context)

func (*GoogleUserHandler) GenerateState

func (h *GoogleUserHandler) GenerateState(c *gin.Context)

type GoogleUserUsecase

type GoogleUserUsecase interface {
	GenerateState(context.Context) (string, error)
	Authorize(ctx context.Context, state, code, organizationName string) (*domain.AuthTokenSet, error)
}

type InitRouterGroupFunc

type InitRouterGroupFunc func(parentRouterGroup gin.IRouter, middleware ...gin.HandlerFunc) error

func NewInitAuthRouterFunc

func NewInitAuthRouterFunc(authenticationUsecase AuthenticationUsecase) InitRouterGroupFunc

func NewInitGoogleRouterFunc

func NewInitGoogleRouterFunc(googleUserUsecase GoogleUserUsecase) InitRouterGroupFunc

func NewInitPasswordRouterFunc

func NewInitPasswordRouterFunc(password PasswordUsecaseInterface) InitRouterGroupFunc

func NewInitRBACRouterFunc

func NewInitRBACRouterFunc(rbacUsecase RBACUsecase) InitRouterGroupFunc

func NewInitTestRouterFunc

func NewInitTestRouterFunc() InitRouterGroupFunc

type PasswordAuthHandler

type PasswordAuthHandler struct {
	// contains filtered or unexported fields
}

func NewPasswordAuthHandler

func NewPasswordAuthHandler(passwordUsecase PasswordUsecaseInterface) *PasswordAuthHandler

func (*PasswordAuthHandler) Authorize

func (h *PasswordAuthHandler) Authorize(c *gin.Context)

type PasswordUsecaseInterface

type PasswordUsecaseInterface interface {
	Authenticate(ctx context.Context, loginID, password, organizationName string) (*domain.AuthTokenSet, error)
}

type RBACHandler

type RBACHandler struct {
	// contains filtered or unexported fields
}

func NewRBACHandler

func NewRBACHandler(rbacUsecase RBACUsecase) *RBACHandler

func (*RBACHandler) AddPolicyToGroup

func (h *RBACHandler) AddPolicyToGroup(c *gin.Context)

func (*RBACHandler) AddPolicyToUser

func (h *RBACHandler) AddPolicyToUser(c *gin.Context)

type RBACUsecase

type RBACUsecase interface {
	AddPolicyToUser(ctx context.Context, organizationID *domain.OrganizationID, subject domain.RBACSubject, action domain.RBACAction, object domain.RBACObject, effect domain.RBACEffect) error
}

type SystemAdminInterface

type SystemAdminInterface interface {
	AppUserID() *domain.AppUserID
	IsSystemAdmin() bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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