gateway

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: 21 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTransactionManager

func NewTransactionManager(db *gorm.DB, rff RepositoryFactoryFunc) (service.TransactionManager, error)

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"`
	// Role             string `json:"role"`
	TokenType string `json:"tokenType"`
	jwt.StandardClaims
}

type AuthTokenManager

type AuthTokenManager struct {
	SigningKey     []byte
	SigningMethod  jwt.SigningMethod
	TokenTimeout   time.Duration
	RefreshTimeout time.Duration
}

func NewAuthTokenManager

func NewAuthTokenManager(signingKey []byte, signingMethod jwt.SigningMethod, tokenTimeout, refreshTimeout time.Duration) *AuthTokenManager

func (*AuthTokenManager) CreateTokenSet

func (*AuthTokenManager) GetUserInfo

func (m *AuthTokenManager) GetUserInfo(ctx context.Context, tokenString string) (*service.AppUserInfo, error)

func (*AuthTokenManager) RefreshToken

func (m *AuthTokenManager) RefreshToken(ctx context.Context, tokenString string) (string, error)

type GoogleAuthClient

type GoogleAuthClient struct {
	HTTPClient   HTTPClient
	ClientID     string
	ClientSecret string
	RedirectURI  string
	GrantType    string
}

func NewGoogleAuthClient

func NewGoogleAuthClient(httpClient HTTPClient, clientID, clientSecret, redirectURI string) *GoogleAuthClient

func (*GoogleAuthClient) RetrieveAccessToken

func (c *GoogleAuthClient) RetrieveAccessToken(ctx context.Context, code string) (*domain.AuthTokenSet, error)

func (*GoogleAuthClient) RetrieveUserInfo

func (c *GoogleAuthClient) RetrieveUserInfo(ctx context.Context, googleAuthResponse *domain.AuthTokenSet) (*domain.UserInfo, error)

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

type RepositoryFactory

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

func NewRepositoryFactory

func NewRepositoryFactory(ctx context.Context, dialect rslibgateway.DialectRDBMS, driverName string, db *gorm.DB, location *time.Location) (*RepositoryFactory, error)

func (*RepositoryFactory) NewRedstartRepositoryFactory

func (f *RepositoryFactory) NewRedstartRepositoryFactory(ctx context.Context) (rsuserservice.RepositoryFactory, error)

func (*RepositoryFactory) NewStateRepository

func (f *RepositoryFactory) NewStateRepository(ctx context.Context) (service.StateRepository, error)

type RepositoryFactoryFunc

type RepositoryFactoryFunc func(ctx context.Context, db *gorm.DB) (service.RepositoryFactory, error)

type StateRepository

type StateRepository struct {
}

func NewStateRepository

func NewStateRepository(ctx context.Context) (*StateRepository, error)

func (*StateRepository) DoesStateExists

func (r *StateRepository) DoesStateExists(ctx context.Context, state string) (bool, error)

func (*StateRepository) GenerateState

func (r *StateRepository) GenerateState(ctx context.Context) (string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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