|
|
@ -171,8 +171,8 @@ void grpc_server_credentials_set_auth_metadata_processor( |
|
|
|
grpc_server_credentials *creds, grpc_auth_metadata_processor processor) { |
|
|
|
grpc_server_credentials *creds, grpc_auth_metadata_processor processor) { |
|
|
|
GRPC_API_TRACE( |
|
|
|
GRPC_API_TRACE( |
|
|
|
"grpc_server_credentials_set_auth_metadata_processor(" |
|
|
|
"grpc_server_credentials_set_auth_metadata_processor(" |
|
|
|
"creds=%p, " |
|
|
|
"creds=%p, " |
|
|
|
"processor=grpc_auth_metadata_processor { process: %lx, state: %p })", |
|
|
|
"processor=grpc_auth_metadata_processor { process: %lx, state: %p })", |
|
|
|
3, (creds, (unsigned long)processor.process, processor.state)); |
|
|
|
3, (creds, (unsigned long)processor.process, processor.state)); |
|
|
|
if (creds == NULL) return; |
|
|
|
if (creds == NULL) return; |
|
|
|
if (creds->processor.destroy != NULL && creds->processor.state != NULL) { |
|
|
|
if (creds->processor.destroy != NULL && creds->processor.state != NULL) { |
|
|
@ -325,10 +325,11 @@ grpc_credentials *grpc_ssl_credentials_create( |
|
|
|
const char *pem_root_certs, grpc_ssl_pem_key_cert_pair *pem_key_cert_pair, |
|
|
|
const char *pem_root_certs, grpc_ssl_pem_key_cert_pair *pem_key_cert_pair, |
|
|
|
void *reserved) { |
|
|
|
void *reserved) { |
|
|
|
grpc_ssl_credentials *c = gpr_malloc(sizeof(grpc_ssl_credentials)); |
|
|
|
grpc_ssl_credentials *c = gpr_malloc(sizeof(grpc_ssl_credentials)); |
|
|
|
GRPC_API_TRACE("grpc_ssl_credentials_create(pem_root_certs=%s, " |
|
|
|
GRPC_API_TRACE( |
|
|
|
"pem_key_cert_pair=%p, " |
|
|
|
"grpc_ssl_credentials_create(pem_root_certs=%s, " |
|
|
|
"reserved=%p)", |
|
|
|
"pem_key_cert_pair=%p, " |
|
|
|
3, (pem_root_certs, pem_key_cert_pair, reserved)); |
|
|
|
"reserved=%p)", |
|
|
|
|
|
|
|
3, (pem_root_certs, pem_key_cert_pair, reserved)); |
|
|
|
GPR_ASSERT(reserved == NULL); |
|
|
|
GPR_ASSERT(reserved == NULL); |
|
|
|
memset(c, 0, sizeof(grpc_ssl_credentials)); |
|
|
|
memset(c, 0, sizeof(grpc_ssl_credentials)); |
|
|
|
c->base.type = GRPC_CREDENTIALS_TYPE_SSL; |
|
|
|
c->base.type = GRPC_CREDENTIALS_TYPE_SSL; |
|
|
@ -345,10 +346,10 @@ grpc_server_credentials *grpc_ssl_server_credentials_create( |
|
|
|
gpr_malloc(sizeof(grpc_ssl_server_credentials)); |
|
|
|
gpr_malloc(sizeof(grpc_ssl_server_credentials)); |
|
|
|
GRPC_API_TRACE( |
|
|
|
GRPC_API_TRACE( |
|
|
|
"grpc_ssl_server_credentials_create(" |
|
|
|
"grpc_ssl_server_credentials_create(" |
|
|
|
"pem_root_certs=%s, pem_key_cert_pairs=%p, num_key_cert_pairs=%lu, " |
|
|
|
"pem_root_certs=%s, pem_key_cert_pairs=%p, num_key_cert_pairs=%lu, " |
|
|
|
"force_client_auth=%d, reserved=%p)", 5, |
|
|
|
"force_client_auth=%d, reserved=%p)", |
|
|
|
(pem_root_certs, pem_key_cert_pairs, (unsigned long)num_key_cert_pairs, |
|
|
|
5, (pem_root_certs, pem_key_cert_pairs, (unsigned long)num_key_cert_pairs, |
|
|
|
force_client_auth, reserved)); |
|
|
|
force_client_auth, reserved)); |
|
|
|
GPR_ASSERT(reserved == NULL); |
|
|
|
GPR_ASSERT(reserved == NULL); |
|
|
|
memset(c, 0, sizeof(grpc_ssl_server_credentials)); |
|
|
|
memset(c, 0, sizeof(grpc_ssl_server_credentials)); |
|
|
|
c->base.type = GRPC_CREDENTIALS_TYPE_SSL; |
|
|
|
c->base.type = GRPC_CREDENTIALS_TYPE_SSL; |
|
|
@ -469,12 +470,12 @@ grpc_credentials *grpc_service_account_jwt_access_credentials_create( |
|
|
|
const char *json_key, gpr_timespec token_lifetime, void *reserved) { |
|
|
|
const char *json_key, gpr_timespec token_lifetime, void *reserved) { |
|
|
|
GRPC_API_TRACE( |
|
|
|
GRPC_API_TRACE( |
|
|
|
"grpc_service_account_jwt_access_credentials_create(" |
|
|
|
"grpc_service_account_jwt_access_credentials_create(" |
|
|
|
"json_key=%s, " |
|
|
|
"json_key=%s, " |
|
|
|
"token_lifetime=" |
|
|
|
"token_lifetime=" |
|
|
|
"gpr_timespec { tv_sec: %ld, tv_nsec: %d, clock_type: %d }, " |
|
|
|
"gpr_timespec { tv_sec: %ld, tv_nsec: %d, clock_type: %d }, " |
|
|
|
"reserved=%p)", |
|
|
|
"reserved=%p)", |
|
|
|
5, (json_key, (long)token_lifetime.tv_sec, |
|
|
|
5, (json_key, (long)token_lifetime.tv_sec, token_lifetime.tv_nsec, |
|
|
|
token_lifetime.tv_nsec, (int)token_lifetime.clock_type, reserved)); |
|
|
|
(int)token_lifetime.clock_type, reserved)); |
|
|
|
GPR_ASSERT(reserved == NULL); |
|
|
|
GPR_ASSERT(reserved == NULL); |
|
|
|
return grpc_service_account_jwt_access_credentials_create_from_auth_json_key( |
|
|
|
return grpc_service_account_jwt_access_credentials_create_from_auth_json_key( |
|
|
|
grpc_auth_json_key_create_from_string(json_key), token_lifetime); |
|
|
|
grpc_auth_json_key_create_from_string(json_key), token_lifetime); |
|
|
@ -748,9 +749,10 @@ grpc_credentials *grpc_refresh_token_credentials_create_from_auth_refresh_token( |
|
|
|
|
|
|
|
|
|
|
|
grpc_credentials *grpc_google_refresh_token_credentials_create( |
|
|
|
grpc_credentials *grpc_google_refresh_token_credentials_create( |
|
|
|
const char *json_refresh_token, void *reserved) { |
|
|
|
const char *json_refresh_token, void *reserved) { |
|
|
|
GRPC_API_TRACE("grpc_refresh_token_credentials_create(json_refresh_token=%s, " |
|
|
|
GRPC_API_TRACE( |
|
|
|
"reserved=%p)", |
|
|
|
"grpc_refresh_token_credentials_create(json_refresh_token=%s, " |
|
|
|
2, (json_refresh_token, reserved)); |
|
|
|
"reserved=%p)", |
|
|
|
|
|
|
|
2, (json_refresh_token, reserved)); |
|
|
|
GPR_ASSERT(reserved == NULL); |
|
|
|
GPR_ASSERT(reserved == NULL); |
|
|
|
return grpc_refresh_token_credentials_create_from_auth_refresh_token( |
|
|
|
return grpc_refresh_token_credentials_create_from_auth_refresh_token( |
|
|
|
grpc_auth_refresh_token_create_from_string(json_refresh_token)); |
|
|
|
grpc_auth_refresh_token_create_from_string(json_refresh_token)); |
|
|
@ -851,9 +853,10 @@ grpc_credentials *grpc_access_token_credentials_create(const char *access_token, |
|
|
|
grpc_access_token_credentials *c = |
|
|
|
grpc_access_token_credentials *c = |
|
|
|
gpr_malloc(sizeof(grpc_access_token_credentials)); |
|
|
|
gpr_malloc(sizeof(grpc_access_token_credentials)); |
|
|
|
char *token_md_value; |
|
|
|
char *token_md_value; |
|
|
|
GRPC_API_TRACE("grpc_access_token_credentials_create(access_token=%s, " |
|
|
|
GRPC_API_TRACE( |
|
|
|
"reserved=%p)", 2, |
|
|
|
"grpc_access_token_credentials_create(access_token=%s, " |
|
|
|
(access_token, reserved)); |
|
|
|
"reserved=%p)", |
|
|
|
|
|
|
|
2, (access_token, reserved)); |
|
|
|
GPR_ASSERT(reserved == NULL); |
|
|
|
GPR_ASSERT(reserved == NULL); |
|
|
|
memset(c, 0, sizeof(grpc_access_token_credentials)); |
|
|
|
memset(c, 0, sizeof(grpc_access_token_credentials)); |
|
|
|
c->base.type = GRPC_CREDENTIALS_TYPE_OAUTH2; |
|
|
|
c->base.type = GRPC_CREDENTIALS_TYPE_OAUTH2; |
|
|
@ -1090,9 +1093,10 @@ grpc_credentials *grpc_composite_credentials_create(grpc_credentials *creds1, |
|
|
|
grpc_credentials_array creds1_array; |
|
|
|
grpc_credentials_array creds1_array; |
|
|
|
grpc_credentials_array creds2_array; |
|
|
|
grpc_credentials_array creds2_array; |
|
|
|
grpc_composite_credentials *c; |
|
|
|
grpc_composite_credentials *c; |
|
|
|
GRPC_API_TRACE("grpc_composite_credentials_create(creds1=%p, creds2=%p, " |
|
|
|
GRPC_API_TRACE( |
|
|
|
"reserved=%p)", 3, |
|
|
|
"grpc_composite_credentials_create(creds1=%p, creds2=%p, " |
|
|
|
(creds1, creds2, reserved)); |
|
|
|
"reserved=%p)", |
|
|
|
|
|
|
|
3, (creds1, creds2, reserved)); |
|
|
|
GPR_ASSERT(reserved == NULL); |
|
|
|
GPR_ASSERT(reserved == NULL); |
|
|
|
GPR_ASSERT(creds1 != NULL); |
|
|
|
GPR_ASSERT(creds1 != NULL); |
|
|
|
GPR_ASSERT(creds2 != NULL); |
|
|
|
GPR_ASSERT(creds2 != NULL); |
|
|
@ -1195,9 +1199,10 @@ static grpc_credentials_vtable iam_vtable = { |
|
|
|
grpc_credentials *grpc_google_iam_credentials_create( |
|
|
|
grpc_credentials *grpc_google_iam_credentials_create( |
|
|
|
const char *token, const char *authority_selector, void *reserved) { |
|
|
|
const char *token, const char *authority_selector, void *reserved) { |
|
|
|
grpc_google_iam_credentials *c; |
|
|
|
grpc_google_iam_credentials *c; |
|
|
|
GRPC_API_TRACE("grpc_iam_credentials_create(token=%s, authority_selector=%s, " |
|
|
|
GRPC_API_TRACE( |
|
|
|
"reserved=%p)", |
|
|
|
"grpc_iam_credentials_create(token=%s, authority_selector=%s, " |
|
|
|
3, (token, authority_selector, reserved)); |
|
|
|
"reserved=%p)", |
|
|
|
|
|
|
|
3, (token, authority_selector, reserved)); |
|
|
|
GPR_ASSERT(reserved == NULL); |
|
|
|
GPR_ASSERT(reserved == NULL); |
|
|
|
GPR_ASSERT(token != NULL); |
|
|
|
GPR_ASSERT(token != NULL); |
|
|
|
GPR_ASSERT(authority_selector != NULL); |
|
|
|
GPR_ASSERT(authority_selector != NULL); |
|
|
|