Skip to content

Commit 27bc11d

Browse files
authored
bootstrap-shutdown-cb: AUTH edition (#48)
1 parent 0a19fc8 commit 27bc11d

File tree

2 files changed

+40
-8
lines changed

2 files changed

+40
-8
lines changed

tests/credentials_provider_imds_tests.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,11 @@ static int s_credentials_provider_imds_real_new_destroy(struct aws_allocator *al
745745
struct aws_host_resolver resolver;
746746
aws_host_resolver_init_default(&resolver, allocator, 8, &el_group);
747747

748-
struct aws_client_bootstrap *bootstrap = aws_client_bootstrap_new(allocator, &el_group, &resolver, NULL);
748+
struct aws_client_bootstrap_options bootstrap_options = {
749+
.event_loop_group = &el_group,
750+
.host_resolver = &resolver,
751+
};
752+
struct aws_client_bootstrap *bootstrap = aws_client_bootstrap_new(allocator, &bootstrap_options);
749753

750754
struct aws_credentials_provider_imds_options options = {
751755
.bootstrap = bootstrap,
@@ -805,7 +809,11 @@ static int s_credentials_provider_imds_real_success(struct aws_allocator *alloca
805809
struct aws_host_resolver resolver;
806810
aws_host_resolver_init_default(&resolver, allocator, 8, &el_group);
807811

808-
struct aws_client_bootstrap *bootstrap = aws_client_bootstrap_new(allocator, &el_group, &resolver, NULL);
812+
struct aws_client_bootstrap_options bootstrap_options = {
813+
.event_loop_group = &el_group,
814+
.host_resolver = &resolver,
815+
};
816+
struct aws_client_bootstrap *bootstrap = aws_client_bootstrap_new(allocator, &bootstrap_options);
809817

810818
struct aws_credentials_provider_imds_options options = {
811819
.bootstrap = bootstrap,

tests/credentials_provider_sts_tests.c

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,11 @@ static int s_credentials_provider_sts_direct_config_succeeds_fn(struct aws_alloc
290290
struct aws_host_resolver resolver;
291291
aws_host_resolver_init_default(&resolver, allocator, 10, &el_group);
292292

293-
struct aws_client_bootstrap *bootstrap = aws_client_bootstrap_new(allocator, &el_group, &resolver, NULL);
293+
struct aws_client_bootstrap_options bootstrap_options = {
294+
.event_loop_group = &el_group,
295+
.host_resolver = &resolver,
296+
};
297+
struct aws_client_bootstrap *bootstrap = aws_client_bootstrap_new(allocator, &bootstrap_options);
294298

295299
struct aws_credentials_provider_static_options static_options = {
296300
.access_key_id = s_access_key_cur,
@@ -371,7 +375,11 @@ static int s_credentials_provider_sts_direct_config_invalid_doc_fn(struct aws_al
371375
struct aws_host_resolver resolver;
372376
aws_host_resolver_init_default(&resolver, allocator, 10, &el_group);
373377

374-
struct aws_client_bootstrap *bootstrap = aws_client_bootstrap_new(allocator, &el_group, &resolver, NULL);
378+
struct aws_client_bootstrap_options bootstrap_options = {
379+
.event_loop_group = &el_group,
380+
.host_resolver = &resolver,
381+
};
382+
struct aws_client_bootstrap *bootstrap = aws_client_bootstrap_new(allocator, &bootstrap_options);
375383

376384
struct aws_credentials_provider_static_options static_options = {
377385
.access_key_id = s_access_key_cur,
@@ -444,7 +452,11 @@ static int s_credentials_provider_sts_direct_config_connection_failed_fn(struct
444452
struct aws_host_resolver resolver;
445453
aws_host_resolver_init_default(&resolver, allocator, 10, &el_group);
446454

447-
struct aws_client_bootstrap *bootstrap = aws_client_bootstrap_new(allocator, &el_group, &resolver, NULL);
455+
struct aws_client_bootstrap_options bootstrap_options = {
456+
.event_loop_group = &el_group,
457+
.host_resolver = &resolver,
458+
};
459+
struct aws_client_bootstrap *bootstrap = aws_client_bootstrap_new(allocator, &bootstrap_options);
448460

449461
struct aws_credentials_provider_static_options static_options = {
450462
.access_key_id = s_access_key_cur,
@@ -500,7 +512,11 @@ static int s_credentials_provider_sts_direct_config_service_fails_fn(struct aws_
500512
struct aws_host_resolver resolver;
501513
aws_host_resolver_init_default(&resolver, allocator, 10, &el_group);
502514

503-
struct aws_client_bootstrap *bootstrap = aws_client_bootstrap_new(allocator, &el_group, &resolver, NULL);
515+
struct aws_client_bootstrap_options bootstrap_options = {
516+
.event_loop_group = &el_group,
517+
.host_resolver = &resolver,
518+
};
519+
struct aws_client_bootstrap *bootstrap = aws_client_bootstrap_new(allocator, &bootstrap_options);
504520

505521
struct aws_credentials_provider_static_options static_options = {
506522
.access_key_id = s_access_key_cur,
@@ -570,7 +586,11 @@ static int s_credentials_provider_sts_from_profile_config_succeeds_fn(struct aws
570586
struct aws_host_resolver resolver;
571587
aws_host_resolver_init_default(&resolver, allocator, 10, &el_group);
572588

573-
struct aws_client_bootstrap *bootstrap = aws_client_bootstrap_new(allocator, &el_group, &resolver, NULL);
589+
struct aws_client_bootstrap_options bootstrap_options = {
590+
.event_loop_group = &el_group,
591+
.host_resolver = &resolver,
592+
};
593+
struct aws_client_bootstrap *bootstrap = aws_client_bootstrap_new(allocator, &bootstrap_options);
574594

575595
struct aws_string *config_contents = aws_string_new_from_c_str(allocator, s_soure_profile_config_file);
576596
ASSERT_SUCCESS(aws_create_profile_file(s_credentials_file_name, config_contents));
@@ -668,7 +688,11 @@ static int s_credentials_provider_sts_from_profile_config_environment_succeeds_f
668688
struct aws_host_resolver resolver;
669689
aws_host_resolver_init_default(&resolver, allocator, 10, &el_group);
670690

671-
struct aws_client_bootstrap *bootstrap = aws_client_bootstrap_new(allocator, &el_group, &resolver, NULL);
691+
struct aws_client_bootstrap_options bootstrap_options = {
692+
.event_loop_group = &el_group,
693+
.host_resolver = &resolver,
694+
};
695+
struct aws_client_bootstrap *bootstrap = aws_client_bootstrap_new(allocator, &bootstrap_options);
672696

673697
struct aws_string *config_contents = aws_string_new_from_c_str(allocator, s_env_source_config_file);
674698
ASSERT_SUCCESS(aws_create_profile_file(s_credentials_file_name, config_contents));

0 commit comments

Comments
 (0)