forked from linuxfoundation/lfx-v2-auth-service
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuser.go
More file actions
42 lines (34 loc) · 1.33 KB
/
user.go
File metadata and controls
42 lines (34 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright The Linux Foundation and each contributor to LFX.
// SPDX-License-Identifier: MIT
package port
import (
"context"
"github.com/linuxfoundation/lfx-v2-auth-service/internal/domain/model"
)
// UserReaderWriter defines the behavior of the user reader writer
type UserReaderWriter interface {
UserReader
UserWriter
EmailHandler
IdentityLinker
}
// UserReader defines the behavior of the user reader
type UserReader interface {
GetUser(ctx context.Context, user *model.User) (*model.User, error)
SearchUser(ctx context.Context, user *model.User, criteria string) (*model.User, error)
MetadataLookup(ctx context.Context, input string, requiredScopes ...string) (*model.User, error)
}
// UserWriter defines the behavior of the user writer
type UserWriter interface {
UpdateUser(ctx context.Context, user *model.User) (*model.User, error)
}
// IdentityLinker defines the behavior of the identity linker
type IdentityLinker interface {
LinkIdentity(ctx context.Context, request *model.LinkIdentity) error
UnlinkIdentity(ctx context.Context, request *model.UnlinkIdentity) error
}
// EmailHandler defines the behavior of the email handler
type EmailHandler interface {
SendVerificationAlternateEmail(ctx context.Context, alternateEmail string) error
VerifyAlternateEmail(ctx context.Context, email *model.Email) (*model.AuthResponse, error)
}