Versions in this module Expand all Collapse all v0 v0.0.1 Aug 24, 2022 Changes in this version + const KeyApplicationID + const KeyEmail + const KeyPermission + const KeyRoles + const KeyToken + const KeyUserName + const KeyUserUID + const KeyValidUntil + const UserAuthServiceID + func ConvertStringToPrivateKey(privateKey string) *rsa.PrivateKey + func ConvertStringToPublicKey(publicKey string) *rsa.PublicKey + func NewBasicAuthenticator(cfg configlib.Configer, keyProvider KeyProvider) *basicAuthenticator + type ApplicationToken struct + ApplicationID int + SrcApplicationID int + UserToken string + type Authenticator interface + GenerateServiceToken func(serviceID int) (string, error) + GenerateServiceTokenWithUserData func(serviceID int, ctx context.Context) (string, error) + type JWTHeader struct + Alg string + Typ string + type JWTPayload struct + Permission map[string]string + Roles []string + Username string + ValidUntil time.Time + type KeyProvider interface + GetPrivateKey func() (*rsa.PrivateKey, error) + GetPublicKey func(applicationID int) (*rsa.PublicKey, error) + type ObjectPermission map[string]Roles + func (o ObjectPermission) HasRoleOn(object, role string) bool + type Permission map[string]ObjectPermission + func (p Permission) HasRoleOnOjbectType(objectType, object, role string) bool + type Roles []string + func (r Roles) Has(role string) bool + type TokenParser interface + ParseApplicationToken func(token string) (ApplicationToken, error) + ParseUserToken func(token string) (UserToken, error) + type UserToken struct + Email string + Permissions Permission + Roles Roles + UserName string + UserUID string + ValidUntil time.Time