secure_server_credentials.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_INTERNAL_CPP_SERVER_SECURE_SERVER_CREDENTIALS_H
20 #define GRPC_INTERNAL_CPP_SERVER_SECURE_SERVER_CREDENTIALS_H
21 
22 #include <stddef.h>
23 
24 #include <memory>
25 #include <string>
26 
27 #include <grpc/grpc.h>
28 #include <grpc/grpc_security.h>
32 #include <grpcpp/support/config.h>
33 
35 
36 namespace grpc {
37 
38 class SecureServerCredentials;
39 
41  public:
42  static void Destroy(void* wrapper);
43 
44  static void Process(void* wrapper, grpc_auth_context* context,
45  const grpc_metadata* md, size_t num_md,
46  grpc_process_auth_metadata_done_cb cb, void* user_data);
47 
49  const std::shared_ptr<AuthMetadataProcessor>& processor)
50  : processor_(processor) {
51  if (processor && processor->IsBlocking()) {
53  }
54  }
55 
56  private:
59  void* user_data);
60  std::unique_ptr<ThreadPoolInterface> thread_pool_;
61  std::shared_ptr<AuthMetadataProcessor> processor_;
62 };
63 
65  public:
67  : creds_(creds) {}
70  }
71 
72  int AddPortToServer(const std::string& addr, grpc_server* server) override;
73 
75  const std::shared_ptr<grpc::AuthMetadataProcessor>& processor) override;
76 
78 
79  private:
81 
83  std::unique_ptr<grpc::AuthMetadataProcessorAyncWrapper> processor_;
84 };
85 
86 } // namespace grpc
87 
88 #endif // GRPC_INTERNAL_CPP_SERVER_SECURE_SERVER_CREDENTIALS_H
grpc::SecureServerCredentials::SecureServerCredentials
SecureServerCredentials(grpc_server_credentials *creds)
Definition: secure_server_credentials.h:66
grpc::AuthMetadataProcessorAyncWrapper::AuthMetadataProcessorAyncWrapper
AuthMetadataProcessorAyncWrapper(const std::shared_ptr< AuthMetadataProcessor > &processor)
Definition: secure_server_credentials.h:48
grpc_auth_context
Definition: security_context.h:63
grpc
Definition: grpcpp/alarm.h:33
grpc::AuthMetadataProcessorAyncWrapper::processor_
std::shared_ptr< AuthMetadataProcessor > processor_
Definition: secure_server_credentials.h:61
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
grpc_process_auth_metadata_done_cb
void(* grpc_process_auth_metadata_done_cb)(void *user_data, const grpc_metadata *consumed_md, size_t num_consumed_md, const grpc_metadata *response_md, size_t num_response_md, grpc_status_code status, const char *error_details)
Definition: grpc_security.h:585
grpc::AuthMetadataProcessorAyncWrapper::Process
static void Process(void *wrapper, grpc_auth_context *context, const grpc_metadata *md, size_t num_md, grpc_process_auth_metadata_done_cb cb, void *user_data)
Definition: secure_server_credentials.cc:45
grpc_security.h
grpc::AuthMetadataProcessorAyncWrapper::thread_pool_
std::unique_ptr< ThreadPoolInterface > thread_pool_
Definition: secure_server_credentials.h:60
grpc_types.h
grpc_metadata
Definition: grpc_types.h:537
thread_pool_interface.h
grpc::SecureServerCredentials::c_creds
grpc_server_credentials * c_creds()
Definition: secure_server_credentials.h:77
grpc::SecureServerCredentials
Definition: secure_server_credentials.h:64
grpc::AuthMetadataProcessorAyncWrapper::Destroy
static void Destroy(void *wrapper)
Definition: secure_server_credentials.cc:40
grpc_server_credentials_release
GRPCAPI void grpc_server_credentials_release(grpc_server_credentials *creds)
Definition: credentials.cc:95
grpc::ServerCredentials
Wrapper around grpc_server_credentials, a way to authenticate a server.
Definition: include/grpcpp/security/server_credentials.h:76
auth_metadata_processor.h
grpc.h
grpc::SecureServerCredentials::AddPortToServer
int AddPortToServer(const std::string &addr, grpc_server *server) override
Definition: secure_server_credentials.cc:101
grpc::SecureServerCredentials::~SecureServerCredentials
~SecureServerCredentials() override
Definition: secure_server_credentials.h:68
grpc_server
struct grpc_server grpc_server
Definition: grpc_types.h:65
wrapper
grpc_channel_wrapper * wrapper
Definition: src/php/ext/grpc/channel.h:48
config.h
server_credentials.h
grpc_server_credentials
Definition: src/core/lib/security/credentials/credentials.h:259
grpc::CreateDefaultThreadPool
ThreadPoolInterface * CreateDefaultThreadPool()
Definition: create_default_thread_pool.cc:39
benchmark.md
md
Definition: benchmark.py:86
server
Definition: examples/python/async_streaming/server.py:1
grpc::AuthMetadataProcessorAyncWrapper
Definition: secure_server_credentials.h:40
grpc::SecureServerCredentials::SetAuthMetadataProcessor
void SetAuthMetadataProcessor(const std::shared_ptr< grpc::AuthMetadataProcessor > &processor) override
Definition: secure_server_credentials.cc:106
grpc::SecureServerCredentials::creds_
grpc_server_credentials * creds_
Definition: secure_server_credentials.h:82
grpc::SecureServerCredentials::AsSecureServerCredentials
SecureServerCredentials * AsSecureServerCredentials() override
Definition: secure_server_credentials.h:80
grpc::AuthMetadataProcessorAyncWrapper::InvokeProcessor
void InvokeProcessor(grpc_auth_context *context, const grpc_metadata *md, size_t num_md, grpc_process_auth_metadata_done_cb cb, void *user_data)
Definition: secure_server_credentials.cc:65
grpc::SecureServerCredentials::processor_
std::unique_ptr< grpc::AuthMetadataProcessorAyncWrapper > processor_
Definition: secure_server_credentials.h:83
context
grpc::ClientContext context
Definition: istio_echo_server_lib.cc:61
addr
struct sockaddr_in addr
Definition: libuv/docs/code/tcp-echo-server/main.c:10
cb
OPENSSL_EXPORT pem_password_cb * cb
Definition: pem.h:351


grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:01:15