Skip to content

Commit 8b44fdd

Browse files
committed
refactor: gross workarounds for it to build
1 parent 046c3fb commit 8b44fdd

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

packages/core/src/auth/providers/sharedCredentialsProvider.ts

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
*/
55

66
import * 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'
88
import { fromProcess } from '@aws-sdk/credential-provider-process'
9-
import { ParsedIniData, SharedConfigFiles } from '@smithy/shared-ini-file-loader'
9+
import { ParsedIniData } from '@smithy/types'
1010
import { chain } from '@aws-sdk/property-provider'
1111
import { fromInstanceMetadata, fromContainerMetadata } from '@aws-sdk/credential-provider-imds'
1212
import { fromEnv } from '@aws-sdk/credential-provider-env'
@@ -19,19 +19,19 @@ import { assertHasProps, getMissingProps, hasProps } from '../../shared/utilitie
1919
import { DefaultStsClient } from '../../shared/clients/stsClient'
2020
import { SsoAccessTokenProvider } from '../sso/ssoAccessTokenProvider'
2121
import { SsoClient } from '../sso/clients'
22-
import { toRecord } from '../../shared/utilities/collectionUtils'
2322
import {
2423
extractDataFromSection,
2524
getRequiredFields,
2625
getSectionDataOrThrow,
2726
getSectionOrThrow,
28-
isProfileSection,
2927
Profile,
3028
Section,
3129
} from '../credentials/sharedCredentials'
3230
import { SectionName, SharedCredentialsKeys } from '../credentials/types'
3331
import { SsoProfile, hasScopes, scopesSsoAccountAccess } from '../connection'
3432
import { 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

3636
const 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

packages/core/src/shared/errors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import * as vscode from 'vscode'
77
import { AWSError } from 'aws-sdk'
8-
import { ServiceException } from '@aws-sdk/smithy-client'
8+
import { ServiceException } from '@smithy/smithy-client'
99
import { isThrottlingError, isTransientError } from '@smithy/service-error-classification'
1010
import { Result } from './telemetry/telemetry'
1111
import { CancellationError } from './utilities/timeoutUtils'

src.gen/@amzn/amazon-q-developer-streaming-client/package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)