@@ -47,13 +47,11 @@ const String _iamSignRegion = 'us-east-1';
4747
4848final class _LiveAwsCreds {
4949 _LiveAwsCreds ._(this .env)
50- : region =
51- env['AWS_DEFAULT_REGION' ] ?? env['AWS_REGION' ] ?? 'us-east-1' ,
50+ : region = env['AWS_DEFAULT_REGION' ] ?? env['AWS_REGION' ] ?? 'us-east-1' ,
5251 accessKey = env['AWS_ACCESS_KEY_ID' ]! ,
5352 secretKey = env['AWS_SECRET_ACCESS_KEY' ]! ,
5453 sessionToken = env['AWS_SESSION_TOKEN' ],
55- hasSessionToken =
56- (env['AWS_SESSION_TOKEN' ] ?? '' ).trim ().isNotEmpty;
54+ hasSessionToken = (env['AWS_SESSION_TOKEN' ] ?? '' ).trim ().isNotEmpty;
5755
5856 factory _LiveAwsCreds .fromEnv (Map <String , String > env) =>
5957 _LiveAwsCreds ._(env);
@@ -232,7 +230,8 @@ void _expect200OrAwsAccessDenied(
232230 expect (
233231 _awsAccessDeniedLike.hasMatch (response.body),
234232 isTrue,
235- reason: 'Expected AWS access / authorization style body, got: ${response .body }' ,
233+ reason:
234+ 'Expected AWS access / authorization style body, got: ${response .body }' ,
236235 );
237236}
238237
@@ -291,8 +290,7 @@ void main() {
291290 expect (
292291 _awsSigV4OrCredentialFailureLike.hasMatch (response.body),
293292 isTrue,
294- reason:
295- 'Expected AWS SigV4/signature/credential error in body, got '
293+ reason: 'Expected AWS SigV4/signature/credential error in body, got '
296294 'status=${response .statusCode }: ${response .body }' ,
297295 );
298296 },
@@ -301,15 +299,15 @@ void main() {
301299
302300 // IAM JSON RPC (`X-Amz-Target`) has returned 302 redirects for some clients
303301 // hitting `iam.amazonaws.com`; the Query API matches STS and is stable here.
304- test ('iam:GetUser (Query POST, XML, caller when UserName omitted)' , () async {
302+ test ('iam:GetUser (Query POST, XML, caller when UserName omitted)' ,
303+ () async {
305304 final Response response = await c.postForm (
306305 service: 'iam' ,
307306 region: _iamSignRegion,
308307 endpoint: 'iam.amazonaws.com' ,
309308 body: 'Action=GetUser&Version=2010-05-08' ,
310309 );
311- _expect200OrAwsAccessDenied (response,
312- context: 'iam:GetUser' ,
310+ _expect200OrAwsAccessDenied (response, context: 'iam:GetUser' ,
313311 onOk: (Response ok) {
314312 expect (ok.body, contains ('GetUserResponse' ));
315313 });
@@ -321,8 +319,7 @@ void main() {
321319 region: c.region,
322320 body: 'Action=DescribeRegions&Version=2016-11-15' ,
323321 );
324- _expect200OrAwsAccessDenied (response,
325- context: 'ec2:DescribeRegions' ,
322+ _expect200OrAwsAccessDenied (response, context: 'ec2:DescribeRegions' ,
326323 onOk: (Response ok) {
327324 expect (ok.body, contains ('DescribeRegionsResponse' ));
328325 expect (ok.body, contains ('regionName' ));
@@ -335,8 +332,7 @@ void main() {
335332 region: c.region,
336333 body: 'Action=ListQueues&Version=2012-11-05' ,
337334 );
338- _expect200OrAwsAccessDenied (response,
339- context: 'sqs:ListQueues' ,
335+ _expect200OrAwsAccessDenied (response, context: 'sqs:ListQueues' ,
340336 onOk: (Response ok) {
341337 expect (ok.body, contains ('ListQueuesResponse' ));
342338 });
@@ -349,8 +345,7 @@ void main() {
349345 target: 'AWSLambda_20150331.ListFunctions' ,
350346 jsonBody: '{"MaxItems":1}' ,
351347 );
352- _expect200OrAwsAccessDenied (response,
353- context: 'lambda:ListFunctions' ,
348+ _expect200OrAwsAccessDenied (response, context: 'lambda:ListFunctions' ,
354349 onOk: (Response ok) {
355350 expect (ok.body, contains ('"Functions"' ));
356351 });
@@ -363,8 +358,7 @@ void main() {
363358 target: 'TrentService.ListKeys' ,
364359 jsonBody: '{"Limit":1}' ,
365360 );
366- _expect200OrAwsAccessDenied (response,
367- context: 'kms:ListKeys' ,
361+ _expect200OrAwsAccessDenied (response, context: 'kms:ListKeys' ,
368362 onOk: (Response ok) {
369363 expect (ok.body, contains ('"Keys"' ));
370364 });
@@ -376,8 +370,7 @@ void main() {
376370 region: c.region,
377371 body: 'Action=ListTopics&Version=2010-03-31' ,
378372 );
379- _expect200OrAwsAccessDenied (response,
380- context: 'sns:ListTopics' ,
373+ _expect200OrAwsAccessDenied (response, context: 'sns:ListTopics' ,
381374 onOk: (Response ok) {
382375 expect (ok.body, contains ('ListTopicsResponse' ));
383376 });
0 commit comments