aws-cdk-lib
Version:
Version 2 of the AWS Cloud Development Kit library
2 lines (1 loc) • 733 B
JavaScript
;Object.defineProperty(exports,"__esModule",{value:!0}),exports.buildClaimMatchValue=buildClaimMatchValue,exports.renderCustomClaim=renderCustomClaim;var types_1=()=>{var tmp=require("./types");return types_1=()=>tmp,tmp};function buildClaimMatchValue(valueType,operator,value){return valueType===types_1().CustomClaimValueType.STRING||operator===types_1().CustomClaimOperator.CONTAINS?{matchValueString:Array.isArray(value)?value[0]:value}:{matchValueStringList:value}}function renderCustomClaim(name,valueType,operator,value){return{inboundTokenClaimName:name,inboundTokenClaimValueType:valueType,authorizingClaimMatchValue:{claimMatchOperator:operator,claimMatchValue:buildClaimMatchValue(valueType,operator,value)}}}