@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:36.202Z") @Stability(value=Stable) public class RequestAuthorizer extends Authorizer implements IAuthorizer
Based on the request, authorization is performed by a lambda function.
Example:
Function authFn;
Resource books;
RequestAuthorizer auth = RequestAuthorizer.Builder.create(this, "booksAuthorizer")
.handler(authFn)
.identitySources(List.of(IdentitySource.header("Authorization")))
.build();
books.addMethod("GET", new HttpIntegration("http://amazon.com"), MethodOptions.builder()
.authorizer(auth)
.build());
| Modifier and Type | Class and Description |
|---|---|
static class |
RequestAuthorizer.Builder
A fluent builder for
RequestAuthorizer. |
software.amazon.jsii.JsiiObject.InitializationModeIAuthorizer.Jsii$Default, IAuthorizer.Jsii$ProxyIResource.Jsii$Default| Modifier | Constructor and Description |
|---|---|
|
RequestAuthorizer(software.constructs.Construct scope,
String id,
RequestAuthorizerProps props) |
protected |
RequestAuthorizer(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
RequestAuthorizer(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
String |
getAuthorizerArn()
The ARN of the authorizer to be used in permission policies, such as IAM and resource-based grants.
|
String |
getAuthorizerId()
The id of the authorizer.
|
protected IFunction |
getHandler()
The Lambda function handler that this authorizer uses.
|
protected String |
getRestApiId() |
protected IRole |
getRole()
The IAM role that the API Gateway service assumes while invoking the Lambda function.
|
protected String |
lazyRestApiId()
Returns a token that resolves to the Rest Api Id at the time of synthesis.
|
protected void |
setRestApiId(String value) |
protected void |
setupPermissions()
Sets up the permissions necessary for the API Gateway service to invoke the Lambda function.
|
getAuthorizationType, isAuthorizerapplyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResourcejsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetAuthorizationTypeprotected RequestAuthorizer(software.amazon.jsii.JsiiObjectRef objRef)
protected RequestAuthorizer(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public RequestAuthorizer(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@NotNull
RequestAuthorizerProps props)
scope - This parameter is required.id - This parameter is required.props - This parameter is required.@Stability(value=Stable) @NotNull protected String lazyRestApiId()
Throws an error, during token resolution, if no RestApi is attached to this authorizer.
@Stability(value=Stable) protected void setupPermissions()
@Stability(value=Stable) @NotNull public String getAuthorizerArn()
@Stability(value=Stable) @NotNull public String getAuthorizerId()
getAuthorizerId in interface IAuthorizergetAuthorizerId in class Authorizer@Stability(value=Stable) @NotNull protected IFunction getHandler()
@Stability(value=Stable) @Nullable protected IRole getRole()
@Stability(value=Stable) @Nullable protected String getRestApiId()
@Stability(value=Stable)
protected void setRestApiId(@Nullable
String value)
Copyright © 2022. All rights reserved.