aws-cdk-lib
Version:
Version 2 of the AWS Cloud Development Kit library
2 lines (1 loc) • 904 B
JavaScript
;Object.defineProperty(exports,"__esModule",{value:!0}),exports.UserPoolIdentityProviderBase=void 0;const core_1=require("../../../../core"),attr_names_1=require("../../private/attr-names");class UserPoolIdentityProviderBase extends core_1.Resource{constructor(scope,id,props){super(scope,id),this.props=props,props.userPool.registerIdentityProvider(this)}configureAttributeMapping(){if(!this.props.attributeMapping)return;let mapping={};if(mapping=Object.entries(this.props.attributeMapping).filter(([k,_])=>k!=="custom").reduce((agg,[k,v])=>({...agg,[attr_names_1.StandardAttributeNames[k]]:v.attributeName}),mapping),this.props.attributeMapping.custom&&(mapping=Object.entries(this.props.attributeMapping.custom).reduce((agg,[k,v])=>({...agg,[k]:v.attributeName}),mapping)),Object.keys(mapping).length!==0)return mapping}}exports.UserPoolIdentityProviderBase=UserPoolIdentityProviderBase;