api package - go.lumeweb.com/portal-plugin-dashboard/internal/api - Go Packages

api

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 26, 2026 License: MIT Imports: 64 Imported by: 0

Documentation

Index

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

func GenerateTestOTPSecret(tb testing.TB) string

GenerateTestOTPSecret generates a test OTP secret using the core TOTPGenerate function

func GenerateTestTOTPCode added in v0.3.0

func GenerateTestTOTPCode(tb testing.TB, secret string) string

GenerateTestTOTPCode generates a valid TOTP code for the given secret

func NewAPI

func NewAPI() (core.API, []core.ContextBuilderOption, error)

Types

type API

type API struct {
	*core.BaseComponent
	// contains filtered or unexported fields
}

func (*API) AuthTokenName

func (a *API) AuthTokenName() string

func (*API) Configure

func (a *API) Configure(gRouter router.Router, accessSvc core.AccessService) error

func (*API) GetConfig added in v0.3.0

func (a *API) GetConfig() config.APIConfig

func (*API) ID added in v0.3.0

func (a *API) ID() string

func (*API) Name

func (a *API) Name() string

func (*API) OpenAPIInfo added in v0.3.0

func (a *API) OpenAPIInfo() router.APIInfoDefinition

func (*API) S3Bucket added in v0.3.0

func (a *API) S3Bucket() string

func (*API) Subdomain

func (a *API) Subdomain() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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