Documentation
¶
Index ¶
- Constants
- Variables
- func SendEmail(ctx context.Context, _awsConfig aws.Config, req *models.EmailSendRequest) error
- func SendTeamAddEmail(ctx context.Context, _awsConfig aws.Config, req *models.EmailSendRequest) error
- type APIKeyManager
- func (m *APIKeyManager) GenerateKey(payload *models.TokenClaims) (string, error)
- func (m *APIKeyManager) GenerateTenantToken(ctx context.Context, tenantID, token string) (string, error)
- func (m *APIKeyManager) Validate(ctx context.Context, key string, skipDBCheck bool) (*models.TokenClaims, error)
- func (m *APIKeyManager) ValidateAndSetContext(c echo.Context, token string) (*models.TokenClaims, error)
- type APIKeyMock
- type ApitoTokenService
- type AuthServiceInterface
- type BrankaToken
- func (t *BrankaToken) GenerateAPIKey(ctx context.Context, userID, projectID, tenantID, tokenType string, ...) (*string, error)
- func (t *BrankaToken) GenerateProjectToken(claims *models.TokenClaims, ttl uint32) (*string, error)
- func (t *BrankaToken) Validate(ctx context.Context, token string) (*models.TokenClaims, error)
- func (t *BrankaToken) ValidateAndSetContext(c echo.Context, token string) (*models.TokenClaims, error)
- type CustomResponseWriter
- type DBMock
- type JWTService
- func (s *JWTService) ChangePassword(ctx context.Context, token, old, new string) error
- func (s *JWTService) ConfirmForgetPassword(ctx context.Context, req *models.RegisterRequest) error
- func (s *JWTService) ConfirmSignup(ctx context.Context, req *models.RegisterRequest) error
- func (t *JWTService) ExchangeAndRefreshToken(ctx context.Context, user *models.SystemUser) (*models.JWTTokens, error)
- func (s *JWTService) ForgetPasswordRequest(ctx context.Context, req *models.RegisterRequest) error
- func (s *JWTService) GenerateIdToken(param *models.CommonSystemParams) (*string, error)
- func (s *JWTService) GenerateLoginAccessToken(ctx context.Context) (*string, error)
- func (s *JWTService) GenerateLoginIDToken(ctx context.Context, projectWithRoles *models.ProjectWithRoles) (*string, error)
- func (s *JWTService) GenerateLoginRefreshToken(projectWithRoles *models.ProjectWithRoles) (*string, error)
- func (s *JWTService) GenerateLoginToken(ctx context.Context, projectWithRoles *models.ProjectWithRoles) (*models.JWTTokens, error)
- func (s *JWTService) GenerateRandomString(n int) string
- func (s *JWTService) GenerateRefreshToken(param *models.CommonSystemParams, month int) (*string, error)
- func (s *JWTService) Invalidate(tokenString string) error
- func (s *JWTService) IsInBlacklist(token string) bool
- func (s *JWTService) Login(ctx context.Context, req *models.LoginRequest) (*models.JWTTokens, error)
- func (s *JWTService) Logout(ctx context.Context, token string) error
- func (s *JWTService) Signup(ctx context.Context, req *models.RegisterRequest) error
- func (s *JWTService) Validate(tokenObj bool, tokenString string) (bool, error)
- func (s *JWTService) VerifyAccessToken(ctx context.Context, token string) error
- func (s *JWTService) VerifyIDToken(ctx context.Context, token string) (*models.TokenClaims, error)
- type KeyGenMock
- type LocalAuthService
- func (l *LocalAuthService) ChangePassword(ctx context.Context, user *models.SystemUser, old, new string) (*models.SystemUser, error)
- func (l *LocalAuthService) ConfirmForgetPassword(ctx context.Context, req *models.RegisterRequest) error
- func (l *LocalAuthService) ConfirmSignup(ctx context.Context, req *models.RegisterRequest) error
- func (l *LocalAuthService) ExchangeAndRefreshToken(ctx context.Context, projectWithRoles *models.ProjectWithRoles) (*models.JWTTokens, error)
- func (l *LocalAuthService) ForgetPasswordRequest(ctx context.Context, req *models.RegisterRequest) error
- func (l *LocalAuthService) Login(ctx context.Context, req *models.LoginRequest, user *models.SystemUser, ...) (*models.JWTTokens, error)
- func (l *LocalAuthService) Logout(ctx context.Context, token string) error
- func (l *LocalAuthService) Signup(ctx context.Context, registerRequest *models.RegisterRequest) (*models.SystemUser, error)
- func (l *LocalAuthService) VerifyAccessToken(ctx context.Context, token string) error
- func (l *LocalAuthService) VerifyIDToken(ctx context.Context, token string) (*models.TokenClaims, error)
- type TokenService
Constants ¶
View Source
const (
CharSet = "UTF-8" // Character Set
)
Variables ¶
Functions ¶
func SendTeamAddEmail ¶
Types ¶
type APIKeyManager ¶
type APIKeyManager struct {
// contains filtered or unexported fields
}
APIKeyManager handles API key operations with optimized performance
func NewAPIKeyManager ¶
func NewAPIKeyManager(cfg *models.Config, driver interfaces.ApitoSystemDB) (*APIKeyManager, error)
func NewAPIKeyManagerNoDB ¶
func NewAPIKeyManagerNoDB(cfg *models.Config) (*APIKeyManager, error)
func (*APIKeyManager) GenerateKey ¶
func (m *APIKeyManager) GenerateKey(payload *models.TokenClaims) (string, error)
func (*APIKeyManager) GenerateTenantToken ¶
func (*APIKeyManager) Validate ¶
func (m *APIKeyManager) Validate(ctx context.Context, key string, skipDBCheck bool) (*models.TokenClaims, error)
func (*APIKeyManager) ValidateAndSetContext ¶
func (m *APIKeyManager) ValidateAndSetContext(c echo.Context, token string) (*models.TokenClaims, error)
type APIKeyMock ¶
type APIKeyMock struct {
Val []byte
}
func (APIKeyMock) Value ¶
func (k APIKeyMock) Value() []byte
type ApitoTokenService ¶
type ApitoTokenService struct {
Batch *goBatch.Batch[models.ProjectApiTracking]
// contains filtered or unexported fields
}
func NewApitoTokenService ¶
func NewApitoTokenService(cfg *models.Config, auth AuthServiceInterface, driver interfaces.ApitoSystemDB) (*ApitoTokenService, error)
func (*ApitoTokenService) ApitoPublicFunctionRouteHandler ¶
func (t *ApitoTokenService) ApitoPublicFunctionRouteHandler(next echo.HandlerFunc) echo.HandlerFunc
func (*ApitoTokenService) ApitoTokenHandler ¶
func (t *ApitoTokenService) ApitoTokenHandler(next echo.HandlerFunc) echo.HandlerFunc
func (*ApitoTokenService) Shutdown ¶ added in v1.1.6
func (t *ApitoTokenService) Shutdown() error
Shutdown gracefully stops the batch processor
type AuthServiceInterface ¶
type AuthServiceInterface interface {
Login(ctx context.Context, req *models.LoginRequest, user *models.SystemUser, projectWithRoles *models.ProjectWithRoles) (*models.JWTTokens, error)
Signup(ctx context.Context, req *models.RegisterRequest) (*models.SystemUser, error)
ConfirmSignup(ctx context.Context, req *models.RegisterRequest) error
ForgetPasswordRequest(ctx context.Context, req *models.RegisterRequest) error
ConfirmForgetPassword(ctx context.Context, req *models.RegisterRequest) error
ChangePassword(ctx context.Context, user *models.SystemUser, old, new string) (*models.SystemUser, error)
Logout(ctx context.Context, token string) error
VerifyIDToken(ctx context.Context, token string) (*models.TokenClaims, error)
VerifyAccessToken(ctx context.Context, token string) error
ExchangeAndRefreshToken(ctx context.Context, projectWithRoles *models.ProjectWithRoles) (*models.JWTTokens, error)
}
type BrankaToken ¶
func GetBrankaToken ¶
func GetBrankaToken(cfg *models.Config, db interfaces.ApitoSystemDB) *BrankaToken
func (*BrankaToken) GenerateAPIKey ¶
func (*BrankaToken) GenerateProjectToken ¶
func (t *BrankaToken) GenerateProjectToken(claims *models.TokenClaims, ttl uint32) (*string, error)
func (*BrankaToken) Validate ¶
func (t *BrankaToken) Validate(ctx context.Context, token string) (*models.TokenClaims, error)
func (*BrankaToken) ValidateAndSetContext ¶
func (t *BrankaToken) ValidateAndSetContext(c echo.Context, token string) (*models.TokenClaims, error)
type CustomResponseWriter ¶
type CustomResponseWriter struct {
http.ResponseWriter
Body *bytes.Buffer
Status int
}
CustomResponseWriter is a wrapper around the standard http.ResponseWriter that captures the status code and response body.
func (*CustomResponseWriter) Header ¶
func (w *CustomResponseWriter) Header() http.Header
Header returns the header map that will be sent by WriteHeader.
func (*CustomResponseWriter) Write ¶
func (w *CustomResponseWriter) Write(b []byte) (int, error)
Write captures the response body and calls the underlying Write.
func (*CustomResponseWriter) WriteHeader ¶
func (w *CustomResponseWriter) WriteHeader(code int)
WriteHeader captures the status code and calls the underlying WriteHeader.
type DBMock ¶
type DBMock struct {
typederrs.NotFoundErrCheck
ExpInsAPIKErr error
ExpAPIKBUsrIDVal api.Key
ExpAPIKsBUsrIDValErr error
RecInsAPIKUsrID string
}
func (*DBMock) APIKeyByUserIDVal ¶
type JWTService ¶
type JWTService struct {
Cfg *models.Config
PrivateKey *rsa.PrivateKey
PublicKey *rsa.PublicKey
// contains filtered or unexported fields
}
func GetJWTService ¶
func GetJWTService(cfg *models.Config) (*JWTService, error)
func GetJWTServiceWithNoSqlDb ¶
func GetJWTServiceWithNoSqlDb(cfg *models.Config) *JWTService
func GetJWTServiceWithRedis ¶
func GetJWTServiceWithRedis(cfg *models.Config, kvService interfaces.KeyValueServiceInterface) *JWTService
func (*JWTService) ChangePassword ¶
func (s *JWTService) ChangePassword(ctx context.Context, token, old, new string) error
func (*JWTService) ConfirmForgetPassword ¶
func (s *JWTService) ConfirmForgetPassword(ctx context.Context, req *models.RegisterRequest) error
func (*JWTService) ConfirmSignup ¶
func (s *JWTService) ConfirmSignup(ctx context.Context, req *models.RegisterRequest) error
func (*JWTService) ExchangeAndRefreshToken ¶
func (t *JWTService) ExchangeAndRefreshToken(ctx context.Context, user *models.SystemUser) (*models.JWTTokens, error)
no use at this time
func (*JWTService) ForgetPasswordRequest ¶
func (s *JWTService) ForgetPasswordRequest(ctx context.Context, req *models.RegisterRequest) error
func (*JWTService) GenerateIdToken ¶
func (s *JWTService) GenerateIdToken(param *models.CommonSystemParams) (*string, error)
func (*JWTService) GenerateLoginAccessToken ¶
func (s *JWTService) GenerateLoginAccessToken(ctx context.Context) (*string, error)
func (*JWTService) GenerateLoginIDToken ¶
func (s *JWTService) GenerateLoginIDToken(ctx context.Context, projectWithRoles *models.ProjectWithRoles) (*string, error)
func (*JWTService) GenerateLoginRefreshToken ¶
func (s *JWTService) GenerateLoginRefreshToken(projectWithRoles *models.ProjectWithRoles) (*string, error)
func (*JWTService) GenerateLoginToken ¶
func (s *JWTService) GenerateLoginToken(ctx context.Context, projectWithRoles *models.ProjectWithRoles) (*models.JWTTokens, error)
func (*JWTService) GenerateRandomString ¶
func (s *JWTService) GenerateRandomString(n int) string
func (*JWTService) GenerateRefreshToken ¶
func (s *JWTService) GenerateRefreshToken(param *models.CommonSystemParams, month int) (*string, error)
func (*JWTService) Invalidate ¶
func (s *JWTService) Invalidate(tokenString string) error
func (*JWTService) IsInBlacklist ¶
func (s *JWTService) IsInBlacklist(token string) bool
func (*JWTService) Login ¶
func (s *JWTService) Login(ctx context.Context, req *models.LoginRequest) (*models.JWTTokens, error)
func (*JWTService) Signup ¶
func (s *JWTService) Signup(ctx context.Context, req *models.RegisterRequest) error
func (*JWTService) Validate ¶
func (s *JWTService) Validate(tokenObj bool, tokenString string) (bool, error)
func (*JWTService) VerifyAccessToken ¶
func (s *JWTService) VerifyAccessToken(ctx context.Context, token string) error
func (*JWTService) VerifyIDToken ¶
func (s *JWTService) VerifyIDToken(ctx context.Context, token string) (*models.TokenClaims, error)
type KeyGenMock ¶
func (*KeyGenMock) SecureRandomBytes ¶
func (kg *KeyGenMock) SecureRandomBytes(length int) ([]byte, error)
type LocalAuthService ¶
type LocalAuthService struct {
TokenService *JWTService
}
func NewLocalAuthService ¶
func NewLocalAuthService(cfg *models.Config, tokenService *JWTService) (*LocalAuthService, error)
func (*LocalAuthService) ChangePassword ¶
func (l *LocalAuthService) ChangePassword(ctx context.Context, user *models.SystemUser, old, new string) (*models.SystemUser, error)
func (*LocalAuthService) ConfirmForgetPassword ¶
func (l *LocalAuthService) ConfirmForgetPassword(ctx context.Context, req *models.RegisterRequest) error
func (*LocalAuthService) ConfirmSignup ¶
func (l *LocalAuthService) ConfirmSignup(ctx context.Context, req *models.RegisterRequest) error
func (*LocalAuthService) ExchangeAndRefreshToken ¶
func (l *LocalAuthService) ExchangeAndRefreshToken(ctx context.Context, projectWithRoles *models.ProjectWithRoles) (*models.JWTTokens, error)
func (*LocalAuthService) ForgetPasswordRequest ¶
func (l *LocalAuthService) ForgetPasswordRequest(ctx context.Context, req *models.RegisterRequest) error
func (*LocalAuthService) Login ¶
func (l *LocalAuthService) Login(ctx context.Context, req *models.LoginRequest, user *models.SystemUser, projectWithRoles *models.ProjectWithRoles) (*models.JWTTokens, error)
func (*LocalAuthService) Logout ¶
func (l *LocalAuthService) Logout(ctx context.Context, token string) error
func (*LocalAuthService) Signup ¶
func (l *LocalAuthService) Signup(ctx context.Context, registerRequest *models.RegisterRequest) (*models.SystemUser, error)
func (*LocalAuthService) VerifyAccessToken ¶
func (l *LocalAuthService) VerifyAccessToken(ctx context.Context, token string) error
func (*LocalAuthService) VerifyIDToken ¶
func (l *LocalAuthService) VerifyIDToken(ctx context.Context, token string) (*models.TokenClaims, error)
type TokenService ¶
func GetTokenService ¶
func GetTokenService(cfg *models.Config) *TokenService
func GetTokenServiceWithRedis ¶
func GetTokenServiceWithRedis(cfg *models.Config) *TokenService
func (*TokenService) GenerateProjectToken ¶
func (t *TokenService) GenerateProjectToken(user *models.SystemUser, projectId string) (string, error)
func (*TokenService) Validate ¶
func (t *TokenService) Validate(cfg *models.Config, token string) (*models.TokenClaims, error)
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package plugin provides functionality for loading and managing HashiCorp plugins from individual config.yml files in plugin directories.
|
Package plugin provides functionality for loading and managing HashiCorp plugins from individual config.yml files in plugin directories. |
Click to show internal directories.
Click to hide internal directories.