-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathauth_options.go
40 lines (33 loc) · 882 Bytes
/
auth_options.go
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
package awsx
type AuthOption func(bd *AuthRequestConfig)
func applyAuthOptions(options []AuthOption) *AuthRequestConfig {
req := &AuthRequestConfig{}
for _, option := range options {
option(req)
}
return req
}
// UserPoolId sets the userPoolId
func UserPoolId(id string) AuthOption {
return func(req *AuthRequestConfig) {
req.userPoolID = id
}
}
// AppClientId sets the client id
func AppClientId(appClientID string) AuthOption {
return func(req *AuthRequestConfig) {
req.appClientID = appClientID
}
}
// ClientSecret sets the client secret
func ClientSecret(clientSecret string) AuthOption {
return func(req *AuthRequestConfig) {
req.clientSecret = clientSecret
}
}
// AwsDefaultRegion sets the region for aws
func AwsDefaultRegion(awsDefaultRegion string) AuthOption {
return func(req *AuthRequestConfig) {
req.awsDefaultRegion = awsDefaultRegion
}
}