-
Notifications
You must be signed in to change notification settings - Fork 17
/
ResourceServerScope.go
109 lines (96 loc) · 2.5 KB
/
ResourceServerScope.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
package awscognito
import (
_init_ "github.com/aws/aws-cdk-go/awscdk/v2/jsii"
_jsii_ "github.com/aws/jsii-runtime-go/runtime"
)
// A scope for ResourceServer.
//
// Example:
// pool := cognito.NewUserPool(this, jsii.String("Pool"))
//
// readOnlyScope := cognito.NewResourceServerScope(&ResourceServerScopeProps{
// ScopeName: jsii.String("read"),
// ScopeDescription: jsii.String("Read-only access"),
// })
// fullAccessScope := cognito.NewResourceServerScope(&ResourceServerScopeProps{
// ScopeName: jsii.String("*"),
// ScopeDescription: jsii.String("Full access"),
// })
//
// userServer := pool.addResourceServer(jsii.String("ResourceServer"), &UserPoolResourceServerOptions{
// Identifier: jsii.String("users"),
// Scopes: []resourceServerScope{
// readOnlyScope,
// fullAccessScope,
// },
// })
//
// readOnlyClient := pool.addClient(jsii.String("read-only-client"), &UserPoolClientOptions{
// // ...
// OAuth: &OAuthSettings{
// // ...
// Scopes: []oAuthScope{
// cognito.*oAuthScope_ResourceServer(userServer, readOnlyScope),
// },
// },
// })
//
// fullAccessClient := pool.addClient(jsii.String("full-access-client"), &UserPoolClientOptions{
// // ...
// OAuth: &OAuthSettings{
// // ...
// Scopes: []*oAuthScope{
// cognito.*oAuthScope_*ResourceServer(userServer, fullAccessScope),
// },
// },
// })
//
type ResourceServerScope interface {
// A description of the scope.
ScopeDescription() *string
// The name of the scope.
ScopeName() *string
}
// The jsii proxy struct for ResourceServerScope
type jsiiProxy_ResourceServerScope struct {
_ byte // padding
}
func (j *jsiiProxy_ResourceServerScope) ScopeDescription() *string {
var returns *string
_jsii_.Get(
j,
"scopeDescription",
&returns,
)
return returns
}
func (j *jsiiProxy_ResourceServerScope) ScopeName() *string {
var returns *string
_jsii_.Get(
j,
"scopeName",
&returns,
)
return returns
}
func NewResourceServerScope(props *ResourceServerScopeProps) ResourceServerScope {
_init_.Initialize()
if err := validateNewResourceServerScopeParameters(props); err != nil {
panic(err)
}
j := jsiiProxy_ResourceServerScope{}
_jsii_.Create(
"aws-cdk-lib.aws_cognito.ResourceServerScope",
[]interface{}{props},
&j,
)
return &j
}
func NewResourceServerScope_Override(r ResourceServerScope, props *ResourceServerScopeProps) {
_init_.Initialize()
_jsii_.Create(
"aws-cdk-lib.aws_cognito.ResourceServerScope",
[]interface{}{props},
r,
)
}