44 */
55
66import * as AWS from '@aws-sdk/types'
7- import { AssumeRoleParams , fromIni } from '@aws-sdk/credential-provider-ini'
7+ import { fromIni } from '@aws-sdk/credential-provider-ini'
88import { fromProcess } from '@aws-sdk/credential-provider-process'
9- import { ParsedIniData , SharedConfigFiles } from '@smithy/shared-ini-file-loader '
9+ import { ParsedIniData } from '@smithy/types '
1010import { chain } from '@aws-sdk/property-provider'
1111import { fromInstanceMetadata , fromContainerMetadata } from '@aws-sdk/credential-provider-imds'
1212import { fromEnv } from '@aws-sdk/credential-provider-env'
@@ -19,19 +19,19 @@ import { assertHasProps, getMissingProps, hasProps } from '../../shared/utilitie
1919import { DefaultStsClient } from '../../shared/clients/stsClient'
2020import { SsoAccessTokenProvider } from '../sso/ssoAccessTokenProvider'
2121import { SsoClient } from '../sso/clients'
22- import { toRecord } from '../../shared/utilities/collectionUtils'
2322import {
2423 extractDataFromSection ,
2524 getRequiredFields ,
2625 getSectionDataOrThrow ,
2726 getSectionOrThrow ,
28- isProfileSection ,
2927 Profile ,
3028 Section ,
3129} from '../credentials/sharedCredentials'
3230import { SectionName , SharedCredentialsKeys } from '../credentials/types'
3331import { SsoProfile , hasScopes , scopesSsoAccountAccess } from '../connection'
3432import { builderIdStartUrl } from '../sso/constants'
33+ // TODO: There must be a better way to import this.
34+ import { AssumeRoleParams } from '@aws-sdk/credential-provider-ini/dist-types/resolveAssumeRoleCredentials'
3535
3636const credentialSources = {
3737 ECS_CONTAINER : 'EcsContainer' ,
@@ -390,23 +390,24 @@ export class SharedCredentialsProvider implements CredentialsProvider {
390390 }
391391 }
392392
393+ // TODO: reimplement this workaround, and confirm that it is still needed.
393394 // Our credentials logic merges profiles from the credentials and config files but SDK v3 does not
394395 // This can cause odd behavior where the Toolkit can switch to a profile but not authenticate with it
395396 // So the workaround is to do give the SDK the merged profiles directly
396- const profileSections = this . sections . filter ( isProfileSection )
397- const profiles = toRecord (
398- profileSections . map ( ( s ) => s . name ) ,
399- ( k ) => this . getProfile ( k )
400- )
397+ // const profileSections = this.sections.filter(isProfileSection)
398+ // const profiles = toRecord(
399+ // profileSections.map((s) => s.name),
400+ // (k) => this.getProfile(k)
401+ // )
401402
402403 return fromIni ( {
403404 profile : this . profileName ,
404405 mfaCodeProvider : async ( mfaSerial ) => await getMfaTokenFromUser ( mfaSerial , this . profileName ) ,
405406 roleAssumer : assumeRole ,
406- loadedConfig : Promise . resolve ( {
407- credentialsFile : loadedCreds ?? profiles ,
408- configFile : { } ,
409- } as SharedConfigFiles ) ,
407+ // loadedConfig: Promise.resolve({
408+ // credentialsFile: loadedCreds ?? profiles,
409+ // configFile: {},
410+ // } as SharedConfigFiles),
410411 } )
411412 }
412413
0 commit comments