-
Notifications
You must be signed in to change notification settings - Fork 17
/
awsapigatewayv2_HttpNoneAuthorizer.go
119 lines (106 loc) · 3.11 KB
/
awsapigatewayv2_HttpNoneAuthorizer.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
109
110
111
112
113
114
115
116
117
118
package awsapigatewayv2
import (
_init_ "github.com/aws/aws-cdk-go/awscdk/jsii"
_jsii_ "github.com/aws/jsii-runtime-go/runtime"
)
// Explicitly configure no authorizers on specific HTTP API routes.
//
// Example:
// import "github.com/aws/aws-cdk-go/awscdk"
// import "github.com/aws/aws-cdk-go/awscdk"
//
//
// issuer := "https://test.us.auth0.com"
// authorizer := awscdk.NewHttpJwtAuthorizer(jsii.String("DefaultAuthorizer"), issuer, &httpJwtAuthorizerProps{
// jwtAudience: []*string{
// jsii.String("3131231"),
// },
// })
//
// api := apigwv2.NewHttpApi(this, jsii.String("HttpApi"), &httpApiProps{
// defaultAuthorizer: authorizer,
// defaultAuthorizationScopes: []*string{
// jsii.String("read:books"),
// },
// })
//
// api.addRoutes(&addRoutesOptions{
// integration: awscdk.NewHttpUrlIntegration(jsii.String("BooksIntegration"), jsii.String("https://get-books-proxy.myproxy.internal")),
// path: jsii.String("/books"),
// methods: []httpMethod{
// apigwv2.*httpMethod_GET,
// },
// })
//
// api.addRoutes(&addRoutesOptions{
// integration: awscdk.NewHttpUrlIntegration(jsii.String("BooksIdIntegration"), jsii.String("https://get-books-proxy.myproxy.internal")),
// path: jsii.String("/books/{id}"),
// methods: []*httpMethod{
// apigwv2.*httpMethod_GET,
// },
// })
//
// api.addRoutes(&addRoutesOptions{
// integration: awscdk.NewHttpUrlIntegration(jsii.String("BooksIntegration"), jsii.String("https://get-books-proxy.myproxy.internal")),
// path: jsii.String("/books"),
// methods: []*httpMethod{
// apigwv2.*httpMethod_POST,
// },
// authorizationScopes: []*string{
// jsii.String("write:books"),
// },
// })
//
// api.addRoutes(&addRoutesOptions{
// integration: awscdk.NewHttpUrlIntegration(jsii.String("LoginIntegration"), jsii.String("https://get-books-proxy.myproxy.internal")),
// path: jsii.String("/login"),
// methods: []*httpMethod{
// apigwv2.*httpMethod_POST,
// },
// authorizer: apigwv2.NewHttpNoneAuthorizer(),
// })
//
// Experimental.
type HttpNoneAuthorizer interface {
IHttpRouteAuthorizer
// Bind this authorizer to a specified Http route.
// Experimental.
Bind(_arg *HttpRouteAuthorizerBindOptions) *HttpRouteAuthorizerConfig
}
// The jsii proxy struct for HttpNoneAuthorizer
type jsiiProxy_HttpNoneAuthorizer struct {
jsiiProxy_IHttpRouteAuthorizer
}
// Experimental.
func NewHttpNoneAuthorizer() HttpNoneAuthorizer {
_init_.Initialize()
j := jsiiProxy_HttpNoneAuthorizer{}
_jsii_.Create(
"monocdk.aws_apigatewayv2.HttpNoneAuthorizer",
nil, // no parameters
&j,
)
return &j
}
// Experimental.
func NewHttpNoneAuthorizer_Override(h HttpNoneAuthorizer) {
_init_.Initialize()
_jsii_.Create(
"monocdk.aws_apigatewayv2.HttpNoneAuthorizer",
nil, // no parameters
h,
)
}
func (h *jsiiProxy_HttpNoneAuthorizer) Bind(_arg *HttpRouteAuthorizerBindOptions) *HttpRouteAuthorizerConfig {
if err := h.validateBindParameters(_arg); err != nil {
panic(err)
}
var returns *HttpRouteAuthorizerConfig
_jsii_.Invoke(
h,
"bind",
[]interface{}{_arg},
&returns,
)
return returns
}