GRPC Core
43.0.0
|
#include <stdbool.h>
#include <grpc/grpc.h>
#include <grpc/grpc_security_constants.h>
#include <grpc/status.h>
#include <grpc/support/port_platform.h>
Go to the source code of this file.
Data Structures | |
struct | grpc_auth_property_iterator |
struct | grpc_auth_property |
value, if not NULL, is guaranteed to be NULL terminated. More... | |
Typedefs | |
typedef struct grpc_auth_context | grpc_auth_context |
— Authentication Context. More... | |
typedef struct grpc_auth_property_iterator | grpc_auth_property_iterator |
typedef struct grpc_auth_property | grpc_auth_property |
value, if not NULL, is guaranteed to be NULL terminated. More... | |
typedef struct grpc_authorization_policy_provider | grpc_authorization_policy_provider |
EXPERIMENTAL - Subject to change. More... | |
typedef struct grpc_auth_context grpc_auth_context |
— Authentication Context.
—
typedef struct grpc_auth_property grpc_auth_property |
value, if not NULL, is guaranteed to be NULL terminated.
typedef struct grpc_auth_property_iterator grpc_auth_property_iterator |
EXPERIMENTAL - Subject to change.
An opaque type that is responsible for providing authorization policies to gRPC.
GRPCAPI void grpc_auth_context_add_cstring_property | ( | grpc_auth_context * | ctx, |
const char * | name, | ||
const char * | value | ||
) |
Add a C string property.
GRPCAPI void grpc_auth_context_add_property | ( | grpc_auth_context * | ctx, |
const char * | name, | ||
const char * | value, | ||
size_t | value_length | ||
) |
GRPCAPI 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.
GRPCAPI 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.
const GRPCAPI 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.
GRPCAPI int grpc_auth_context_peer_is_authenticated | ( | const grpc_auth_context * | ctx | ) |
Returns 1 if the peer is authenticated, 0 otherwise.
GRPCAPI grpc_auth_property_iterator grpc_auth_context_property_iterator | ( | const grpc_auth_context * | ctx | ) |
Iterates over the auth context.
GRPCAPI void grpc_auth_context_release | ( | grpc_auth_context * | context | ) |
Releases the auth context returned from grpc_call_auth_context.
GRPCAPI 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).
const GRPCAPI grpc_auth_property* grpc_auth_property_iterator_next | ( | grpc_auth_property_iterator * | it | ) |
Returns NULL when the iterator is at the end.
GRPCAPI grpc_authorization_policy_provider* grpc_authorization_policy_provider_file_watcher_create | ( | const char * | authz_policy_path, |
unsigned int | refresh_interval_sec, | ||
grpc_status_code * | code, | ||
const char ** | error_details | ||
) |
EXPERIMENTAL - Subject to change.
Creates a grpc_authorization_policy_provider by watching for gRPC authorization policy changes in filesystem.
GRPCAPI void grpc_authorization_policy_provider_release | ( | grpc_authorization_policy_provider * | provider | ) |
EXPERIMENTAL - Subject to change.
Releases grpc_authorization_policy_provider object. The creator of grpc_authorization_policy_provider is responsible for its release.
GRPCAPI grpc_authorization_policy_provider* grpc_authorization_policy_provider_static_data_create | ( | const char * | authz_policy, |
grpc_status_code * | code, | ||
const char ** | error_details | ||
) |
EXPERIMENTAL - Subject to change.
Creates a grpc_authorization_policy_provider using gRPC authorization policy from static string.
GRPCAPI 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.