Class: AWSCDK::CognitoIdentitypool::RoleMappingRule
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::CognitoIdentitypool::RoleMappingRule
- Defined in:
- cognito_identitypool/role_mapping_rule.rb
Overview
Represents an Identity Pool Role Attachment role mapping rule.
Instance Attribute Summary collapse
-
#claim ⇒ String
readonly
The key sent in the token by the federated Identity Provider.
-
#claim_value ⇒ String
readonly
The value of the claim that must be matched.
-
#mapped_role ⇒ AWSCDK::IAM::IRole
readonly
The role to be assumed when the claim value is matched.
-
#match_type ⇒ AWSCDK::CognitoIdentitypool::RoleMappingMatchType?
readonly
How to match with the claim value.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(claim:, claim_value:, mapped_role:, match_type: nil) ⇒ RoleMappingRule
constructor
A new instance of RoleMappingRule.
- #to_jsii ⇒ Object
Constructor Details
#initialize(claim:, claim_value:, mapped_role:, match_type: nil) ⇒ RoleMappingRule
Returns a new instance of RoleMappingRule.
11 12 13 14 15 16 17 18 19 20 |
# File 'cognito_identitypool/role_mapping_rule.rb', line 11 def initialize(claim:, claim_value:, mapped_role:, match_type: nil) @claim = claim Jsii::Type.check_type(@claim, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "claim") @claim_value = claim_value Jsii::Type.check_type(@claim_value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "claimValue") @mapped_role = mapped_role Jsii::Type.check_type(@mapped_role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "mappedRole") @match_type = match_type Jsii::Type.check_type(@match_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29nbml0b19pZGVudGl0eXBvb2wuUm9sZU1hcHBpbmdNYXRjaFR5cGUifQ==")), "matchType") unless @match_type.nil? end |
Instance Attribute Details
#claim ⇒ String (readonly)
The key sent in the token by the federated Identity Provider.
25 26 27 |
# File 'cognito_identitypool/role_mapping_rule.rb', line 25 def claim @claim end |
#claim_value ⇒ String (readonly)
The value of the claim that must be matched.
29 30 31 |
# File 'cognito_identitypool/role_mapping_rule.rb', line 29 def claim_value @claim_value end |
#mapped_role ⇒ AWSCDK::IAM::IRole (readonly)
The role to be assumed when the claim value is matched.
33 34 35 |
# File 'cognito_identitypool/role_mapping_rule.rb', line 33 def mapped_role @mapped_role end |
#match_type ⇒ AWSCDK::CognitoIdentitypool::RoleMappingMatchType? (readonly)
Note:
Default: RoleMappingMatchType.EQUALS
How to match with the claim value.
38 39 40 |
# File 'cognito_identitypool/role_mapping_rule.rb', line 38 def match_type @match_type end |
Class Method Details
.jsii_properties ⇒ Object
40 41 42 43 44 45 46 47 |
# File 'cognito_identitypool/role_mapping_rule.rb', line 40 def self.jsii_properties { :claim => "claim", :claim_value => "claimValue", :mapped_role => "mappedRole", :match_type => "matchType", } end |
Instance Method Details
#to_jsii ⇒ Object
49 50 51 52 53 54 55 56 57 58 |
# File 'cognito_identitypool/role_mapping_rule.rb', line 49 def to_jsii result = {} result.merge!({ "claim" => @claim, "claimValue" => @claim_value, "mappedRole" => @mapped_role, "matchType" => @match_type, }) result.compact end |