This is an automated email from the ASF dual-hosted git repository.
liuyu pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pulsar-site.git
The following commit(s) were added to refs/heads/main by this push:
new f0062c73844 [improve][doc] Add sample code to use Copper Argos in C++
(#601)
f0062c73844 is described below
commit f0062c73844723a098cdecd7ad2e58507bcf0b8b
Author: Masahiro Sakamoto <[email protected]>
AuthorDate: Mon Jun 12 16:59:32 2023 +0900
[improve][doc] Add sample code to use Copper Argos in C++ (#601)
---
docs/security-athenz.md | 21 +++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
diff --git a/docs/security-athenz.md b/docs/security-athenz.md
index b3bad565b76..12a0bf403e0 100644
--- a/docs/security-athenz.md
+++ b/docs/security-athenz.md
@@ -182,7 +182,7 @@ client, err := pulsar.NewClient(pulsar.ClientOptions{
Athenz has a mechanism called [Copper
Argos](https://github.com/AthenZ/athenz/blob/master/docs/copper_argos.md). This
means that ZTS distributes an X.509 certificate and private key pair to each
service, which it can use to identify itself to other services within the
organization.
-Pulsar currently supports Copper Argos only in Java and Go. When using Copper
Argos, you need to provide at least the following four parameters:
+Currently, Pulsar supports Copper Argos in Java, C++, and Go. When using
Copper Argos, you need to provide at least the following four parameters:
* `providerDomain`
* `x509CertChain`
* `privateKey`
@@ -193,7 +193,7 @@ In this case, `tenantDomain`, `tenantService` and `keyId`
are ignored.
````mdx-code-block
<Tabs groupId="lang-choice"
defaultValue="Java"
- values={[{"label":"Java","value":"Java"},{"label":"Go","value":"Go"}]}>
+
values={[{"label":"Java","value":"Java"},{"label":"C++","value":"C++"},{"label":"Go","value":"Go"}]}>
<TabItem value="Java">
```java
@@ -213,6 +213,23 @@ PulsarClient client = PulsarClient.builder()
.build();
```
+</TabItem>
+<TabItem value="C++">
+
+```cpp
+std::string params = R"({
+ "ztsUrl": "http://localhost:9998",
+ "providerDomain": "pulsar",
+ "x509CertChain": "file:///path/to/x509cert.pem",
+ "privateKey": "file:///path/to/private.pem",
+ "caCert": "file:///path/to/cacert.pem"
+ })";
+pulsar::AuthenticationPtr auth = pulsar::AuthAthenz::create(params);
+ClientConfiguration config = ClientConfiguration();
+config.setAuth(auth);
+Client client("pulsar://my-broker.com:6650", config);
+```
+
</TabItem>
<TabItem value="Go">