Class: AWSCDK::BedrockAgentCore::CognitoAuthorizerProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
bedrock_agent_core/cognito_authorizer_props.rb

Overview

**************************************************************************** Factory ***************************************************************************.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(user_pool:, allowed_audiences: nil, allowed_clients: nil, allowed_scopes: nil, custom_claims: nil) ⇒ CognitoAuthorizerProps

Returns a new instance of CognitoAuthorizerProps.

Parameters:

  • user_pool (AWSCDK::Cognito::IUserPool)

    The Cognito User Pool to use for authentication.

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

    The allowed audiences for JWT validation.

  • allowed_clients (Array<AWSCDK::Cognito::IUserPoolClient>, nil) (defaults to: nil)

    The allowed User Pool clients.

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

    The allowed scopes for JWT validation.

  • custom_claims (Array<AWSCDK::BedrockAgentCore::GatewayCustomClaim>, nil) (defaults to: nil)

    Custom claims for additional JWT token validation.



12
13
14
15
16
17
18
19
20
21
22
23
# File 'bedrock_agent_core/cognito_authorizer_props.rb', line 12

def initialize(user_pool:, allowed_audiences: nil, allowed_clients: nil, allowed_scopes: nil, custom_claims: nil)
  @user_pool = user_pool
  Jsii::Type.check_type(@user_pool, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29nbml0by5JVXNlclBvb2wifQ==")), "userPool")
  @allowed_audiences = allowed_audiences
  Jsii::Type.check_type(@allowed_audiences, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "allowedAudiences") unless @allowed_audiences.nil?
  @allowed_clients = allowed_clients
  Jsii::Type.check_type(@allowed_clients, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jb2duaXRvLklVc2VyUG9vbENsaWVudCJ9LCJraW5kIjoiYXJyYXkifX0=")), "allowedClients") unless @allowed_clients.nil?
  @allowed_scopes = allowed_scopes
  Jsii::Type.check_type(@allowed_scopes, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "allowedScopes") unless @allowed_scopes.nil?
  @custom_claims = custom_claims
  Jsii::Type.check_type(@custom_claims, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iZWRyb2NrYWdlbnRjb3JlLkdhdGV3YXlDdXN0b21DbGFpbSJ9LCJraW5kIjoiYXJyYXkifX0=")), "customClaims") unless @custom_claims.nil?
end

Instance Attribute Details

#allowed_audiencesArray<String>? (readonly)

Note:

Default: - No audience validation

The allowed audiences for JWT validation.

Returns:

  • (Array<String>, nil)


33
34
35
# File 'bedrock_agent_core/cognito_authorizer_props.rb', line 33

def allowed_audiences
  @allowed_audiences
end

#allowed_clientsArray<AWSCDK::Cognito::IUserPoolClient>? (readonly)

Note:

Default: - All clients are allowed

The allowed User Pool clients.

Returns:



38
39
40
# File 'bedrock_agent_core/cognito_authorizer_props.rb', line 38

def allowed_clients
  @allowed_clients
end

#allowed_scopesArray<String>? (readonly)

Note:

Default: - No scope validation

The allowed scopes for JWT validation.

Returns:

  • (Array<String>, nil)


43
44
45
# File 'bedrock_agent_core/cognito_authorizer_props.rb', line 43

def allowed_scopes
  @allowed_scopes
end

#custom_claimsArray<AWSCDK::BedrockAgentCore::GatewayCustomClaim>? (readonly)

Note:

Default: - No custom claim validation

Custom claims for additional JWT token validation.

Allows you to validate additional fields in JWT tokens beyond the standard audience, client, and scope validations.



50
51
52
# File 'bedrock_agent_core/cognito_authorizer_props.rb', line 50

def custom_claims
  @custom_claims
end

#user_poolAWSCDK::Cognito::IUserPool (readonly)

The Cognito User Pool to use for authentication.



28
29
30
# File 'bedrock_agent_core/cognito_authorizer_props.rb', line 28

def user_pool
  @user_pool
end

Class Method Details

.jsii_propertiesObject



52
53
54
55
56
57
58
59
60
# File 'bedrock_agent_core/cognito_authorizer_props.rb', line 52

def self.jsii_properties
  {
    :user_pool => "userPool",
    :allowed_audiences => "allowedAudiences",
    :allowed_clients => "allowedClients",
    :allowed_scopes => "allowedScopes",
    :custom_claims => "customClaims",
  }
end

Instance Method Details

#to_jsiiObject



62
63
64
65
66
67
68
69
70
71
72
# File 'bedrock_agent_core/cognito_authorizer_props.rb', line 62

def to_jsii
  result = {}
  result.merge!({
    "userPool" => @user_pool,
    "allowedAudiences" => @allowed_audiences,
    "allowedClients" => @allowed_clients,
    "allowedScopes" => @allowed_scopes,
    "customClaims" => @custom_claims,
  })
  result.compact
end