File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -168,7 +168,7 @@ def refresh
168
168
role_session_name : token_params [ 'email' ]
169
169
)
170
170
)
171
- rescue Signet ::AuthorizationError => e
171
+ rescue Signet ::AuthorizationError , Aws :: STS :: Errors :: ExpiredTokenException
172
172
retry if ( @google_client = google_oauth )
173
173
raise
174
174
rescue Aws ::STS ::Errors ::AccessDenied => e
Original file line number Diff line number Diff line change 179
179
assert_requested ( token_post )
180
180
end
181
181
end
182
+
183
+ describe 'expired Google auth token' do
184
+ before do
185
+ config [ :client ] . stub_responses (
186
+ :assume_role_with_web_identity ,
187
+ [
188
+ Aws ::STS ::Errors ::ExpiredTokenException . new ( nil , nil ) ,
189
+ { credentials : credentials }
190
+ ]
191
+ )
192
+ end
193
+
194
+ it 'refreshes Google auth token when expired' do
195
+ system . times ( 5 )
196
+ @oauth_default . once
197
+ Aws ::Google . any_instance . expects ( :google_oauth ) . returns ( oauth ) . once
198
+ Aws ::STS ::Client . new . config . credentials
199
+ end
200
+ end
182
201
end
183
202
end
You can’t perform that action at this time.
0 commit comments