Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ProviderSet = wire.NewSet(NewAuth)
Functions ¶
func RawFromContext ¶ added in v0.2.1
Types ¶
type Auth ¶
type Auth struct {
// contains filtered or unexported fields
}
func (*Auth) GenerateToken ¶
func (a *Auth) GenerateToken( uid model.InternalID, pid model.InternalID, claimsType ClaimsType, userType UserType, transferMetadata any, expire time.Duration, ) (string, error)
type Claims ¶
type Claims struct { UserID model.InternalID `json:"uid,string"` PorterID model.InternalID `json:"pid,string,omitempty"` Type ClaimsType `json:"ct"` UserType UserType `json:"ut"` TransferMetadata any `json:"tm,omitempty"` jwtv4.RegisteredClaims }
func FromContext ¶
type ClaimsType ¶
type ClaimsType int
const ( ClaimsTypeUnspecified ClaimsType = iota ClaimsTypeAccessToken ClaimsTypeRefreshToken ClaimsTypeUploadToken ClaimsTypeDownloadToken )
Click to show internal directories.
Click to hide internal directories.