GRPC C++
1.13.0-dev
include
grpcpp
impl
codegen
security
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 GRPCPP_IMPL_CODEGEN_SECURITY_AUTH_CONTEXT_H
20
#define GRPCPP_IMPL_CODEGEN_SECURITY_AUTH_CONTEXT_H
21
22
#include <iterator>
23
#include <vector>
24
25
#include <
grpcpp/impl/codegen/config.h
>
26
#include <
grpcpp/impl/codegen/string_ref.h
>
27
28
struct
grpc_auth_context;
29
struct
grpc_auth_property;
30
struct
grpc_auth_property_iterator;
31
32
namespace
grpc
{
33
class
SecureAuthContext;
34
35
typedef
std::pair<grpc::string_ref, grpc::string_ref>
AuthProperty
;
36
37
class
AuthPropertyIterator
38
:
public
std::iterator<std::input_iterator_tag, const AuthProperty> {
39
public
:
40
~AuthPropertyIterator
();
41
AuthPropertyIterator
&
operator++
();
42
AuthPropertyIterator
operator++
(
int
);
43
bool
operator==
(
const
AuthPropertyIterator
& rhs)
const
;
44
bool
operator!=
(
const
AuthPropertyIterator
& rhs)
const
;
45
const
AuthProperty
operator*
();
46
47
protected
:
48
AuthPropertyIterator
();
49
AuthPropertyIterator
(
const
grpc_auth_property* property,
50
const
grpc_auth_property_iterator* iter);
51
52
private
:
53
friend
class
SecureAuthContext
;
54
const
grpc_auth_property* property_;
55
// The following items form a grpc_auth_property_iterator.
56
const
grpc_auth_context* ctx_;
57
size_t
index_;
58
const
char
* name_;
59
};
60
65
class
AuthContext
{
66
public
:
67
virtual
~AuthContext
() {}
68
70
virtual
bool
IsPeerAuthenticated()
const
= 0;
71
76
virtual
std::vector<grpc::string_ref> GetPeerIdentity()
const
= 0;
77
virtual
grpc::string
GetPeerIdentityPropertyName()
const
= 0;
78
80
virtual
std::vector<grpc::string_ref> FindPropertyValues(
81
const
grpc::string
& name)
const
= 0;
82
84
virtual
AuthPropertyIterator
begin()
const
= 0;
85
virtual
AuthPropertyIterator
end()
const
= 0;
86
88
virtual
void
AddProperty(
const
grpc::string
& key,
89
const
grpc::string_ref
& value) = 0;
90
virtual
bool
SetPeerIdentityPropertyName(
const
grpc::string
& name) = 0;
91
};
92
93
}
// namespace grpc
94
95
#endif // GRPCPP_IMPL_CODEGEN_SECURITY_AUTH_CONTEXT_H
config.h
grpc::AuthProperty
std::pair< grpc::string_ref, grpc::string_ref > AuthProperty
Definition:
auth_context.h:33
grpc::string
std::string string
Definition:
config.h:35
grpc::AuthContext
Class encapsulating the Authentication Information.
Definition:
auth_context.h:65
string_ref.h
grpc::AuthPropertyIterator::operator==
bool operator==(const AuthPropertyIterator &rhs) const
grpc::AuthPropertyIterator::AuthPropertyIterator
AuthPropertyIterator()
grpc
An Alarm posts the user provided tag to its associated completion queue upon expiry or cancellation...
Definition:
alarm.h:31
grpc::AuthPropertyIterator::operator*
const AuthProperty operator*()
grpc::AuthContext::~AuthContext
virtual ~AuthContext()
Definition:
auth_context.h:67
grpc::AuthPropertyIterator::operator!=
bool operator!=(const AuthPropertyIterator &rhs) const
grpc::AuthPropertyIterator::operator++
AuthPropertyIterator & operator++()
grpc::string_ref
This class is a non owning reference to a string.
Definition:
string_ref.h:41
grpc::AuthPropertyIterator
Definition:
auth_context.h:37
grpc::AuthPropertyIterator::~AuthPropertyIterator
~AuthPropertyIterator()
grpc::AuthPropertyIterator::SecureAuthContext
friend class SecureAuthContext
Definition:
auth_context.h:53
Generated on Tue May 15 2018 17:01:01 for GRPC C++ by
1.8.13