Skip to content

Commit a7d7373

Browse files
authored
fix(cli): do not print credentials refreshed by plugins (#33398)
### Issue #33394 Closes #33394 ### Reason for this change In #32354 we started logging credentials provided by a plugin to `stderr`. In #32708 we changed the log statement in a way that the credentials would be logged to `stdout` in CI environments (but still to `stderr` in all other environments). ### Description of changes Do not log credentials. ### Describe any new or updated permissions being added n/a ### Description of how you validated changes n/a ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 9449f9c commit a7d7373

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packages/aws-cdk/lib/api/aws-auth/credential-plugins.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { inspect, format } from 'util';
1+
import { inspect } from 'util';
22
import type { CredentialProviderSource, ForReading, ForWriting, PluginProviderResult, SDKv2CompatibleCredentials, SDKv3CompatibleCredentialProvider, SDKv3CompatibleCredentials } from '@aws-cdk/cli-plugin-contract';
33
import type { AwsCredentialIdentity, AwsCredentialIdentityProvider } from '@smithy/types';
44
import { credentialsAboutToExpire, makeCachingProvider } from './provider-caching';
5-
import { debug, warning, info } from '../../logging';
5+
import { debug, warning } from '../../logging';
66
import { AuthenticationError } from '../../toolkit/error';
77
import { formatErrorMessage } from '../../util/error';
88
import { Mode } from '../plugin/mode';
@@ -151,7 +151,6 @@ function v3ProviderFromV2Credentials(x: SDKv2CompatibleCredentials): AwsCredenti
151151

152152
function refreshFromPluginProvider(current: AwsCredentialIdentity, producer: () => Promise<PluginProviderResult>): AwsCredentialIdentityProvider {
153153
return async () => {
154-
info(format(current), Date.now());
155154
if (credentialsAboutToExpire(current)) {
156155
const newCreds = await producer();
157156
if (!isV3Credentials(newCreds)) {

0 commit comments

Comments
 (0)