Public Attributes | List of all members
grpc_metadata_credentials_plugin Struct Reference

#include <grpc_security.h>

Public Attributes

char *(* debug_string )(void *state)
 
void(* destroy )(void *state)
 
int(* get_metadata )(void *state, grpc_auth_metadata_context context, grpc_credentials_plugin_metadata_cb cb, void *user_data, grpc_metadata creds_md[GRPC_METADATA_CREDENTIALS_PLUGIN_SYNC_MAX], size_t *num_creds_md, grpc_status_code *status, const char **error_details)
 
void * state
 
const char * type
 

Detailed Description

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.

Definition at line 424 of file grpc_security.h.

Member Data Documentation

◆ debug_string

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()

Definition at line 452 of file grpc_security.h.

◆ destroy

void(* grpc_metadata_credentials_plugin::destroy) (void *state)

Destroys the plugin state.

Definition at line 455 of file grpc_security.h.

◆ get_metadata

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[GRPC_METADATA_CREDENTIALS_PLUGIN_SYNC_MAX], 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.

Definition at line 443 of file grpc_security.h.

◆ state

void* grpc_metadata_credentials_plugin::state

State that will be set as the first parameter of the methods above.

Definition at line 458 of file grpc_security.h.

◆ type

const char* grpc_metadata_credentials_plugin::type

Type of credentials that this plugin is implementing.

Definition at line 461 of file grpc_security.h.


The documentation for this struct was generated from the following file:


grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:46