UNPKG

aws-cdk-lib

Version:

Version 2 of the AWS Cloud Development Kit library

2 lines (1 loc) 3.06 kB
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GatewayCredentialProvider=exports.CredentialProviderType=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var api_key_1=()=>{var tmp=require("./api-key");return api_key_1=()=>tmp,tmp},iam_role_1=()=>{var tmp=require("./iam-role");return iam_role_1=()=>tmp,tmp},oauth_1=()=>{var tmp=require("./oauth");return oauth_1=()=>tmp,tmp},CredentialProviderType;(function(CredentialProviderType2){CredentialProviderType2.API_KEY="API_KEY",CredentialProviderType2.OAUTH="OAUTH",CredentialProviderType2.GATEWAY_IAM_ROLE="GATEWAY_IAM_ROLE"})(CredentialProviderType||(exports.CredentialProviderType=CredentialProviderType={}));class GatewayCredentialProvider{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_bedrockagentcore.GatewayCredentialProvider",version:"2.257.0"};static fromApiKeyIdentity(provider,options={}){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_bedrockagentcore_IApiKeyCredentialProvider(provider),jsiiDeprecationWarnings().aws_cdk_lib_aws_bedrockagentcore_FromApiKeyIdentityOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.fromApiKeyIdentity),error}const binding=provider.bindForGatewayApiKeyTarget();return new(api_key_1()).ApiKeyCredentialProviderConfiguration({providerArn:binding.providerArn,secretArn:binding.secretArn,credentialLocation:options.credentialLocation})}static fromApiKeyIdentityArn(props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_bedrockagentcore_ApiKeyCredentialProviderOptions(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.fromApiKeyIdentityArn),error}return new(api_key_1()).ApiKeyCredentialProviderConfiguration(props)}static fromOauthIdentity(provider,options){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_bedrockagentcore_IOAuth2CredentialProvider(provider),jsiiDeprecationWarnings().aws_cdk_lib_aws_bedrockagentcore_FromOauthIdentityOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.fromOauthIdentity),error}const binding=provider.bindForGatewayOAuthTarget(options.scopes,options.customParameters);return new(oauth_1()).OAuthCredentialProviderConfiguration({providerArn:binding.providerArn,secretArn:binding.secretArn,scopes:binding.scopes,customParameters:binding.customParameters})}static fromOauthIdentityArn(props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_bedrockagentcore_OAuthConfiguration(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.fromOauthIdentityArn),error}return new(oauth_1()).OAuthCredentialProviderConfiguration(props)}static fromIamRole(){return new(iam_role_1()).GatewayIamRoleCredentialProviderConfig}}exports.GatewayCredentialProvider=GatewayCredentialProvider;