|
|
|
@ -382,8 +382,7 @@ static void test_access_token_creds(void) { |
|
|
|
|
NULL}; |
|
|
|
|
GPR_ASSERT(strcmp(creds->type, GRPC_CALL_CREDENTIALS_TYPE_OAUTH2) == 0); |
|
|
|
|
grpc_call_credentials_get_request_metadata( |
|
|
|
|
&exec_ctx, creds, NULL, auth_md_ctx, check_access_token_metadata, |
|
|
|
|
creds); |
|
|
|
|
&exec_ctx, creds, NULL, auth_md_ctx, check_access_token_metadata, creds); |
|
|
|
|
grpc_exec_ctx_finish(&exec_ctx); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -443,7 +442,8 @@ static void test_oauth2_google_iam_composite_creds(void) { |
|
|
|
|
test_google_iam_authorization_token, test_google_iam_authority_selector, |
|
|
|
|
NULL); |
|
|
|
|
grpc_call_credentials *composite_creds = |
|
|
|
|
grpc_composite_call_credentials_create(oauth2_creds, google_iam_creds, NULL); |
|
|
|
|
grpc_composite_call_credentials_create(oauth2_creds, google_iam_creds, |
|
|
|
|
NULL); |
|
|
|
|
grpc_call_credentials_unref(oauth2_creds); |
|
|
|
|
grpc_call_credentials_unref(google_iam_creds); |
|
|
|
|
GPR_ASSERT( |
|
|
|
@ -488,7 +488,8 @@ static void test_channel_oauth2_google_iam_composite_creds(void) { |
|
|
|
|
grpc_call_credentials *oauth2_creds = |
|
|
|
|
grpc_access_token_credentials_create("blah", NULL); |
|
|
|
|
grpc_channel_credentials *channel_oauth2_creds = |
|
|
|
|
grpc_composite_channel_credentials_create(channel_creds, oauth2_creds, NULL); |
|
|
|
|
grpc_composite_channel_credentials_create(channel_creds, oauth2_creds, |
|
|
|
|
NULL); |
|
|
|
|
grpc_call_credentials *google_iam_creds = grpc_google_iam_credentials_create( |
|
|
|
|
test_google_iam_authorization_token, test_google_iam_authority_selector, |
|
|
|
|
NULL); |
|
|
|
@ -981,8 +982,8 @@ static void test_metadata_plugin_success(void) { |
|
|
|
|
creds = grpc_metadata_credentials_create_from_plugin(plugin, NULL); |
|
|
|
|
GPR_ASSERT(state == PLUGIN_INITIAL_STATE); |
|
|
|
|
grpc_call_credentials_get_request_metadata( |
|
|
|
|
&exec_ctx, creds, NULL, auth_md_ctx, |
|
|
|
|
on_plugin_metadata_received_success, NULL); |
|
|
|
|
&exec_ctx, creds, NULL, auth_md_ctx, on_plugin_metadata_received_success, |
|
|
|
|
NULL); |
|
|
|
|
GPR_ASSERT(state == PLUGIN_GET_METADATA_CALLED_STATE); |
|
|
|
|
grpc_call_credentials_release(creds); |
|
|
|
|
GPR_ASSERT(state == PLUGIN_DESTROY_CALLED_STATE); |
|
|
|
@ -1004,8 +1005,8 @@ static void test_metadata_plugin_failure(void) { |
|
|
|
|
creds = grpc_metadata_credentials_create_from_plugin(plugin, NULL); |
|
|
|
|
GPR_ASSERT(state == PLUGIN_INITIAL_STATE); |
|
|
|
|
grpc_call_credentials_get_request_metadata( |
|
|
|
|
&exec_ctx, creds, NULL, auth_md_ctx, |
|
|
|
|
on_plugin_metadata_received_failure, NULL); |
|
|
|
|
&exec_ctx, creds, NULL, auth_md_ctx, on_plugin_metadata_received_failure, |
|
|
|
|
NULL); |
|
|
|
|
GPR_ASSERT(state == PLUGIN_GET_METADATA_CALLED_STATE); |
|
|
|
|
grpc_call_credentials_release(creds); |
|
|
|
|
GPR_ASSERT(state == PLUGIN_DESTROY_CALLED_STATE); |
|
|
|
|