Class: AWSCDK::APIGatewayv2Authorizers::HttpLambdaAuthorizerProps
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::APIGatewayv2Authorizers::HttpLambdaAuthorizerProps
- Defined in:
- api_gatewayv2_authorizers/http_lambda_authorizer_props.rb
Overview
Properties to initialize HttpTokenAuthorizer.
Instance Attribute Summary collapse
-
#authorizer_name ⇒ String?
readonly
Friendly authorizer name.
-
#identity_source ⇒ Array<String>?
readonly
The identity source for which authorization is requested.
-
#response_types ⇒ Array<AWSCDK::APIGatewayv2Authorizers::HttpLambdaResponseType>?
readonly
The types of responses the lambda can return.
-
#results_cache_ttl ⇒ AWSCDK::Duration?
readonly
How long APIGateway should cache the results.
-
#role ⇒ AWSCDK::Interfaces::AWSIAM::IRoleRef?
readonly
The IAM role that the API Gateway service assumes while invoking the authorizer.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(authorizer_name: nil, identity_source: nil, response_types: nil, results_cache_ttl: nil, role: nil) ⇒ HttpLambdaAuthorizerProps
constructor
A new instance of HttpLambdaAuthorizerProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(authorizer_name: nil, identity_source: nil, response_types: nil, results_cache_ttl: nil, role: nil) ⇒ HttpLambdaAuthorizerProps
Returns a new instance of HttpLambdaAuthorizerProps.
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'api_gatewayv2_authorizers/http_lambda_authorizer_props.rb', line 12 def initialize(authorizer_name: nil, identity_source: nil, response_types: nil, results_cache_ttl: nil, role: nil) @authorizer_name = Jsii::Type.check_type(@authorizer_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "authorizerName") unless @authorizer_name.nil? @identity_source = identity_source Jsii::Type.check_type(@identity_source, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "identitySource") unless @identity_source.nil? @response_types = response_types Jsii::Type.check_type(@response_types, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19hcGlnYXRld2F5djJfYXV0aG9yaXplcnMuSHR0cExhbWJkYVJlc3BvbnNlVHlwZSJ9LCJraW5kIjoiYXJyYXkifX0=")), "responseTypes") unless @response_types.nil? @results_cache_ttl = results_cache_ttl Jsii::Type.check_type(@results_cache_ttl, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "resultsCacheTtl") unless @results_cache_ttl.nil? @role = role Jsii::Type.check_type(@role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19pYW0uSVJvbGVSZWYifQ==")), "role") unless @role.nil? end |
Instance Attribute Details
#authorizer_name ⇒ String? (readonly)
Default: - same value as id passed in the constructor.
Friendly authorizer name.
29 30 31 |
# File 'api_gatewayv2_authorizers/http_lambda_authorizer_props.rb', line 29 def @authorizer_name end |
#identity_source ⇒ Array<String>? (readonly)
Default: ['$request.header.Authorization']
The identity source for which authorization is requested.
34 35 36 |
# File 'api_gatewayv2_authorizers/http_lambda_authorizer_props.rb', line 34 def identity_source @identity_source end |
#response_types ⇒ Array<AWSCDK::APIGatewayv2Authorizers::HttpLambdaResponseType>? (readonly)
Default: [HttpLambdaResponseType.IAM]
The types of responses the lambda can return.
If HttpLambdaResponseType.SIMPLE is included then response format 2.0 will be used.
43 44 45 |
# File 'api_gatewayv2_authorizers/http_lambda_authorizer_props.rb', line 43 def response_types @response_types end |
#results_cache_ttl ⇒ AWSCDK::Duration? (readonly)
Default: Duration.minutes(5)
How long APIGateway should cache the results.
Max 1 hour.
Disable caching by setting this to Duration.seconds(0).
51 52 53 |
# File 'api_gatewayv2_authorizers/http_lambda_authorizer_props.rb', line 51 def results_cache_ttl @results_cache_ttl end |
#role ⇒ AWSCDK::Interfaces::AWSIAM::IRoleRef? (readonly)
Default: - No role
The IAM role that the API Gateway service assumes while invoking the authorizer.
Supported only for REQUEST authorizers.
58 59 60 |
# File 'api_gatewayv2_authorizers/http_lambda_authorizer_props.rb', line 58 def role @role end |
Class Method Details
.jsii_properties ⇒ Object
60 61 62 63 64 65 66 67 68 |
# File 'api_gatewayv2_authorizers/http_lambda_authorizer_props.rb', line 60 def self.jsii_properties { :authorizer_name => "authorizerName", :identity_source => "identitySource", :response_types => "responseTypes", :results_cache_ttl => "resultsCacheTtl", :role => "role", } end |
Instance Method Details
#to_jsii ⇒ Object
70 71 72 73 74 75 76 77 78 79 80 |
# File 'api_gatewayv2_authorizers/http_lambda_authorizer_props.rb', line 70 def to_jsii result = {} result.merge!({ "authorizerName" => @authorizer_name, "identitySource" => @identity_source, "responseTypes" => @response_types, "resultsCacheTtl" => @results_cache_ttl, "role" => @role, }) result.compact end |