@@ -57,55 +57,16 @@ class Dispatcher;
57
57
58
58
namespace mqba {
59
59
60
- // =======================
60
+ // ===================
61
61
// class Authenticator
62
- // =======================
62
+ // ===================
63
63
64
64
// / Authenticator for a BlazingMQ session with client or broker
65
65
class Authenticator : public mqbnet ::Authenticator {
66
66
public:
67
67
// TYPES
68
68
69
69
private:
70
- // PRIVATE TYPES
71
- struct ConnectionType {
72
- // Enum representing the type of session being negotiated, from that
73
- // side of the connection's point of view.
74
- enum Enum {
75
- e_UNKNOWN,
76
- e_CLUSTER_PROXY, // Reverse connection proxy -> broker
77
- e_CLUSTER_MEMBER, // Cluster node -> cluster node
78
- e_CLIENT, // Either SDK or Proxy -> Proxy or cluster node
79
- e_ADMIN
80
- };
81
- };
82
-
83
- // / Struct used to hold the context associated to a session being
84
- // / negotiated
85
- struct AuthenticationContext {
86
- // PUBLIC DATA
87
-
88
- // / The associated authenticatorContext, passed in by the caller.
89
- mqbnet::AuthenticatorContext* d_authenticatorContext_p;
90
-
91
- // / The channel to use for the authentication.
92
- bsl::shared_ptr<bmqio::Channel> d_channelSp;
93
-
94
- // / The callback to invoke to notify of the status of the
95
- // / authentication.
96
- mqbnet::Authenticator::AuthenticationCb d_authenticationCb;
97
-
98
- // / The negotiation message received from the remote peer.
99
- bmqp_ctrlmsg::NegotiationMessage d_authenticationMessage;
100
-
101
- // / True if this is a "reversed" connection (on either side of the
102
- // / connection).
103
- bool d_isReversed;
104
-
105
- // / The type of the session being negotiated.
106
- ConnectionType::Enum d_connectionType;
107
- };
108
-
109
70
typedef bsl::shared_ptr<AuthenticationContext> AuthenticationContextSp;
110
71
111
72
private:
@@ -127,25 +88,6 @@ class Authenticator : public mqbnet::Authenticator {
127
88
private:
128
89
// PRIVATE MANIPULATORS
129
90
130
- // / Read callback method invoked when receiving data in the specified
131
- // / `blob`, if the specified `status` indicates success. The specified
132
- // / `numNeeded` can be used to indicate if more bytes are needed in
133
- // / order to get a full message. The specified `context` holds the
134
- // / negotiation context associated to this read.
135
- void readCallback (const bmqio::Status& status,
136
- int * numNeeded,
137
- bdlbb::Blob* blob,
138
- const AuthenticationContextSp& context);
139
-
140
- // / Decode the negotiation messages received in the specified `blob` and
141
- // / store it, on success, in the corresponding member of the specified
142
- // / `context`, returning 0. Return a non-zero code on error and
143
- // / populate the specified `errorDescription` with a description of the
144
- // / error.
145
- int decodeNegotiationMessage (bsl::ostream& errorDescription,
146
- const AuthenticationContextSp& context,
147
- const bdlbb::Blob& blob);
148
-
149
91
// / Invoked when received a `ClientIdentity` negotiation message with
150
92
// / the specified `context`. Creates and return a Session on success,
151
93
// / or return a null pointer and populate the specified
@@ -176,10 +118,6 @@ class Authenticator : public mqbnet::Authenticator {
176
118
void
177
119
initiateOutboundAuthentication (const AuthenticationContextSp& context);
178
120
179
- // / Schedule a read for the negotiation of the session of the specified
180
- // / `context`.
181
- void scheduleRead (const AuthenticationContextSp& context);
182
-
183
121
public:
184
122
// TRAITS
185
123
BSLMF_NESTED_TRAIT_DECLARATION (Authenticator, bslma::UsesBslmaAllocator)
@@ -205,25 +143,19 @@ class Authenticator : public mqbnet::Authenticator {
205
143
// MANIPULATORS
206
144
// (virtual: mqbnet::Authenticator)
207
145
208
- // / Negotiate the connection on the specified `channel` associated with
209
- // / the specified negotiation `context` and invoke the specified
210
- // / `negotiationCb` once the negotiation is complete (either success or
211
- // / failure). Note that if no negotiation are needed, the
212
- // / `negotiationCb` may be invoked directly from inside the call to
213
- // / `negotiate`.
214
- void authenticate (mqbnet::AuthenticatorContext* context,
215
- const bsl::shared_ptr<bmqio::Channel>& channel,
216
- const mqbnet::Authenticator::AuthenticationCb&
217
- authenticationCb) BSLS_KEYWORD_OVERRIDE;
146
+ // / Send out outbound authentication message or reverse connection request
147
+ // / with the specified `context`.
148
+ int authenticationOutboundOrReverse (const AuthenticationContextSp& context)
149
+ BSLS_KEYWORD_OVERRIDE;
218
150
};
219
151
220
152
// ============================================================================
221
153
// INLINE DEFINITIONS
222
154
// ============================================================================
223
155
224
- // -----------------------
156
+ // -------------------
225
157
// class Authenticator
226
- // -----------------------
158
+ // -------------------
227
159
228
160
inline Authenticator&
229
161
Authenticator::setClusterCatalog (mqbblp::ClusterCatalog* value)
0 commit comments