Documentation
¶
Index ¶
- Constants
- func NewAsymmetricKey(jwtSigningMethod jwt.SigningMethod, certificat interface{}, ...) types.Key
- func NewKeyFromJSON(codeAlgorithm string, sourceJson []byte) (types.Key, *gwerror.Error)
- func NewSymmetricKey(jwtSigningMethod jwt.SigningMethod, certificat interface{}, key interface{}) types.Key
- type ChainOfToken
- type ClaimsOfToken
- type Key
Constants ¶
View Source
const ( ERROR_EXCEPTION_ON_GET_CERTIFICAT_AND_KEY = `ERROR: Exception on - Get certificat and key.` ERROR_EXCEPTION_ON_GET_CERTIFICAT_AND_PUBLIC_KEY_AND_PRIVATE_KEY = `ERROR: Exception on - Get certificat, public key and private key.` )
View Source
const ( JSON_CERTIFICAT = `certificat` JSON_KEY = "key" JSON_PRIVATE_KEY = `private_key` JSON_PUBLIC_KEY = `public_key` )
View Source
const (
GWJWT_MODEL_KEY_PATH_ROUTE = `gwjwt/v1/model/key`
)
Variables ¶
This section is empty.
Functions ¶
func NewAsymmetricKey ¶
func NewAsymmetricKey(jwtSigningMethod jwt.SigningMethod, certificat interface{}, signKey interface{}, verifyKey interface{}) types.Key
func NewKeyFromJSON ¶
func NewSymmetricKey ¶
func NewSymmetricKey(jwtSigningMethod jwt.SigningMethod, certificat interface{}, key interface{}) types.Key
Types ¶
type ChainOfToken ¶
type ChainOfToken struct {
AccountId int64 `pg:"account_idx"`
// Recipient for which the JWT is intended.
Audience string `pg:"audience"`
// Time after which the JWT expires.
ExpiresAt time.Time `pg:"expires_at"`
// Unique identifier; can be used to prevent the JWT from being replayed (allows a token to be used only once).
Id string `pg:"id"`
// Time at which the JWT was issued; can be used to determine age of the JWT.
IssuedAt time.Time `pg:"issued_at"`
// Issuer of the JWT.
Issuer string `pg:"issuer"`
// Time before which the JWT must not be accepted for processing.
NotBefore time.Time `pg:"not_before"`
// Subject of the JWT (the user).
Subject string `pg:"subject"`
// Unique identificator entrypoint User system.
Fingerprint string `pg:"fingerprint"`
// IP connecting.
IP string `pg:"ip"`
// Code auth social network service.
CodeAuthSocialNetworke string
// Result token.
Token string `pg:"token"`
}
func (*ChainOfToken) GetClaims ¶
func (chainOfToken *ChainOfToken) GetClaims() ClaimsOfToken
type ClaimsOfToken ¶
type ClaimsOfToken struct {
AccountId int64 `json:"accountId" pg:"account_idx"`
// Unique identificator entrypoint User system
Fingerprint string `json:"fingerprint" pg:"fingerprint"`
// IP connecting
IP string `json:"ip" pg:"ip"`
// Standart claims
jwt.StandardClaims
}
type Key ¶
type Key struct {
// contains filtered or unexported fields
}
func (*Key) GetCertificat ¶
func (key *Key) GetCertificat() interface{}
func (*Key) GetSignKey ¶
func (key *Key) GetSignKey() interface{}
func (*Key) GetSigningMethod ¶
func (key *Key) GetSigningMethod() jwt.SigningMethod
func (*Key) GetVerifyKey ¶
func (key *Key) GetVerifyKey() interface{}
Click to show internal directories.
Click to hide internal directories.