GRPC Core  43.0.0
grpc_security.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2015 gRPC authors.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 #ifndef GRPC_GRPC_SECURITY_H
20 #define GRPC_GRPC_SECURITY_H
21 
22 #include <stdbool.h>
23 
24 #include <grpc/grpc.h>
26 #include <grpc/status.h>
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
36 
39  size_t index;
40  const char* name;
42 
44 typedef struct grpc_auth_property {
45  char* name;
46  char* value;
47  size_t value_length;
49 
53 
57 
62 
66  const grpc_auth_context* ctx, const char* name);
67 
71  const grpc_auth_context* ctx);
72 
75  const grpc_auth_context* ctx);
76 
80 
83 
91  const char* name, const char* value,
92  size_t value_length);
93 
96  const char* name,
97  const char* value);
98 
102  grpc_auth_context* ctx, const char* name);
103 
111 
125  const char* authz_policy, grpc_status_code* code,
126  const char** error_details);
127 
143  const char* authz_policy_path, unsigned int refresh_interval_sec,
144  grpc_status_code* code, const char** error_details);
145 
153 
154 #ifdef __cplusplus
155 }
156 #endif
157 
158 #endif /* GRPC_GRPC_SECURITY_H */
grpc_auth_property_iterator::name
const char * name
Definition: grpc_security.h:40
GRPCAPI
#define GRPCAPI
Definition: port_platform.h:725
grpc_auth_property_iterator
struct grpc_auth_property_iterator grpc_auth_property_iterator
grpc_auth_context_peer_is_authenticated
GRPCAPI int grpc_auth_context_peer_is_authenticated(const grpc_auth_context *ctx)
Returns 1 if the peer is authenticated, 0 otherwise.
grpc_authorization_policy_provider_file_watcher_create
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.
grpc_auth_context_release
GRPCAPI void grpc_auth_context_release(grpc_auth_context *context)
Releases the auth context returned from grpc_call_auth_context.
grpc_auth_property
struct grpc_auth_property grpc_auth_property
value, if not NULL, is guaranteed to be NULL terminated.
grpc_auth_property_iterator_next
const GRPCAPI grpc_auth_property * grpc_auth_property_iterator_next(grpc_auth_property_iterator *it)
Returns NULL when the iterator is at the end.
grpc_auth_context_set_peer_identity_property_name
GRPCAPI int grpc_auth_context_set_peer_identity_property_name(grpc_auth_context *ctx, const char *name)
Sets the property name.
grpc_auth_property_iterator::ctx
const grpc_auth_context * ctx
Definition: grpc_security.h:38
grpc_auth_context
struct grpc_auth_context grpc_auth_context
Definition: credentials.h:39
grpc_auth_property::name
char * name
Definition: grpc_security.h:45
grpc_auth_property_iterator
Definition: grpc_security.h:37
grpc_status_code
grpc_status_code
Definition: status.h:28
grpc.h
grpc_call
struct grpc_call grpc_call
A Call represents an RPC.
Definition: grpc_types.h:69
grpc_auth_property::value_length
size_t value_length
Definition: grpc_security.h:47
grpc_auth_context_add_cstring_property
GRPCAPI void grpc_auth_context_add_cstring_property(grpc_auth_context *ctx, const char *name, const char *value)
Add a C string property.
grpc_call_auth_context
GRPCAPI grpc_auth_context * grpc_call_auth_context(grpc_call *call)
Gets the auth context from the call.
grpc_auth_property::value
char * value
Definition: grpc_security.h:46
grpc_auth_property
value, if not NULL, is guaranteed to be NULL terminated.
Definition: grpc_security.h:44
grpc_auth_context_property_iterator
GRPCAPI grpc_auth_property_iterator grpc_auth_context_property_iterator(const grpc_auth_context *ctx)
Iterates over the auth context.
grpc_authorization_policy_provider
struct grpc_authorization_policy_provider grpc_authorization_policy_provider
EXPERIMENTAL - Subject to change.
Definition: grpc_security.h:109
grpc_auth_context_peer_identity
GRPCAPI grpc_auth_property_iterator grpc_auth_context_peer_identity(const grpc_auth_context *ctx)
Gets the peer identity.
grpc_authorization_policy_provider_static_data_create
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.
grpc_security_constants.h
grpc_auth_context_add_property
GRPCAPI 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
grpc_auth_context_peer_identity_property_name
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.
grpc_auth_context_find_properties_by_name
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.
grpc_auth_property_iterator::index
size_t index
Definition: grpc_security.h:39
grpc_authorization_policy_provider_release
GRPCAPI void grpc_authorization_policy_provider_release(grpc_authorization_policy_provider *provider)
EXPERIMENTAL - Subject to change.
status.h
port_platform.h