From 6129f329e60ccdcc69cae650f925172621807647 Mon Sep 17 00:00:00 2001 From: Tim Finnigan <87778557+tim-finnigan@users.noreply.github.com> Date: Tue, 5 Dec 2023 16:23:55 -0800 Subject: [PATCH] chore: remove warning (#926) Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- THIRD-PARTY | 133 +++++++++++++++++++++------------------------ dist/index.js | 4 -- src/assumeRole.ts | 6 -- test/index.test.ts | 22 -------- 4 files changed, 63 insertions(+), 102 deletions(-) diff --git a/THIRD-PARTY b/THIRD-PARTY index ce70e4f5a..bfc710729 100644 --- a/THIRD-PARTY +++ b/THIRD-PARTY @@ -855,6 +855,9 @@ Apache-2.0 limitations under the License. +@aws-sdk/core +Apache-2.0 + @aws-sdk/credential-provider-env Apache-2.0 Apache License @@ -3715,7 +3718,7 @@ Apache License See the License for the specific language governing permissions and limitations under the License. -@aws-sdk/types +@aws-sdk/util-endpoints Apache-2.0 Apache License Version 2.0, January 2004 @@ -3919,9 +3922,9 @@ Apache License See the License for the specific language governing permissions and limitations under the License. -@aws-sdk/util-endpoints +@aws-sdk/util-user-agent-node Apache-2.0 -Apache License + Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ @@ -4123,9 +4126,10 @@ Apache License See the License for the specific language governing permissions and limitations under the License. -@aws-sdk/util-user-agent-node + +@aws-sdk/util-utf8-browser Apache-2.0 - Apache License +Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ @@ -4327,8 +4331,7 @@ Apache-2.0 See the License for the specific language governing permissions and limitations under the License. - -@aws-sdk/util-utf8-browser +@smithy/config-resolver Apache-2.0 Apache License Version 2.0, January 2004 @@ -4532,7 +4535,7 @@ Apache License See the License for the specific language governing permissions and limitations under the License. -@smithy/config-resolver +@smithy/credential-provider-imds Apache-2.0 Apache License Version 2.0, January 2004 @@ -4736,9 +4739,9 @@ Apache License See the License for the specific language governing permissions and limitations under the License. -@smithy/credential-provider-imds +@smithy/eventstream-codec Apache-2.0 -Apache License + Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ @@ -4940,9 +4943,10 @@ Apache License See the License for the specific language governing permissions and limitations under the License. -@smithy/eventstream-codec + +@smithy/hash-node Apache-2.0 - Apache License +Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ @@ -5144,8 +5148,7 @@ Apache-2.0 See the License for the specific language governing permissions and limitations under the License. - -@smithy/hash-node +@smithy/is-array-buffer Apache-2.0 Apache License Version 2.0, January 2004 @@ -5349,7 +5352,7 @@ Apache License See the License for the specific language governing permissions and limitations under the License. -@smithy/is-array-buffer +@smithy/middleware-content-length Apache-2.0 Apache License Version 2.0, January 2004 @@ -5553,7 +5556,7 @@ Apache License See the License for the specific language governing permissions and limitations under the License. -@smithy/middleware-content-length +@smithy/middleware-endpoint Apache-2.0 Apache License Version 2.0, January 2004 @@ -5757,9 +5760,9 @@ Apache License See the License for the specific language governing permissions and limitations under the License. -@smithy/middleware-endpoint +@smithy/middleware-retry Apache-2.0 -Apache License + Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ @@ -5961,7 +5964,8 @@ Apache License See the License for the specific language governing permissions and limitations under the License. -@smithy/middleware-retry + +@smithy/middleware-serde Apache-2.0 Apache License Version 2.0, January 2004 @@ -6151,7 +6155,7 @@ Apache-2.0 same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -6166,9 +6170,9 @@ Apache-2.0 limitations under the License. -@smithy/middleware-serde +@smithy/middleware-stack Apache-2.0 - Apache License +Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ @@ -6356,7 +6360,7 @@ Apache-2.0 same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -6370,8 +6374,7 @@ Apache-2.0 See the License for the specific language governing permissions and limitations under the License. - -@smithy/middleware-stack +@smithy/node-config-provider Apache-2.0 Apache License Version 2.0, January 2004 @@ -6561,7 +6564,7 @@ Apache License same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -6575,7 +6578,7 @@ Apache License See the License for the specific language governing permissions and limitations under the License. -@smithy/node-config-provider +@smithy/node-http-handler Apache-2.0 Apache License Version 2.0, January 2004 @@ -6765,7 +6768,7 @@ Apache License same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -6779,7 +6782,7 @@ Apache License See the License for the specific language governing permissions and limitations under the License. -@smithy/node-http-handler +@smithy/property-provider Apache-2.0 Apache License Version 2.0, January 2004 @@ -6983,9 +6986,9 @@ Apache License See the License for the specific language governing permissions and limitations under the License. -@smithy/property-provider +@smithy/protocol-http Apache-2.0 -Apache License + Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ @@ -7173,7 +7176,7 @@ Apache License same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -7187,7 +7190,8 @@ Apache License See the License for the specific language governing permissions and limitations under the License. -@smithy/protocol-http + +@smithy/querystring-builder Apache-2.0 Apache License Version 2.0, January 2004 @@ -7377,7 +7381,7 @@ Apache-2.0 same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -7392,7 +7396,7 @@ Apache-2.0 limitations under the License. -@smithy/querystring-builder +@smithy/querystring-parser Apache-2.0 Apache License Version 2.0, January 2004 @@ -7597,7 +7601,7 @@ Apache-2.0 limitations under the License. -@smithy/querystring-parser +@smithy/service-error-classification Apache-2.0 Apache License Version 2.0, January 2004 @@ -7802,9 +7806,9 @@ Apache-2.0 limitations under the License. -@smithy/service-error-classification +@smithy/shared-ini-file-loader Apache-2.0 - Apache License +Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ @@ -8006,8 +8010,7 @@ Apache-2.0 See the License for the specific language governing permissions and limitations under the License. - -@smithy/shared-ini-file-loader +@smithy/signature-v4 Apache-2.0 Apache License Version 2.0, January 2004 @@ -8211,9 +8214,9 @@ Apache License See the License for the specific language governing permissions and limitations under the License. -@smithy/signature-v4 +@smithy/smithy-client Apache-2.0 -Apache License + Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ @@ -8401,7 +8404,7 @@ Apache License same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -8415,7 +8418,8 @@ Apache License See the License for the specific language governing permissions and limitations under the License. -@smithy/smithy-client + +@smithy/types Apache-2.0 Apache License Version 2.0, January 2004 @@ -8620,7 +8624,7 @@ Apache-2.0 limitations under the License. -@smithy/types +@smithy/url-parser Apache-2.0 Apache License Version 2.0, January 2004 @@ -8810,7 +8814,7 @@ Apache-2.0 same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -8825,9 +8829,9 @@ Apache-2.0 limitations under the License. -@smithy/url-parser +@smithy/util-base64 Apache-2.0 - Apache License +Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ @@ -9029,8 +9033,7 @@ Apache-2.0 See the License for the specific language governing permissions and limitations under the License. - -@smithy/util-base64 +@smithy/util-body-length-node Apache-2.0 Apache License Version 2.0, January 2004 @@ -9234,7 +9237,7 @@ Apache License See the License for the specific language governing permissions and limitations under the License. -@smithy/util-body-length-node +@smithy/util-buffer-from Apache-2.0 Apache License Version 2.0, January 2004 @@ -9438,7 +9441,7 @@ Apache License See the License for the specific language governing permissions and limitations under the License. -@smithy/util-buffer-from +@smithy/util-config-provider Apache-2.0 Apache License Version 2.0, January 2004 @@ -9628,7 +9631,7 @@ Apache License same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -9642,9 +9645,9 @@ Apache License See the License for the specific language governing permissions and limitations under the License. -@smithy/util-config-provider +@smithy/util-defaults-mode-node Apache-2.0 -Apache License + Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ @@ -9832,7 +9835,7 @@ Apache License same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -9846,9 +9849,10 @@ Apache License See the License for the specific language governing permissions and limitations under the License. -@smithy/util-defaults-mode-node + +@smithy/util-endpoints Apache-2.0 - Apache License +Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ @@ -10036,7 +10040,7 @@ Apache-2.0 same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -10050,7 +10054,6 @@ Apache-2.0 See the License for the specific language governing permissions and limitations under the License. - @smithy/util-hex-encoding Apache-2.0 Apache License @@ -11275,16 +11278,6 @@ Apache License See the License for the specific language governing permissions and limitations under the License. -@vercel/ncc -MIT -Copyright 2018 ZEIT, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - agent-base MIT diff --git a/dist/index.js b/dist/index.js index b7f723240..cecdb22d7 100644 --- a/dist/index.js +++ b/dist/index.js @@ -143,10 +143,6 @@ async function assumeRoleWithWebIdentityTokenFile(params, client, webIdentityTok } async function assumeRoleWithCredentials(params, client) { core.info('Assuming role with user credentials'); - if (!process.env['AWS_SESSION_TOKEN']) { - core.warning('To avoid using long-term AWS credentials, please update your workflows to authenticate using OpenID Connect.' + - ' See https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-amazon-web-services for more information.'); - } try { const creds = await client.send(new client_sts_1.AssumeRoleCommand({ ...params })); return creds; diff --git a/src/assumeRole.ts b/src/assumeRole.ts index e0307fce8..7806dec0f 100644 --- a/src/assumeRole.ts +++ b/src/assumeRole.ts @@ -56,12 +56,6 @@ async function assumeRoleWithWebIdentityTokenFile( async function assumeRoleWithCredentials(params: AssumeRoleCommandInput, client: STSClient) { core.info('Assuming role with user credentials'); - if (!process.env['AWS_SESSION_TOKEN']) { - core.warning( - 'To avoid using long-term AWS credentials, please update your workflows to authenticate using OpenID Connect.' + - ' See https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-amazon-web-services for more information.' - ); - } try { const creds = await client.send(new AssumeRoleCommand({ ...params })); return creds; diff --git a/test/index.test.ts b/test/index.test.ts index 98b8793ad..2fef0b6aa 100644 --- a/test/index.test.ts +++ b/test/index.test.ts @@ -105,9 +105,6 @@ describe('Configure AWS Credentials', () => { jest.spyOn(core, 'info').mockImplementation((string) => { return string; }); - jest.spyOn(core, 'warning').mockImplementation((string) => { - return string; - }); (fromEnv as jest.Mock) .mockImplementationOnce(() => () => ({ accessKeyId: FAKE_ACCESS_KEY_ID, @@ -871,23 +868,4 @@ describe('Configure AWS Credentials', () => { expect(core.setOutput).toHaveBeenCalledTimes(4); }); - - test('prints warning for access key usage and no session token', async () => { - jest.spyOn(core, 'getInput').mockImplementation(mockGetInput(ASSUME_ROLE_INPUTS)); - - await run(); - - expect(core.warning).toHaveBeenCalledWith( - 'To avoid using long-term AWS credentials, please update your workflows to authenticate using OpenID Connect.' + - ' See https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-amazon-web-services for more information.' - ); - }); - - test('skips warning for access key usage with session token', async () => { - jest.spyOn(core, 'getInput').mockImplementation(mockGetInput(DEFAULT_INPUTS)); - - await run(); - - expect(core.warning).toHaveBeenCalledTimes(0); - }); });