2024-10-21 16:12:28 +00:00
|
|
|
package sec
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/golang-jwt/jwt/v5"
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
|
|
|
type JwtClaims struct {
|
|
|
|
jwt.RegisteredClaims
|
|
|
|
|
|
|
|
// Nexus Standard
|
2024-10-30 15:59:04 +00:00
|
|
|
Session string `json:"sed"`
|
2024-10-21 16:12:28 +00:00
|
|
|
CacheTTL time.Duration `json:"ttl,omitempty"`
|
|
|
|
|
|
|
|
// OIDC Standard
|
|
|
|
Name string `json:"name,omitempty"`
|
|
|
|
Nick string `json:"preferred_username,omitempty"`
|
|
|
|
Email string `json:"email,omitempty"`
|
|
|
|
|
|
|
|
// OAuth2 Standard
|
|
|
|
AuthorizedParties string `json:"azp,omitempty"`
|
|
|
|
Nonce string `json:"nonce,omitempty"`
|
|
|
|
|
|
|
|
// The usage of this token
|
|
|
|
// Can be access_token, refresh_token or id_token
|
|
|
|
Type string `json:"typ"`
|
|
|
|
}
|