#include <grpc/support/port_platform.h>
#include "src/core/lib/security/context/security_context.h"
#include <string.h>
#include <algorithm>
#include <grpc/grpc_security.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/context.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/resource_quota/arena.h"
#include "src/core/lib/security/credentials/credentials.h"
#include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/surface/call.h"
Go to the source code of this file.
Variables | |
static const grpc_arg_pointer_vtable | auth_context_pointer_vtable |
static grpc_auth_property_iterator | empty_iterator = {nullptr, 0, nullptr} |
grpc_core::DebugOnlyTraceFlag | grpc_trace_auth_context_refcount (false, "auth_context_refcount") |
|
static |
Definition at line 290 of file security_context.cc.
|
static |
Definition at line 283 of file security_context.cc.
|
static |
Definition at line 297 of file security_context.cc.
void grpc_auth_context_add_cstring_property | ( | grpc_auth_context * | ctx, |
const char * | name, | ||
const char * | value | ||
) |
Add a C string property.
Definition at line 268 of file security_context.cc.
void grpc_auth_context_add_property | ( | grpc_auth_context * | ctx, |
const char * | name, | ||
const char * | value, | ||
size_t | value_length | ||
) |
– The following auth context methods should only be called by a server metadata
Add a property.
Definition at line 248 of file security_context.cc.
grpc_auth_property_iterator grpc_auth_context_find_properties_by_name | ( | const grpc_auth_context * | ctx, |
const char * | name | ||
) |
Finds a property in the context. May return an empty iterator (first _next will return NULL) if no property with this name was found in the context.
Definition at line 207 of file security_context.cc.
grpc_auth_context* grpc_auth_context_from_arg | ( | const grpc_arg * | arg | ) |
Definition at line 311 of file security_context.cc.
grpc_auth_property_iterator grpc_auth_context_peer_identity | ( | const grpc_auth_context * | ctx | ) |
Gets the peer identity. Returns an empty iterator (first _next will return NULL) if the peer is not authenticated.
Definition at line 218 of file security_context.cc.
const char* grpc_auth_context_peer_identity_property_name | ( | const grpc_auth_context * | ctx | ) |
Gets the name of the property that indicates the peer identity. Will return NULL if the peer is not authenticated.
Definition at line 144 of file security_context.cc.
int grpc_auth_context_peer_is_authenticated | ( | const grpc_auth_context * | ctx | ) |
Returns 1 if the peer is authenticated, 0 otherwise.
Definition at line 168 of file security_context.cc.
grpc_auth_property_iterator grpc_auth_context_property_iterator | ( | const grpc_auth_context * | ctx | ) |
Iterates over the auth context.
Definition at line 173 of file security_context.cc.
void grpc_auth_context_release | ( | grpc_auth_context * | context | ) |
Releases the auth context returned from grpc_call_auth_context.
Definition at line 94 of file security_context.cc.
int grpc_auth_context_set_peer_identity_property_name | ( | grpc_auth_context * | ctx, |
const char * | name | ||
) |
Sets the property name. Returns 1 if successful or 0 in case of failure (which means that no property with this name exists).
Definition at line 151 of file security_context.cc.
grpc_arg grpc_auth_context_to_arg | ( | grpc_auth_context * | c | ) |
Definition at line 305 of file security_context.cc.
const grpc_auth_property* grpc_auth_property_iterator_next | ( | grpc_auth_property_iterator * | it | ) |
Returns NULL when the iterator is at the end.
Definition at line 182 of file security_context.cc.
void grpc_auth_property_reset | ( | grpc_auth_property * | property | ) |
Definition at line 277 of file security_context.cc.
grpc_auth_context* grpc_call_auth_context | ( | grpc_call * | call | ) |
Gets the auth context from the call. Caller needs to call grpc_auth_context_release on the returned context.
Definition at line 69 of file security_context.cc.
grpc_call_error grpc_call_set_credentials | ( | grpc_call * | call, |
grpc_call_credentials * | creds | ||
) |
— Call specific credentials. — Sets a credentials to a call. Can only be called on the client side before grpc_call_start_batch.
Definition at line 46 of file security_context.cc.
grpc_client_security_context* grpc_client_security_context_create | ( | grpc_core::Arena * | arena, |
grpc_call_credentials * | creds | ||
) |
Definition at line 108 of file security_context.cc.
void grpc_client_security_context_destroy | ( | void * | ctx | ) |
Definition at line 114 of file security_context.cc.
grpc_auth_context* grpc_find_auth_context_in_args | ( | const grpc_channel_args * | args | ) |
Definition at line 321 of file security_context.cc.
grpc_server_security_context* grpc_server_security_context_create | ( | grpc_core::Arena * | arena | ) |
Definition at line 129 of file security_context.cc.
void grpc_server_security_context_destroy | ( | void * | ctx | ) |
Definition at line 134 of file security_context.cc.
|
static |
Definition at line 301 of file security_context.cc.
|
static |
Definition at line 142 of file security_context.cc.
grpc_core::DebugOnlyTraceFlag grpc_trace_auth_context_refcount(false, "auth_context_refcount") |