Skip to content

Commit 7666ad4

Browse files
committed
Feat[MQB]: add authentication with basic logic (#746)
Signed-off-by: Emelia Lei <wlei29@bloomberg.net>
1 parent 5118ddf commit 7666ad4

29 files changed

+18875
-21025
lines changed

src/applications/bmqstoragetool/m_bmqstoragetool_cslprinter.t.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -321,12 +321,10 @@ static void test5_humanReadableSummaryTest()
321321
<< "4 commit record(s) found.\n\n"
322322
<< "5 ack record(s) found.\n\n"
323323
<< "2 Queues found:\n"
324-
<< "[ uri = \"bmq://bmq.test.persistent.priority/second-queue\" key = "
325-
"[ 62 ]\n"
326-
<< " partitionId = 3 appIds = [ ] ]\n"
327-
<< "[ uri = \"bmq://bmq.test.persistent.priority/first-queue\" key = "
328-
"[ 61 ]\n"
329-
<< " partitionId = 2 appIds = [ ] ]\n";
324+
<< "[ uri = \"bmq://bmq.test.persistent.priority/second-queue\" key "
325+
"= [ 62 ] partitionId = 3 appIds = [ ] ]\n"
326+
<< "[ uri = \"bmq://bmq.test.persistent.priority/first-queue\" key = "
327+
"[ 61 ] partitionId = 2 appIds = [ ] ]\n";
330328

331329
BMQTST_ASSERT_EQ(expectedStream.str(), resultStream.str());
332330
}

src/groups/bmq/bmqp/bmqp_ctrlmsg.xsd

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
Any message sent is of either one of those top level types:
1717
o ControlMessage
1818
o NegotiationMessage
19+
o AuthenticationMessage
1920
2021
The following convention is used for controlMessage:
2122
Each request is just the name of the request ('openQueue',
@@ -1585,7 +1586,7 @@
15851586
</restriction>
15861587
</simpleType>
15871588

1588-
<!-- ========================================================================
1589+
<!-- ========================================================================
15891590
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
15901591
: NEGOTIATION MESSAGE :
15911592
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::#
@@ -1755,4 +1756,69 @@
17551756
<element name='clusterNodeId' type='int' default='-1'/>
17561757
</sequence>
17571758
</complexType>
1759+
1760+
<!-- ========================================================================
1761+
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
1762+
: AUTHENTICATION MESSAGE :
1763+
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::#
1764+
==================================================================== -->
1765+
1766+
<complexType name='AuthenticationMessage'>
1767+
<annotation>
1768+
<documentation>
1769+
This type is the top level type for any message being exchanged during
1770+
authentication of a connection with the broker, whether by a BlazingMQ
1771+
client or another broker.
1772+
1773+
choice.: enumerates all the different type of authentication packets
1774+
1775+
During negotiation, the process (whether a client using the libbmq SDK,
1776+
or a bmqbrkr) sends a 'authenticateRequest' message; to which the remote
1777+
peer will reply with a 'authenticateResponse' message.
1778+
</documentation>
1779+
</annotation>
1780+
<choice>
1781+
<element name='authenticateRequest' type='tns:AuthenticateRequest'/>
1782+
<element name='authenticateResponse' type='tns:AuthenticateResponse'/>
1783+
</choice>
1784+
</complexType>
1785+
1786+
<complexType name='AuthenticateRequest'>
1787+
<annotation>
1788+
<documentation>
1789+
This request is a messages sent from a client to a broker during
1790+
session initiation or reauthentication. The message indicates the client
1791+
is attempting to authenticate with the supplied authentication material
1792+
to initiate a session.
1793+
1794+
mechanism.: The authentication mechanism the client intends to use
1795+
data......: The client's authentication material
1796+
</documentation>
1797+
</annotation>
1798+
<sequence>
1799+
<element name='mechanism' type='string'/>
1800+
<element name='data' type='base64Binary' minOccurs='0'/>
1801+
</sequence>
1802+
</complexType>
1803+
1804+
<complexType name='AuthenticateResponse'>
1805+
<annotation>
1806+
<documentation>
1807+
Response of an 'AuthenticateRequest' request indicating the result of
1808+
the operation. The message is sent to a client from a broker during
1809+
authentication.
1810+
1811+
status.....: Status of the request
1812+
lifetimeMs.: The duration (in milliseconds) the client's session is
1813+
valid for. The client must re-authenticate before the
1814+
lifetime expires or it will be disconnected.
1815+
The session lifetime is undefined if this value is unset.
1816+
</documentation>
1817+
</annotation>
1818+
<sequence>
1819+
<element name='status' type='tns:Status' />
1820+
<element name='lifetimeMs' type='long' minOccurs='0'/>
1821+
</sequence>
1822+
</complexType>
1823+
17581824
</schema>

0 commit comments

Comments
 (0)