# README
Neuron - Auth
This package contains interfaces that defines basic authentication and authorization structures. It also provides basic authentication functions, and PEM file reading helpers.
# Functions
AuthenticatorBCryptCost is an option that sets BCryptCost in the auth options.
AuthenticatorMethod is an option that sets AuthenticateMethod in the auth options.
AuthenticatorSaltLength is an option that sets SaltLength in the auth options.
AuthenticatorStore is an option that sets Store in the option.
CompareHashPassword compares if provided password matches the sha512 hashed password with given salt.
CompareMD5Password compares if provided password matches the md5 hashed password with given salt.
CompareSHA256Password compares if provided password matches the sha256 hashed password with given salt.
CompareSHA512Password compares if provided password matches the sha512 hashed password with given salt.
CtxGetAccount gets the account from the context 'ctx'.
CtxWithAccount stores account in the context.
DefaultPasswordScorer is the default scoring function for the password.
DefaultPasswordValidator is the default password validator function.
DefaultUsernameValidator is the default username validator function.
GenerateSalt creates a crypto random byte slice salt.
NewPassword creates and analyze the 'password' using provided (optional) scorer function.
ParsePemECDSAPrivateKey parses 'pem' encoded 'ecdsa.PrivateKey'.
ParsePemRsaPrivateKey parses 'pem' encoded 'rsa.PrivateKey'.
TokenerAccount sets the account for the tokener.
TokenerEcdsaPrivateKey is an option that sets EcdsaPrivateKey in the auth options.
TokenerRefreshTokenExpiration is an option that sets RefreshTokenExpiration in the auth options.
TokenerRsaPrivateKey is an option that sets RsaPrivateKey in the auth options.
TokenerSecret is an option that sets Secret in the auth options.
TokenerSigningMethod is an option that sets SigningMethod in the auth options.
TokenerStore sets the store for the tokener.
TokenerTimeFunc sets the default time function for the tokener.
TokenerTokenExpiration is an option that sets TokenExpiration in the auth options.
TokenExpirationTime sets the expiration time for the token.
TokenRefreshExpirationTime sets the expiration time for the token.
TokenRefreshToken sets the refresh token for the token creation.
TokenScope sets the space separated scopes where the token should have an access.
TokenWithAudience sets the token audience.
TokenWithIssuer is the token option that sets up the issuer.
TokenWithNotBefore is the token option that sets up the not before option.
VerifyAllowedRoles sets allowed roles for the verify options.
VerifyDisallowedRoles sets disallowed roles for the verify options.
VerifyScopes sets the verify options scopes.
# Variables
ErrAccountAlreadyExists is an error when the account already exists.
ErrAccountModelNotDefined is an error that occurs when the account model is not defined.
ErrAccountNotFound is the error classification when account is not found.
ErrAccountNotValid is the error for invalid accounts.
ErrAuth is the account general error.
ErrAuthentication is an error related with authentication.
ErrAuthorization is the major authorization errors.
ErrAuthorizationHeader is an error related to authorization header.
ErrAuthorizationScope is an error related to the authorization scope.
ErrForbidden is the error classification when authorization fails.
ErrInitialization is the error classification while initializing the structures.
ErrInternalError is an auth package internal error.
ErrInvalidECDSAKey is an error for initialization with an invalid ECDSA key.
ErrInvalidPassword is the error classification when provided secret is not valid.
ErrInvalidRole is the error classification when the role is not valid.
ErrInvalidRSAKey is an error for initialization with an invalid RSA key.
ErrInvalidSecret is an error for initialization invalid secret.
ErrInvalidUsername is an error for invalid usernames.
ErrNoRequiredOption is the error classification while there is no required option.
ErrRoleAlreadyGranted is the error when the role is already granted.
ErrToken is the error for invalid token.
ErrTokenExpired is an error related to expired token.
ErrTokenNotValidYet is an error related to the token that is not valid yet.
ErrTokenRevoked is the error for invalid token.
# Structs
AuthenticatorOptions are the authentication service options.
ListRoleOptions are the options for listing the roles.
ListScopeOptions are the options used for listing the.
Password is a structure that defines the password and its properties.
Token is the authorization token structure.
TokenerOptions are the options that defines the settings for the Tokener.
TokenOptions is the options used to create the token.
VerifyOptions is the structure contains authorize query options.
# Interfaces
AccessClaims is an interface used for the access token claims.
Account is an interface for the authenticate account models.
Audiencer is an interface that allows to get token's optional audience value.
Authenticator is the interface used to authenticate the username and password.
Claims is an interface used for the tokens.
HierarchicalRole is an interface for the.
Issuer is an interface that allows to get the token issuer.
NotBeforer is an interface that allows to get Token's NotBefore (nbf) value.
Role is the interface used for the roles.
Roler is the role-based access control authorization.
RoleScoper is an interface for authorizators that allows to set and get scopes.
Salter is an interface for accounts that has the 'salt' field.
SaltFielder is an interface that gets the salt field name for given account.
SaltGetter is an interface for Account that could get it's stored salt value.
SaltSetter is an interface for Account that sets it's salt field value.
Scope is an interface that defines authorization scope.
Scoper is an interface that allows to get Token's authorization scope value.
SigningMethod is an interface used for signing and verify the string.
Tokener is the interface used for the authorization with the token.
Verifier is the interface used to authorize resources.
# Type aliases
AuthenticateMethod is a method of authentication used by the authenticator.
AuthenticatorOption is a function used to set authentication options.
ListRoleOption is the option.
ListScopeOption is an option function that changes list scope options.
PasswordScorer is a function that sets the score for given password.
PasswordValidator is a function that validates the password.
TokenerOption is a function that sets the TokenerOptions.
TokenOption is the token options changer function.
UsernameValidator is a function used to validate the username for the account.
VerifyOption is an option used for the verification.