secure_auth_context.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_COMMON_SECURE_AUTH_CONTEXT_H
20 #define GRPC_INTERNAL_CPP_COMMON_SECURE_AUTH_CONTEXT_H
21 
22 #include <string>
23 #include <vector>
24 
25 #include <grpc/grpc_security.h>
27 #include <grpcpp/support/config.h>
29 
32 
33 namespace grpc {
34 
35 class SecureAuthContext final : public AuthContext {
36  public:
38  : ctx_(ctx != nullptr ? ctx->Ref() : nullptr) {}
39 
40  ~SecureAuthContext() override = default;
41 
42  bool IsPeerAuthenticated() const override;
43 
44  std::vector<grpc::string_ref> GetPeerIdentity() const override;
45 
47 
48  std::vector<grpc::string_ref> FindPropertyValues(
49  const std::string& name) const override;
50 
51  AuthPropertyIterator begin() const override;
52 
53  AuthPropertyIterator end() const override;
54 
55  void AddProperty(const std::string& key,
56  const grpc::string_ref& value) override;
57 
58  bool SetPeerIdentityPropertyName(const std::string& name) override;
59 
60  private:
62 };
63 
64 } // namespace grpc
65 
66 #endif // GRPC_INTERNAL_CPP_COMMON_SECURE_AUTH_CONTEXT_H
grpc::string_ref
Definition: grpcpp/impl/codegen/string_ref.h:43
grpc_auth_context
Definition: security_context.h:63
ctx
Definition: benchmark-async.c:30
grpc::SecureAuthContext::GetPeerIdentity
std::vector< grpc::string_ref > GetPeerIdentity() const override
Definition: secure_auth_context.cc:27
grpc
Definition: grpcpp/alarm.h:33
grpc::SecureAuthContext::AddProperty
void AddProperty(const std::string &key, const grpc::string_ref &value) override
Mutation functions: should only be used by an AuthMetadataProcessor.
Definition: secure_auth_context.cc:81
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
grpc::SecureAuthContext::SecureAuthContext
SecureAuthContext(grpc_auth_context *ctx)
Definition: secure_auth_context.h:37
setup.name
name
Definition: setup.py:542
grpc_security.h
grpc::SecureAuthContext::IsPeerAuthenticated
bool IsPeerAuthenticated() const override
Returns true if the peer is authenticated.
Definition: secure_auth_context.cc:94
grpc::SecureAuthContext::FindPropertyValues
std::vector< grpc::string_ref > FindPropertyValues(const std::string &name) const override
Returns all the property values with the given name.
Definition: secure_auth_context.cc:50
grpc::SecureAuthContext::end
AuthPropertyIterator end() const override
Definition: secure_auth_context.cc:77
grpc_core::RefCountedPtr< grpc_auth_context >
grpc::SecureAuthContext::begin
AuthPropertyIterator begin() const override
Iteration over all the properties.
Definition: secure_auth_context.cc:65
grpc::SecureAuthContext::GetPeerIdentityPropertyName
std::string GetPeerIdentityPropertyName() const override
Definition: secure_auth_context.cc:42
config.h
value
const char * value
Definition: hpack_parser_table.cc:165
security_context.h
grpc::SecureAuthContext
Definition: secure_auth_context.h:35
key
const char * key
Definition: hpack_parser_table.cc:164
grpc::AuthPropertyIterator
Definition: grpcpp/impl/codegen/security/auth_context.h:39
ref_counted_ptr.h
grpc::SecureAuthContext::ctx_
grpc_core::RefCountedPtr< grpc_auth_context > ctx_
Definition: secure_auth_context.h:61
grpc::SecureAuthContext::SetPeerIdentityPropertyName
bool SetPeerIdentityPropertyName(const std::string &name) override
Definition: secure_auth_context.cc:88
testing::Ref
internal::RefMatcher< T & > Ref(T &x)
Definition: cares/cares/test/gmock-1.8.0/gmock/gmock.h:8628
auth_context.h
grpc::SecureAuthContext::~SecureAuthContext
~SecureAuthContext() override=default
grpc::AuthContext
Definition: grpcpp/impl/codegen/security/auth_context.h:72
string_ref.h


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