GRPC Core  44.2.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 <grpc/grpc.h>
24 #include <grpc/status.h>
26 #include <stdbool.h>
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
35 
38  size_t index;
39  const char* name;
41 
43 typedef struct grpc_auth_property {
44  char* name;
45  char* value;
46  size_t value_length;
48 
52 
56 
61 
65  const grpc_auth_context* ctx, const char* name);
66 
70  const grpc_auth_context* ctx);
71 
74  const grpc_auth_context* ctx);
75 
79 
82 
90  const char* name, const char* value,
91  size_t value_length);
92 
95  const char* name,
96  const char* value);
97 
101  grpc_auth_context* ctx, const char* name);
102 
110 
124  const char* authz_policy, grpc_status_code* code,
125  const char** error_details);
126 
142  const char* authz_policy_path, unsigned int refresh_interval_sec,
143  grpc_status_code* code, const char** error_details);
144 
152 
153 #ifdef __cplusplus
154 }
155 #endif
156 
157 #endif /* GRPC_GRPC_SECURITY_H */
grpc_auth_property_iterator::name
const char * name
Definition: grpc_security.h:39
GRPCAPI
#define GRPCAPI
Definition: port_platform.h:730
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:37
grpc_auth_context
struct grpc_auth_context grpc_auth_context
Definition: credentials.h:38
grpc_auth_property::name
char * name
Definition: grpc_security.h:44
grpc_auth_property_iterator
Definition: grpc_security.h:36
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:68
grpc_auth_property::value_length
size_t value_length
Definition: grpc_security.h:46
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:45
grpc_auth_property
value, if not NULL, is guaranteed to be NULL terminated.
Definition: grpc_security.h:43
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:108
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:38
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