Documentation
¶
Index ¶
- Constants
- Variables
- func Ptr[T any](v T) *T
- type SigningBytesClaims
- func (s SigningBytesClaims) GetAudience() (jwt.ClaimStrings, error)
- func (s SigningBytesClaims) GetExpirationTime() (*jwt.NumericDate, error)
- func (s SigningBytesClaims) GetIssuedAt() (*jwt.NumericDate, error)
- func (s SigningBytesClaims) GetIssuer() (string, error)
- func (s SigningBytesClaims) GetNotBefore() (*jwt.NumericDate, error)
- func (s SigningBytesClaims) GetSubject() (string, error)
- func (s SigningBytesClaims) MarshalJSON() ([]byte, error)
Constants ¶
View Source
const ( AttrIss = "iss" AttrSub = "sub" AttrAud = "aud" AttrExp = "exp" AttrNbf = "nbf" AttrIat = "iat" AttrJti = "jti" )
View Source
const ( // ContentTypeJSON is the content type for JSON. ContentTypeJSON = "application/json" // DefaultOTPLength is the default length for OTPs. DefaultOTPLength = 6 // DefaultRelativePathRedirect is the default relative path for redirecting. DefaultRelativePathRedirect = "redirect" // HeaderContentType is the content type header. HeaderContentType = "Content-Type" // LogFmt is the log format. LogFmt = "%s\nError: %s" // LogErr is the log error. LogErr = "error" // LogRequestBody is key for logging the request body. LogRequestBody = "requestBody" // LogResponseBody is key for logging the response body. LogResponseBody = "responseBody" // Over250Years is the maximum duration for this project. Restriction derived from Golang's time.Duration. Over250Years = 250 * 366 * 24 * time.Hour // ResponseInternalServerError is the response for internal server errors. ResponseInternalServerError = "Internal server error." // ResponseTooManyRequests is the response for too many requests. ResponseTooManyRequests = "Too many requests." ResponseUnauthorized = "Unauthorized." )
Variables ¶
View Source
var (
ErrParams = errors.New("invalid parameters")
)
Functions ¶
Types ¶
type SigningBytesClaims ¶ added in v0.5.1
type SigningBytesClaims struct {
Claims json.RawMessage
}
SigningBytesClaims is a JWT claims type that allows for signing claims represented in bytes.
func (SigningBytesClaims) GetAudience ¶ added in v0.5.1
func (s SigningBytesClaims) GetAudience() (jwt.ClaimStrings, error)
func (SigningBytesClaims) GetExpirationTime ¶ added in v0.5.1
func (s SigningBytesClaims) GetExpirationTime() (*jwt.NumericDate, error)
func (SigningBytesClaims) GetIssuedAt ¶ added in v0.5.1
func (s SigningBytesClaims) GetIssuedAt() (*jwt.NumericDate, error)
func (SigningBytesClaims) GetIssuer ¶ added in v0.5.1
func (s SigningBytesClaims) GetIssuer() (string, error)
func (SigningBytesClaims) GetNotBefore ¶ added in v0.5.1
func (s SigningBytesClaims) GetNotBefore() (*jwt.NumericDate, error)
func (SigningBytesClaims) GetSubject ¶ added in v0.5.1
func (s SigningBytesClaims) GetSubject() (string, error)
func (SigningBytesClaims) MarshalJSON ¶ added in v0.5.1
func (s SigningBytesClaims) MarshalJSON() ([]byte, error)
MarshalJSON helps implement the json.Marshaler interface.
Click to show internal directories.
Click to hide internal directories.