Class: AWSCDK::APIGatewayv2::HttpRouteAuthorizerConfig

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
api_gatewayv2/http_route_authorizer_config.rb

Overview

Results of binding an authorizer to an http route.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(authorization_type:, authorization_scopes: nil, authorizer_id: nil) ⇒ HttpRouteAuthorizerConfig

Returns a new instance of HttpRouteAuthorizerConfig.

Parameters:

  • authorization_type (String)

    The type of authorization.

  • authorization_scopes (Array<String>, nil) (defaults to: nil)

    The list of OIDC scopes to include in the authorization.

  • authorizer_id (String, nil) (defaults to: nil)

    The authorizer id.



10
11
12
13
14
15
16
17
# File 'api_gatewayv2/http_route_authorizer_config.rb', line 10

def initialize(authorization_type:, authorization_scopes: nil, authorizer_id: nil)
  @authorization_type = authorization_type
  Jsii::Type.check_type(@authorization_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "authorizationType")
  @authorization_scopes = authorization_scopes
  Jsii::Type.check_type(@authorization_scopes, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "authorizationScopes") unless @authorization_scopes.nil?
  @authorizer_id = authorizer_id
  Jsii::Type.check_type(@authorizer_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "authorizerId") unless @authorizer_id.nil?
end

Instance Attribute Details

#authorization_scopesArray<String>? (readonly)

Note:

Default: - no authorization scopes

The list of OIDC scopes to include in the authorization.

Returns:

  • (Array<String>, nil)


34
35
36
# File 'api_gatewayv2/http_route_authorizer_config.rb', line 34

def authorization_scopes
  @authorization_scopes
end

#authorization_typeString (readonly)

The type of authorization.

Possible values are:

  • AWS_IAM - IAM Authorizer
  • JWT - JSON Web Token Authorizer
  • CUSTOM - Lambda Authorizer
  • NONE - No Authorization

Returns:

  • (String)


29
30
31
# File 'api_gatewayv2/http_route_authorizer_config.rb', line 29

def authorization_type
  @authorization_type
end

#authorizer_idString? (readonly)

Note:

Default: - No authorizer id (useful for AWS_IAM route authorizer)

The authorizer id.

Returns:

  • (String, nil)


39
40
41
# File 'api_gatewayv2/http_route_authorizer_config.rb', line 39

def authorizer_id
  @authorizer_id
end

Class Method Details

.jsii_propertiesObject



41
42
43
44
45
46
47
# File 'api_gatewayv2/http_route_authorizer_config.rb', line 41

def self.jsii_properties
  {
    :authorization_type => "authorizationType",
    :authorization_scopes => "authorizationScopes",
    :authorizer_id => "authorizerId",
  }
end

Instance Method Details

#to_jsiiObject



49
50
51
52
53
54
55
56
57
# File 'api_gatewayv2/http_route_authorizer_config.rb', line 49

def to_jsii
  result = {}
  result.merge!({
    "authorizationType" => @authorization_type,
    "authorizationScopes" => @authorization_scopes,
    "authorizerId" => @authorizer_id,
  })
  result.compact
end