Documentation ¶
Index ¶
- Constants
- func ExceptLocalhost(publicKeyFunc func() (*ecdsa.PublicKey, error)) gin.HandlerFunc
- func GenerateJwksJSON(publicKey *ecdsa.PublicKey) ([]byte, error)
- func GenerateKeyPair() (*ecdsa.PrivateKey, *ecdsa.PublicKey, error)
- func GenerateToken(username string, privateKey *ecdsa.PrivateKey, id int, issuer string, ...) (string, error)
- func GetAccessToken(username string, privateKey *ecdsa.PrivateKey, id int) (string, error)
- func GetRefreshToken(username string, private *ecdsa.PrivateKey, id int) (string, error)
- func JWKSHandler(jwksJSON []byte) http.Handler
- func JWT(publicKeyFunc func() (*ecdsa.PublicKey, error)) gin.HandlerFunc
- func PublicKeyFromJwksJSON(jwksJSON []byte) (*ecdsa.PublicKey, error)
- type Claims
- type JWK
- type JWKS
Constants ¶
View Source
const JWKSPath = ".well-known/jwks.json"
Variables ¶
This section is empty.
Functions ¶
func ExceptLocalhost ¶
func ExceptLocalhost(publicKeyFunc func() (*ecdsa.PublicKey, error)) gin.HandlerFunc
func GenerateKeyPair ¶
func GenerateKeyPair() (*ecdsa.PrivateKey, *ecdsa.PublicKey, error)
func GenerateToken ¶
func GetAccessToken ¶
get AccessToken
func GetRefreshToken ¶
func JWKSHandler ¶
Types ¶
type Claims ¶
type Claims struct { Username string `json:"username"` ID int `json:"id"` jwt.RegisteredClaims }
func ParseToken ¶
Click to show internal directories.
Click to hide internal directories.