Files
opencloud/services/proxy/pkg/user/backend/backend.go
Jörn Friedrich Dreyer fad94d2038 bump mockery, add test stub for oidc_auth.go, align mock generation (#8321)
* bump mockery, add test stub for oidc_auth.go

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

* use .mockery.yaml for all mocks

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

* drop legacy go:generate mockery

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

* align mock placement

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

---------

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2024-02-01 10:07:44 +01:00

25 lines
833 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")
)
// 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)
}