File tree Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ Unreleased Changes
33
44* Issue - Add service identifiers to GlobalConfig's list of identifiers outside of autoload (#3113 ).
55
6+ * Issue - Ignore invalid ARNs when trying to parse accountId in assume role credentials.
7+
683.208.0 (2024-09-23)
79------------------
810
Original file line number Diff line number Diff line change @@ -64,11 +64,17 @@ def initialize(options = {})
6464 def refresh
6565 c = @client . assume_role ( @assume_role_params )
6666 creds = c . credentials
67+ account_id =
68+ begin
69+ ARNParser . parse ( c . assumed_role_user . arn ) . account_id
70+ rescue Aws ::Errors ::InvalidARNError
71+ nil
72+ end
6773 @credentials = Credentials . new (
6874 creds . access_key_id ,
6975 creds . secret_access_key ,
7076 creds . session_token ,
71- account_id : ARNParser . parse ( c . assumed_role_user . arn ) . account_id
77+ account_id : account_id
7278 )
7379 @expiration = creds . expiration
7480 end
Original file line number Diff line number Diff line change @@ -75,11 +75,17 @@ def refresh
7575
7676 c = @client . assume_role_with_web_identity ( @assume_role_web_identity_params )
7777 creds = c . credentials
78+ account_id =
79+ begin
80+ ARNParser . parse ( c . assumed_role_user . arn ) . account_id
81+ rescue Aws ::Errors ::InvalidARNError
82+ nil
83+ end
7884 @credentials = Credentials . new (
7985 creds . access_key_id ,
8086 creds . secret_access_key ,
8187 creds . session_token ,
82- account_id : ARNParser . parse ( c . assumed_role_user . arn ) . account_id
88+ account_id : account_id
8389 )
8490 @expiration = creds . expiration
8591 end
You can’t perform that action at this time.
0 commit comments