Go to the documentation of this file.
42 false,
"auth_context_refcount");
63 ctx->creds = creds !=
nullptr ? creds->
Ref() :
nullptr;
72 if (sec_ctx ==
nullptr)
return nullptr;
75 if (sc->auth_context ==
nullptr) {
84 if (sc->auth_context ==
nullptr) {
111 creds !=
nullptr ? creds->
Ref() :
nullptr);
118 c->~grpc_client_security_context();
137 c->~grpc_server_security_context();
146 GRPC_API_TRACE(
"grpc_auth_context_peer_identity_property_name(ctx=%p)", 1,
148 return ctx->peer_identity_property_name();
157 "grpc_auth_context_set_peer_identity_property_name(ctx=%p, name=%s)", 2,
159 if (prop ==
nullptr) {
164 ctx->set_peer_identity_property_name(prop->
name);
170 return ctx->is_authenticated();
177 if (
ctx ==
nullptr)
return it;
185 if (
it ==
nullptr ||
it->ctx ==
nullptr)
return nullptr;
186 while (
it->index ==
it->ctx->properties().count) {
187 if (
it->ctx->chained() ==
nullptr)
return nullptr;
188 it->ctx =
it->ctx->chained();
191 if (
it->name ==
nullptr) {
192 return &
it->ctx->properties().array[
it->index++];
194 while (
it->index <
it->ctx->properties().count) {
196 &
it->ctx->properties().array[
it->index++];
198 if (strcmp(
it->name, prop->
name) == 0) {
210 GRPC_API_TRACE(
"grpc_auth_context_find_properties_by_name(ctx=%p, name=%s)",
223 ctx,
ctx->peer_identity_property_name());
236 size_t value_length) {
241 if (
value !=
nullptr) {
244 prop->
value[value_length] =
'\0';
249 const char*
value,
size_t value_length) {
251 "grpc_auth_context_add_property(ctx=%p, name=%s, value=%*.*s, "
254 (
ctx,
name, (
int)value_length, (
int)value_length,
value,
255 (
unsigned long)value_length));
272 "grpc_auth_context_add_cstring_property(ctx=%p, name=%s, value=%s)", 3,
286 "auth_context_pointer_arg");
292 return ctx ==
nullptr
324 if (
args ==
nullptr)
return nullptr;
325 for (
i = 0;
i <
args->num_args;
i++) {
327 if (
p !=
nullptr)
return p;
void grpc_server_security_context_destroy(void *ctx)
return memset(p, 0, total)
void add_cstring_property(const char *name, const char *value)
static void auth_context_pointer_arg_destroy(void *p)
void reset(T *value=nullptr)
void grpc_auth_context_add_property(grpc_auth_context *ctx, const char *name, const char *value, size_t value_length)
GPRAPI void gpr_free(void *ptr)
int grpc_auth_context_set_peer_identity_property_name(grpc_auth_context *ctx, const char *name)
grpc_security_context_extension extension
GPRAPI void * gpr_malloc(size_t size)
static struct test_ctx ctx
@ GRPC_CALL_ERROR_NOT_ON_SERVER
const grpc_auth_property * grpc_auth_property_iterator_next(grpc_auth_property_iterator *it)
grpc_arg grpc_auth_context_to_arg(grpc_auth_context *c)
grpc_core::ScopedArenaPtr arena
grpc_auth_context * grpc_call_auth_context(grpc_call *call)
grpc_auth_context * grpc_auth_context_from_arg(const grpc_arg *arg)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
grpc_client_security_context * grpc_client_security_context_create(grpc_core::Arena *arena, grpc_call_credentials *creds)
GPRAPI void * gpr_realloc(void *p, size_t size)
GPRAPI void gpr_log(const char *file, int line, gpr_log_severity severity, const char *format,...) GPR_PRINT_FORMAT_CHECK(4
grpc_auth_context * grpc_find_auth_context_in_args(const grpc_channel_args *args)
grpc_call_error grpc_call_set_credentials(grpc_call *call, grpc_call_credentials *creds)
struct grpc_call grpc_call
grpc_auth_property_array properties_
grpc_auth_property * array
static void * auth_context_pointer_arg_copy(void *p)
grpc_core::DebugOnlyTraceFlag grpc_trace_auth_context_refcount(false, "auth_context_refcount")
grpc_core::Arena * grpc_call_get_arena(grpc_call *call)
~grpc_client_security_context()
grpc_auth_property_iterator grpc_auth_context_find_properties_by_name(const grpc_auth_context *ctx, const char *name)
uint8_t grpc_call_is_client(grpc_call *call)
grpc_core::RefCountedPtr< grpc_auth_context > auth_context
void * grpc_call_context_get(grpc_call *call, grpc_context_index elem)
void grpc_call_context_set(grpc_call *call, grpc_context_index elem, void *value, void(*destroy)(void *value))
#define GRPC_AUTH_CONTEXT_ARG
int QsortCompare(const T &a, const T &b)
int grpc_auth_context_peer_is_authenticated(const grpc_auth_context *ctx)
grpc_core::ExecCtx exec_ctx
void grpc_auth_property_reset(grpc_auth_property *property)
void grpc_client_security_context_destroy(void *ctx)
grpc_auth_property_iterator grpc_auth_context_peer_identity(const grpc_auth_context *ctx)
void add_property(const char *name, const char *value, size_t value_length)
grpc_server_security_context * grpc_server_security_context_create(grpc_core::Arena *arena)
const char * grpc_auth_context_peer_identity_property_name(const grpc_auth_context *ctx)
grpc_security_context_extension extension
GPRAPI char * gpr_strdup(const char *src)
static int auth_context_pointer_cmp(void *a, void *b)
grpc::ClientContext context
static const grpc_arg_pointer_vtable auth_context_pointer_vtable
void grpc_auth_context_release(grpc_auth_context *context)
static grpc_auth_property_iterator empty_iterator
void grpc_auth_context_add_cstring_property(grpc_auth_context *ctx, const char *name, const char *value)
grpc_arg grpc_channel_arg_pointer_create(char *name, void *value, const grpc_arg_pointer_vtable *vtable)
~grpc_server_security_context()
grpc_auth_property_iterator grpc_auth_context_property_iterator(const grpc_auth_context *ctx)
RefCountedPtr< Child > Ref() GRPC_MUST_USE_RESULT
#define GRPC_API_TRACE(fmt, nargs, args)
grpc_core::RefCountedPtr< grpc_auth_context > auth_context
grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:01:15