Documentation ¶
Index ¶
Constants ¶
View Source
const ( Issuer = "auth-service" Audience = "auth-service" UserClaimsKey key = iota TokenLength int = 54 // To ensure the base64-encoded string is ≤ 72 bytes supported by bcrypt )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ITokenGenerator ¶
type JwtAuthInfo ¶
type JwtAuthInfo struct { UserInfo *JwtUserInfo DeviceId *uuid.UUID InstallationId *uuid.UUID }
func ExtractAuthInfo ¶
func ExtractAuthInfo(ctx context.Context) *JwtAuthInfo
type JwtUserInfo ¶
type JwtUserInfo struct { Id *uuid.UUID Role JwtUserRole Email string }
type JwtUserRole ¶
type JwtUserRole string
type TokenGenerator ¶
type TokenGenerator struct{}
func (*TokenGenerator) GenerateAccessToken ¶
func (*TokenGenerator) GenerateRefreshToken ¶
func (gen *TokenGenerator) GenerateRefreshToken() (string, time.Time, error)
GenerateToken generates a base64 encoded securely random string
Click to show internal directories.
Click to hide internal directories.