@@ -57,55 +57,16 @@ class Dispatcher;
5757
5858namespace mqba {
5959
60- // =======================
60+ // ===================
6161// class Authenticator
62- // =======================
62+ // ===================
6363
6464// / Authenticator for a BlazingMQ session with client or broker
6565class Authenticator : public mqbnet ::Authenticator {
6666 public:
6767 // TYPES
6868
6969 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-
10970 typedef bsl::shared_ptr<AuthenticationContext> AuthenticationContextSp;
11071
11172 private:
@@ -127,25 +88,6 @@ class Authenticator : public mqbnet::Authenticator {
12788 private:
12889 // PRIVATE MANIPULATORS
12990
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-
14991 // / Invoked when received a `ClientIdentity` negotiation message with
15092 // / the specified `context`. Creates and return a Session on success,
15193 // / or return a null pointer and populate the specified
@@ -176,10 +118,6 @@ class Authenticator : public mqbnet::Authenticator {
176118 void
177119 initiateOutboundAuthentication (const AuthenticationContextSp& context);
178120
179- // / Schedule a read for the negotiation of the session of the specified
180- // / `context`.
181- void scheduleRead (const AuthenticationContextSp& context);
182-
183121 public:
184122 // TRAITS
185123 BSLMF_NESTED_TRAIT_DECLARATION (Authenticator, bslma::UsesBslmaAllocator)
@@ -205,25 +143,19 @@ class Authenticator : public mqbnet::Authenticator {
205143 // MANIPULATORS
206144 // (virtual: mqbnet::Authenticator)
207145
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;
218150};
219151
220152// ============================================================================
221153// INLINE DEFINITIONS
222154// ============================================================================
223155
224- // -----------------------
156+ // -------------------
225157// class Authenticator
226- // -----------------------
158+ // -------------------
227159
228160inline Authenticator&
229161Authenticator::setClusterCatalog (mqbblp::ClusterCatalog* value)
0 commit comments