mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-23 21:42:23 -05:00
* enhancement: use reva client pool selectors register mock service to registry and pass tests * enhancement: bump reva * Fix a couple of linter issues --------- Co-authored-by: Ralf Haferkamp <rhaferkamp@owncloud.com>
27 lines
875 B
Go
27 lines
875 B
Go
package backend
|
|
|
|
import (
|
|
"context"
|
|
"errors"
|
|
|
|
cs3 "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1"
|
|
)
|
|
|
|
var (
|
|
// ErrAccountNotFound account not found
|
|
ErrAccountNotFound = errors.New("user not found")
|
|
// ErrAccountDisabled account disabled
|
|
ErrAccountDisabled = errors.New("account disabled")
|
|
// ErrNotSupported operation not supported by user-backend
|
|
ErrNotSupported = errors.New("operation not supported")
|
|
)
|
|
|
|
//go:generate mockery --name=UserBackend
|
|
|
|
// UserBackend allows the proxy to retrieve users from different user-backends (accounts-service, CS3)
|
|
type UserBackend interface {
|
|
GetUserByClaims(ctx context.Context, claim, value string) (*cs3.User, string, error)
|
|
Authenticate(ctx context.Context, username string, password string) (*cs3.User, string, error)
|
|
CreateUserFromClaims(ctx context.Context, claims map[string]interface{}) (*cs3.User, error)
|
|
}
|