34 #ifndef GRPC_INTERNAL_CORE_SECURITY_CREDENTIALS_H
35 #define GRPC_INTERNAL_CORE_SECURITY_CREDENTIALS_H
55 #define GRPC_FAKE_TRANSPORT_SECURITY_TYPE "fake"
57 #define GRPC_CREDENTIALS_TYPE_SSL "Ssl"
58 #define GRPC_CREDENTIALS_TYPE_OAUTH2 "Oauth2"
59 #define GRPC_CREDENTIALS_TYPE_JWT "Jwt"
60 #define GRPC_CREDENTIALS_TYPE_IAM "Iam"
61 #define GRPC_CREDENTIALS_TYPE_COMPOSITE "Composite"
62 #define GRPC_CREDENTIALS_TYPE_FAKE_TRANSPORT_SECURITY "FakeTransportSecurity"
64 #define GRPC_AUTHORIZATION_METADATA_KEY "Authorization"
65 #define GRPC_IAM_AUTHORIZATION_TOKEN_METADATA_KEY \
66 "x-goog-iam-authorization-token"
67 #define GRPC_IAM_AUTHORITY_SELECTOR_METADATA_KEY "x-goog-iam-authority-selector"
69 #define GRPC_GOOGLE_CLOUD_SDK_CONFIG_DIRECTORY "gcloud"
70 #define GRPC_GOOGLE_WELL_KNOWN_CREDENTIALS_FILE \
71 "application_default_credentials.json"
73 #define GRPC_SECURE_TOKEN_REFRESH_THRESHOLD_SECS 60
75 #define GRPC_COMPUTE_ENGINE_METADATA_HOST "metadata"
76 #define GRPC_COMPUTE_ENGINE_METADATA_TOKEN_PATH \
77 "/computeMetadata/v1/instance/service-accounts/default/token"
79 #define GRPC_GOOGLE_OAUTH2_SERVICE_HOST "www.googleapis.com"
80 #define GRPC_GOOGLE_OAUTH2_SERVICE_TOKEN_PATH "/oauth2/v3/token"
82 #define GRPC_SERVICE_ACCOUNT_POST_BODY_PREFIX \
83 "grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer&" \
86 #define GRPC_REFRESH_TOKEN_POST_BODY_FORMAT_STRING \
87 "client_id=%s&client_secret=%s&refresh_token=%s&grant_type=refresh_token"
104 size_t initial_capacity);
110 const char *
key,
const char *
value);
136 const char *service_url,
157 const char *service_url,
196 const char *md_value,
grpc_credentials_status
Definition: credentials.h:50
const char * value
Definition: hpack_table.c:44
grpc_credentials_md_store * jwt_md
Definition: credentials.h:256
Definition: credentials.h:131
int is_async
Definition: credentials.h:307
Definition: credentials.h:290
grpc_credentials_md * entries
Definition: credentials.h:97
Definition: credentials.h:212
int grpc_credentials_has_request_metadata_only(grpc_credentials *creds)
Definition: credentials.c:105
gpr_timespec jwt_lifetime
Definition: credentials.h:262
gpr_refcount refcount
Definition: credentials.h:100
Definition: sync_generic.h:47
void(* grpc_credentials_metadata_cb)(void *user_data, grpc_credentials_md *md_elems, size_t num_md, grpc_credentials_status status)
Definition: credentials.h:126
Definition: credentials.h:91
grpc_credentials_md_store * grpc_credentials_md_store_create(size_t initial_capacity)
Definition: credentials_metadata.c:48
An array of arguments that can be passed around.
Definition: grpc.h:111
Definition: credentials.h:279
grpc_auth_metadata_processor processor
Definition: credentials.h:224
grpc_credentials_md_store * iam_md
Definition: credentials.h:314
grpc_credentials base
Definition: credentials.h:313
grpc_oauth2_token_fetcher_credentials base
Definition: credentials.h:291
const char * type
Definition: credentials.h:222
grpc_ssl_config config
Definition: credentials.h:239
grpc_credentials_status grpc_oauth2_token_fetcher_credentials_parse_server_response(const struct grpc_httpcli_response *response, grpc_credentials_md_store **token_md, gpr_timespec *token_lifetime)
char * service_url
Definition: credentials.h:257
grpc_credentials_md_store * grpc_credentials_md_store_ref(grpc_credentials_md_store *store)
Definition: credentials_metadata.c:81
grpc_credentials_md_store * md_store
Definition: credentials.h:306
Definition: credentials.h:319
const grpc_credentials_vtable * vtable
Definition: credentials.h:146
grpc_credentials * grpc_service_account_jwt_access_credentials_create_from_auth_json_key(grpc_auth_json_key key, gpr_timespec token_lifetime)
Definition: credentials.c:437
grpc_credentials base
Definition: credentials.h:305
grpc_security_status grpc_credentials_create_security_connector(grpc_credentials *creds, const char *target, const grpc_channel_args *args, grpc_credentials *request_metadata_creds, grpc_channel_security_connector **sc, grpc_channel_args **new_args)
Definition: credentials.c:126
grpc_credentials * grpc_refresh_token_credentials_create_from_auth_refresh_token(grpc_auth_refresh_token token)
Definition: credentials.c:711
grpc_credentials * grpc_credentials_contains_type(grpc_credentials *creds, const char *type, grpc_credentials **composite_creds)
Definition: credentials.c:1123
void(* grpc_fetch_oauth2_func)(grpc_credentials_metadata_request *req, grpc_httpcli_context *http_context, grpc_pollset *pollset, grpc_httpcli_response_cb response_cb, gpr_timespec deadline)
Definition: credentials.h:273
int grpc_credentials_has_request_metadata(grpc_credentials *creds)
Definition: credentials.c:100
Definition: credentials.h:242
void grpc_credentials_md_store_add(grpc_credentials_md_store *store, gpr_slice key, gpr_slice value)
Definition: credentials_metadata.c:61
char * grpc_get_well_known_google_credentials_file_path(void)
Definition: pollset_posix.h:55
gpr_mu mu
Definition: credentials.h:281
size_t num_creds
Definition: credentials.h:172
grpc_auth_json_key key
Definition: credentials.h:261
Definition: credentials.h:220
Definition: credentials.h:145
Definition: credentials.h:170
Definition: credentials.h:297
Definition: credentials.h:96
grpc_credentials * grpc_md_only_test_credentials_create(const char *md_key, const char *md_value, int is_async)
Definition: credentials.c:782
gpr_slice value
Definition: credentials.h:93
void grpc_credentials_unref(grpc_credentials *creds)
Definition: credentials.c:88
const grpc_server_credentials_vtable * vtable
Definition: credentials.h:221
void grpc_flush_cached_google_default_credentials(void)
Definition: google_default_credentials.c:217
grpc_credentials base
Definition: credentials.h:320
grpc_credentials * connector_creds
Definition: credentials.h:322
Definition: json_token.h:94
grpc_server_credentials * grpc_fake_transport_security_server_credentials_create(void)
Definition: credentials.c:902
size_t allocated
Definition: credentials.h:99
Definition: credentials.h:52
void grpc_credentials_get_request_metadata(grpc_credentials *creds, grpc_pollset *pollset, const char *service_url, grpc_credentials_metadata_cb cb, void *user_data)
Definition: credentials.c:110
size_t num_entries
Definition: credentials.h:98
gpr_refcount refcount
Definition: credentials.h:148
grpc_credentials_md_store * access_token_md
Definition: credentials.h:299
Definition: sync_win32.h:39
Definition: credentials.h:304
void grpc_credentials_md_store_unref(grpc_credentials_md_store *store)
Definition: credentials_metadata.c:88
Definition: security_connector.h:196
gpr_timespec jwt_expiration
Definition: credentials.h:258
Definition: security_connector.h:75
Definition: credentials.h:249
Definition: security_connector.h:135
Definition: json_token.h:52
Definition: credentials.h:237
grpc_credentials base
Definition: credentials.h:298
grpc_httpcli_context httpcli_context
Definition: credentials.h:284
Definition: credentials.h:312
grpc_credentials_array inner
Definition: credentials.h:321
const char * type
Definition: credentials.h:147
grpc_credentials * grpc_fake_transport_security_credentials_create(void)
Definition: credentials.c:893
gpr_mu cache_mu
Definition: credentials.h:254
gpr_timespec token_expiration
Definition: credentials.h:283
Definition: security_connector.h:165
void grpc_server_credentials_unref(grpc_server_credentials *creds)
Definition: credentials.c:148
Definition: credentials.h:51
gpr_slice key
Definition: credentials.h:92
const grpc_credentials_array * grpc_composite_credentials_get_credentials(grpc_credentials *composite_creds)
Definition: credentials.c:1115
void grpc_credentials_md_store_add_cstrings(grpc_credentials_md_store *store, const char *key, const char *value)
Definition: credentials_metadata.c:70
void(* grpc_httpcli_response_cb)(void *user_data, const grpc_httpcli_response *response)
Definition: httpcli.h:99
grpc_server_credentials * grpc_server_credentials_ref(grpc_server_credentials *creds)
Definition: credentials.c:141
grpc_credentials * grpc_credentials_ref(grpc_credentials *creds)
Definition: credentials.c:82
grpc_credentials base
Definition: credentials.h:238
grpc_server_credentials base
Definition: credentials.h:243
grpc_credentials_md_store * access_token_md
Definition: credentials.h:282
grpc_security_status
Definition: security_connector.h:43
const char * key
Definition: hpack_table.c:43
grpc_fetch_oauth2_func fetch_func
Definition: credentials.h:285
grpc_auth_refresh_token refresh_token
Definition: credentials.h:292
grpc_security_status grpc_server_credentials_create_security_connector(grpc_server_credentials *creds, grpc_security_connector **sc)
Definition: credentials.c:163
grpc_credentials base
Definition: credentials.h:250
grpc_credentials ** creds_array
Definition: credentials.h:171
grpc_ssl_server_config config
Definition: credentials.h:244
gpr_refcount refcount
Definition: credentials.h:223
grpc_credentials base
Definition: credentials.h:280