GRPC Core
43.0.0
|
grpc_metadata_credentials plugin is an API user provided structure used to create grpc_credentials objects that can be set on a channel (composed) or a call. More...
#include <credentials.h>
Data Fields | |
int(* | get_metadata )(void *state, grpc_auth_metadata_context context, grpc_credentials_plugin_metadata_cb cb, void *user_data, grpc_metadata creds_md[4], size_t *num_creds_md, grpc_status_code *status, const char **error_details) |
The implementation of this method has to be non-blocking, but can be performed synchronously or asynchronously. More... | |
char *(* | debug_string )(void *state) |
Implements debug string of the given plugin. More... | |
void(* | destroy )(void *state) |
Destroys the plugin state. More... | |
void * | state |
State that will be set as the first parameter of the methods above. More... | |
const char * | type |
Type of credentials that this plugin is implementing. More... | |
grpc_metadata_credentials plugin is an API user provided structure used to create grpc_credentials objects that can be set on a channel (composed) or a call.
See grpc_credentials_metadata_create_from_plugin below. The grpc client stack will call the get_metadata method of the plugin for every call in scope for the credentials created from it.
char*(* grpc_metadata_credentials_plugin::debug_string) (void *state) |
Implements debug string of the given plugin.
This method returns an allocated string that the caller needs to free using gpr_free()
void(* grpc_metadata_credentials_plugin::destroy) (void *state) |
Destroys the plugin state.
int(* grpc_metadata_credentials_plugin::get_metadata) (void *state, grpc_auth_metadata_context context, grpc_credentials_plugin_metadata_cb cb, void *user_data, grpc_metadata creds_md[4], size_t *num_creds_md, grpc_status_code *status, const char **error_details) |
The implementation of this method has to be non-blocking, but can be performed synchronously or asynchronously.
If processing occurs synchronously, returns non-zero and populates creds_md, num_creds_md, status, and error_details. In this case, the caller takes ownership of the entries in creds_md and of error_details. Note that if the plugin needs to return more than GRPC_METADATA_CREDENTIALS_PLUGIN_SYNC_MAX entries in creds_md, it must return asynchronously.
If processing occurs asynchronously, returns zero and invokes cb when processing is completed. user_data will be passed as the first parameter of the callback. NOTE: cb MUST be invoked in a different thread, not from the thread in which get_metadata() is invoked.
context is the information that can be used by the plugin to create auth metadata.
void* grpc_metadata_credentials_plugin::state |
State that will be set as the first parameter of the methods above.
const char* grpc_metadata_credentials_plugin::type |
Type of credentials that this plugin is implementing.