Documentation
¶
Index ¶
- Constants
- func CreateTest2FAToken(tb testing.TB, ctx coreTesting.TestContext, userID string) string
- func CreateTestAPIKeyToken(tb testing.TB, ctx coreTesting.TestContext, userID string, keyID uuid.UUID) string
- func CreateTestJWTToken(tb testing.TB, ctx coreTesting.TestContext, userID string, purpose jwt.Purpose) string
- func CreateTestLoginToken(tb testing.TB, ctx coreTesting.TestContext, userID string) string
- func GenerateTestOTPSecret(tb testing.TB) string
- func GenerateTestTOTPCode(tb testing.TB, secret string) string
- func NewAPI() (core.API, []core.ContextBuilderOption, error)
- type API
- func (a *API) AuthTokenName() string
- func (a *API) Configure(gRouter router.Router, accessSvc core.AccessService) error
- func (a *API) GetConfig() config.APIConfig
- func (a *API) ID() string
- func (a *API) Name() string
- func (a *API) OpenAPIInfo() router.APIInfoDefinition
- func (a *API) S3Bucket() string
- func (a *API) Subdomain() string
Constants ¶
View Source
const ( AuthCompletePath = "/api/auth/complete" // Path for authentication complete endpoint RememberMeCookie = "remember_me" // Cookie name for remember me flag )
View Source
const ( AvatarUploadDir = "avatars" AvatarMimeTypes = "image/jpeg,image/png,image/gif,image/webp" // Still accept all types but convert to WebP AvatarMaxSize = 5 << 20 // 5MB AvatarWidth = 120 AvatarHeight = 120 AvatarPathFormat = "%s/%d.webp" // Format string for avatar paths AvatarURLFormat = "%s/api/account/avatar" // Format string for avatar URLs )
Variables ¶
This section is empty.
Functions ¶
func CreateTest2FAToken ¶ added in v0.3.0
func CreateTest2FAToken(tb testing.TB, ctx coreTesting.TestContext, userID string) string
CreateTest2FAToken generates a valid JWT token with 2FA purpose for testing
func CreateTestAPIKeyToken ¶ added in v0.3.0
func CreateTestAPIKeyToken(tb testing.TB, ctx coreTesting.TestContext, userID string, keyID uuid.UUID) string
CreateTestAPIKeyToken generates a valid API key JWT for testing purposes
func CreateTestJWTToken ¶ added in v0.3.0
func CreateTestJWTToken(tb testing.TB, ctx coreTesting.TestContext, userID string, purpose jwt.Purpose) string
CreateTestJWTToken generates a valid JWT token for testing purposes
func CreateTestLoginToken ¶ added in v0.3.0
func CreateTestLoginToken(tb testing.TB, ctx coreTesting.TestContext, userID string) string
CreateTestLoginToken generates a valid JWT token with login purpose for testing
func GenerateTestOTPSecret ¶ added in v0.3.0
GenerateTestOTPSecret generates a test OTP secret using the core TOTPGenerate function
func GenerateTestTOTPCode ¶ added in v0.3.0
GenerateTestTOTPCode generates a valid TOTP code for the given secret
Types ¶
type API ¶
type API struct {
*core.BaseComponent
// contains filtered or unexported fields
}
func (*API) AuthTokenName ¶
func (*API) OpenAPIInfo ¶ added in v0.3.0
func (a *API) OpenAPIInfo() router.APIInfoDefinition
Source Files
¶
Click to show internal directories.
Click to hide internal directories.