usecase

package
v0.0.0-...-4791c18 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRBAC

func NewRBAC(txManager, nonTxManager service.TransactionManager) *rbac

Types

type AppUserClaims

type AppUserClaims struct {
	LoginID          string `json:"loginId"`
	AppUserID        int    `json:"appUserId"`
	Username         string `json:"username"`
	OrganizationID   int    `json:"organizationId"`
	OrganizationName string `json:"organizationName"`
	TokenType        string `json:"tokenType"`
	jwt.StandardClaims
}

type Authentication

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

func NewAuthentication

func NewAuthentication(transactionManager service.TransactionManager, authTokenManager service.AuthTokenManager, systemOwnerByOrganizationName SystemOwnerByOrganizationName) *Authentication

func (*Authentication) GetUserInfo

func (u *Authentication) GetUserInfo(ctx context.Context, bearerToken string) (*rsuserdomain.AppUserModel, error)

func (*Authentication) RefreshToken

func (u *Authentication) RefreshToken(ctx context.Context, refreshToken string) (string, error)

type GoogleAuthClient

type GoogleAuthClient interface {
	RetrieveAccessToken(ctx context.Context, code string) (*domain.AuthTokenSet, error)
	RetrieveUserInfo(ctx context.Context, googleAuthResponse *domain.AuthTokenSet) (*domain.UserInfo, error)
}

type GoogleAuthResponse

type GoogleAuthResponse struct {
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
}

type GoogleUserInfo

type GoogleUserInfo struct {
	Email string `json:"email"`
	Name  string `json:"name"`
}

type GoogleUserUsecase

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

func NewGoogleUser

func NewGoogleUser(txManager, nonTxManager service.TransactionManager, authTokenManager service.AuthTokenManager, googleAuthClient GoogleAuthClient) *GoogleUserUsecase

func (*GoogleUserUsecase) Authorize

func (u *GoogleUserUsecase) Authorize(ctx context.Context, state, code, organizationName string) (*domain.AuthTokenSet, error)

func (*GoogleUserUsecase) GenerateState

func (u *GoogleUserUsecase) GenerateState(ctx context.Context) (string, error)

type PasswordUsecae

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

func NewPassword

func NewPassword(txManager, nonTxManager service.TransactionManager, authTokenManager service.AuthTokenManager) *PasswordUsecae

func (*PasswordUsecae) Authenticate

func (u *PasswordUsecae) Authenticate(ctx context.Context, loginID, password, organizationName string) (*domain.AuthTokenSet, error)

type SystemOwnerByOrganizationName

type SystemOwnerByOrganizationName interface {
	Get(ctx context.Context, rf service.RepositoryFactory, organizationName string) (*rsuserservice.SystemOwner, error)
}

type TokenSet

type TokenSet struct {
	AccessToken  string
	RefreshToken string
}

Jump to

Keyboard shortcuts

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