Built motion from commit 6a09e18b.|2.6.11
[motion2.git] / legacy-libs / grpc / deps / grpc / src / core / lib / security / security_connector / alts / alts_security_connector.h
1 /*
2  *
3  * Copyright 2018 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_CORE_LIB_SECURITY_SECURITY_CONNECTOR_ALTS_ALTS_SECURITY_CONNECTOR_H
20 #define GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_ALTS_ALTS_SECURITY_CONNECTOR_H
21
22 #include <grpc/support/port_platform.h>
23
24 #include "src/core/lib/security/context/security_context.h"
25 #include "src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h"
26
27 #define GRPC_ALTS_TRANSPORT_SECURITY_TYPE "alts"
28
29 /**
30  * This method creates an ALTS channel security connector.
31  *
32  * - channel_creds: channel credential instance.
33  * - request_metadata_creds: credential object which will be sent with each
34  *   request. This parameter can be nullptr.
35  * - target_name: the name of the endpoint that the channel is connecting to.
36  * - sc: address of ALTS channel security connector instance to be returned from
37  *   the method.
38  *
39  * It returns nullptr on failure.
40  */
41 grpc_core::RefCountedPtr<grpc_channel_security_connector>
42 grpc_alts_channel_security_connector_create(
43     grpc_core::RefCountedPtr<grpc_channel_credentials> channel_creds,
44     grpc_core::RefCountedPtr<grpc_call_credentials> request_metadata_creds,
45     const char* target_name);
46
47 /**
48  * This method creates an ALTS server security connector.
49  *
50  * - server_creds: server credential instance.
51  * - sc: address of ALTS server security connector instance to be returned from
52  *   the method.
53  *
54  * It returns nullptr on failure.
55  */
56 grpc_core::RefCountedPtr<grpc_server_security_connector>
57 grpc_alts_server_security_connector_create(
58     grpc_core::RefCountedPtr<grpc_server_credentials> server_creds);
59
60 namespace grpc_core {
61 namespace internal {
62
63 /* Exposed only for testing. */
64 grpc_core::RefCountedPtr<grpc_auth_context>
65 grpc_alts_auth_context_from_tsi_peer(const tsi_peer* peer);
66
67 }  // namespace internal
68 }  // namespace grpc_core
69
70 #endif /* GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_ALTS_ALTS_SECURITY_CONNECTOR_H \
71         */