Skip to content

Feat[MQB]: add authentication with basic logic #746

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -321,12 +321,10 @@ static void test5_humanReadableSummaryTest()
<< "4 commit record(s) found.\n\n"
<< "5 ack record(s) found.\n\n"
<< "2 Queues found:\n"
<< "[ uri = \"bmq://bmq.test.persistent.priority/second-queue\" key = "
"[ 62 ]\n"
<< " partitionId = 3 appIds = [ ] ]\n"
<< "[ uri = \"bmq://bmq.test.persistent.priority/first-queue\" key = "
"[ 61 ]\n"
<< " partitionId = 2 appIds = [ ] ]\n";
<< "[ uri = \"bmq://bmq.test.persistent.priority/second-queue\" key "
"= [ 62 ] partitionId = 3 appIds = [ ] ]\n"
<< "[ uri = \"bmq://bmq.test.persistent.priority/first-queue\" key = "
"[ 61 ] partitionId = 2 appIds = [ ] ]\n";

BMQTST_ASSERT_EQ(expectedStream.str(), resultStream.str());
}
Expand Down
2 changes: 1 addition & 1 deletion src/groups/bmq/bmqimp/bmqimp_brokersession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3621,7 +3621,7 @@ void BrokerSession::processPushEvent(const bmqp::Event& event)
d_allocator_p);
if (BSLS_PERFORMANCEHINT_PREDICT_UNLIKELY(rc != 0)) {
BSLS_PERFORMANCEHINT_UNLIKELY_HINT;
BALL_LOG_ERROR << "Unable to flatten PUSH event" << " [rc: " << rc
BALL_LOG_ERROR << "Unable to flatten PUSH event [rc: " << rc
<< ", length: " << event.blob()->length()
<< ", eventMessageCount: " << eventMessageCount
<< "]" << bsl::endl
Expand Down
68 changes: 67 additions & 1 deletion src/groups/bmq/bmqp/bmqp_ctrlmsg.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
Any message sent is of either one of those top level types:
o ControlMessage
o NegotiationMessage
o AuthenticationMessage

The following convention is used for controlMessage:
Each request is just the name of the request ('openQueue',
Expand Down Expand Up @@ -1585,7 +1586,7 @@
</restriction>
</simpleType>

<!-- ========================================================================
<!-- ========================================================================
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
: NEGOTIATION MESSAGE :
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::#
Expand Down Expand Up @@ -1755,4 +1756,69 @@
<element name='clusterNodeId' type='int' default='-1'/>
</sequence>
</complexType>

<!-- ========================================================================
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
: AUTHENTICATION MESSAGE :
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::#
==================================================================== -->

<complexType name='AuthenticationMessage'>
<annotation>
<documentation>
This type is the top level type for any message being exchanged during
authentication of a connection with the broker, whether by a BlazingMQ
client or another broker.

choice.: enumerates all the different type of authentication packets

During negotiation, the process (whether a client using the libbmq SDK,
or a bmqbrkr) sends a 'authenticateRequest' message; to which the remote
peer will reply with a 'authenticateResponse' message.
</documentation>
</annotation>
<choice>
<element name='authenticateRequest' type='tns:AuthenticateRequest'/>
<element name='authenticateResponse' type='tns:AuthenticateResponse'/>
</choice>
</complexType>

<complexType name='AuthenticateRequest'>
<annotation>
<documentation>
This request is a messages sent from a client to a broker during
session initiation or reauthentication. The message indicates the client
is attempting to authenticate with the supplied authentication material
to initiate a session.

mechanism.: The authentication mechanism the client intends to use
data......: The client's authentication material
</documentation>
</annotation>
<sequence>
<element name='mechanism' type='string'/>
<element name='data' type='base64Binary' minOccurs='0'/>
</sequence>
</complexType>

<complexType name='AuthenticateResponse'>
<annotation>
<documentation>
Response of an 'AuthenticateRequest' request indicating the result of
the operation. The message is sent to a client from a broker during
authentication.

status.....: Status of the request
lifetimeMs.: The duration (in milliseconds) the client's session is
valid for. The client must re-authenticate before the
lifetime expires or it will be disconnected.
The session lifetime is undefined if this value is unset.
</documentation>
</annotation>
<sequence>
<element name='status' type='tns:Status' />
<element name='lifetimeMs' type='long' minOccurs='0'/>
</sequence>
</complexType>

</schema>
Loading
Loading