Versions in this module Expand all Collapse all v1 v1.0.1 Sep 30, 2020 Changes in this version + var DefaultTTL = 5 * time.Minute + var ErrAuthFailed = errors.New("auth: authentication failed, invalid user ID or password") + var ErrAuthNotEnabled = errors.New("auth: authentication is not enabled") + var ErrAuthOldRevision = errors.New("auth: revision in header is old") + var ErrInvalidAuthMethod = errors.New("auth: invalid auth signature method") + var ErrInvalidAuthMgmt = errors.New("auth: invalid auth management") + var ErrInvalidAuthOpts = errors.New("auth: invalid auth options") + var ErrInvalidAuthToken = errors.New("auth: invalid auth token") + var ErrKeyMismatch = errors.New("auth: public and private keys don't match") + var ErrMissingKey = errors.New("auth: missing key data") + var ErrNoPasswordUser = errors.New("auth: authentication failed, password was given for no password user") + var ErrPermissionDenied = errors.New("auth: permission denied") + var ErrPermissionNotGranted = errors.New("auth: permission is not granted to the role") + var ErrRoleAlreadyExist = errors.New("auth: role already exists") + var ErrRoleEmpty = errors.New("auth: role name is empty") + var ErrRoleNotFound = errors.New("auth: role not found") + var ErrRoleNotGranted = errors.New("auth: role is not granted to the user") + var ErrRootRoleNotExist = errors.New("auth: root user does not have root role") + var ErrRootUserNotExist = errors.New("auth: root user does not exist") + var ErrUserAlreadyExist = errors.New("auth: user already exists") + var ErrUserEmpty = errors.New("auth: user name is empty") + var ErrUserNotFound = errors.New("auth: user not found") + var ErrVerifyOnly = errors.New("auth: token signing attempted with verify-only key") + func NewAuthStore(lg *zap.Logger, be backend.Backend, ci cindex.ConsistentIndexer, ...) *authStore + type AuthInfo struct + Revision uint64 + Username string + type AuthStore interface + AuthDisable func() + AuthEnable func() error + AuthInfoFromCtx func(ctx context.Context) (*AuthInfo, error) + AuthInfoFromTLS func(ctx context.Context) *AuthInfo + Authenticate func(ctx context.Context, username, password string) (*pb.AuthenticateResponse, error) + BcryptCost func() int + CheckPassword func(username, password string) (uint64, error) + Close func() error + GenTokenPrefix func() (string, error) + HasRole func(user, role string) bool + IsAdminPermitted func(authInfo *AuthInfo) error + IsAuthEnabled func() bool + IsDeleteRangePermitted func(authInfo *AuthInfo, key, rangeEnd []byte) error + IsPutPermitted func(authInfo *AuthInfo, key []byte) error + IsRangePermitted func(authInfo *AuthInfo, key, rangeEnd []byte) error + Recover func(b backend.Backend) + Revision func() uint64 + RoleAdd func(r *pb.AuthRoleAddRequest) (*pb.AuthRoleAddResponse, error) + RoleDelete func(r *pb.AuthRoleDeleteRequest) (*pb.AuthRoleDeleteResponse, error) + RoleGet func(r *pb.AuthRoleGetRequest) (*pb.AuthRoleGetResponse, error) + RoleGrantPermission func(r *pb.AuthRoleGrantPermissionRequest) (*pb.AuthRoleGrantPermissionResponse, error) + RoleList func(r *pb.AuthRoleListRequest) (*pb.AuthRoleListResponse, error) + RoleRevokePermission func(r *pb.AuthRoleRevokePermissionRequest) (*pb.AuthRoleRevokePermissionResponse, error) + UserAdd func(r *pb.AuthUserAddRequest) (*pb.AuthUserAddResponse, error) + UserChangePassword func(r *pb.AuthUserChangePasswordRequest) (*pb.AuthUserChangePasswordResponse, error) + UserDelete func(r *pb.AuthUserDeleteRequest) (*pb.AuthUserDeleteResponse, error) + UserGet func(r *pb.AuthUserGetRequest) (*pb.AuthUserGetResponse, error) + UserGrantRole func(r *pb.AuthUserGrantRoleRequest) (*pb.AuthUserGrantRoleResponse, error) + UserList func(r *pb.AuthUserListRequest) (*pb.AuthUserListResponse, error) + UserRevokeRole func(r *pb.AuthUserRevokeRoleRequest) (*pb.AuthUserRevokeRoleResponse, error) + WithRoot func(ctx context.Context) context.Context + type AuthenticateParamIndex struct + type AuthenticateParamSimpleTokenPrefix struct + type TokenProvider interface + func NewTokenProvider(lg *zap.Logger, tokenOpts string, indexWaiter func(uint64) <-chan struct{}, ...) (TokenProvider, error) Incompatible versions in this module v3.3.16+incompatible Oct 10, 2019