Documentation ¶
Index ¶
- func ForgeToken(uid, email, role string, level int, referralID int, key *rsa.PrivateKey, ...) (string, error)
- type Auth
- type KeyStore
- func (ks *KeyStore) GenerateKeys() error
- func (ks *KeyStore) LoadPrivateKey(path string) error
- func (ks *KeyStore) LoadPublicKeyFromFile(path string) error
- func (ks *KeyStore) LoadPublicKeyFromString(str string) error
- func (ks *KeyStore) SavePrivateKey(path string) error
- func (ks *KeyStore) SavePublicKey(path string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Auth ¶
type Auth struct { UID string `json:"uid"` State string `json:"state"` Email string `json:"email"` Username string `json:"username"` Role string `json:"role"` ReferralID json.Number `json:"referral_id"` Level json.Number `json:"level"` Audience []string `json:"aud,omitempty"` jwt.StandardClaims }
Auth struct represents parsed jwt information.
type KeyStore ¶
type KeyStore struct { PublicKey *rsa.PublicKey PrivateKey *rsa.PrivateKey }
func LoadOrGenerateKeys ¶
func (*KeyStore) GenerateKeys ¶
func (*KeyStore) LoadPrivateKey ¶
func (*KeyStore) LoadPublicKeyFromFile ¶
func (*KeyStore) LoadPublicKeyFromString ¶
func (*KeyStore) SavePrivateKey ¶
func (*KeyStore) SavePublicKey ¶
Click to show internal directories.
Click to hide internal directories.