From d1db8e94dccfb9569a86f9dacaad295dbd691772 Mon Sep 17 00:00:00 2001 From: Masahiro Sakamoto Date: Tue, 6 Jun 2023 17:43:12 +0900 Subject: [PATCH 1/2] Add sample code to use Copper Argos in C++ --- 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 b3bad565b769..297a187e054b 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: +Pulsar currently supports Copper Argos only 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 + values={[{"label":"Java","value":"Java"},{"label":"C++","value":"C++"},{"label":"Go","value":"Go"}]}> ```java @@ -213,6 +213,23 @@ PulsarClient client = PulsarClient.builder() .build(); ``` + + + +```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); +``` + From 8badec4177e1d9cdc8501415975a1c750e09ce86 Mon Sep 17 00:00:00 2001 From: Masahiro Sakamoto Date: Mon, 12 Jun 2023 15:30:48 +0900 Subject: [PATCH 2/2] Update docs/security-athenz.md Co-authored-by: Anonymitaet <50226895+Anonymitaet@users.noreply.github.com> --- docs/security-athenz.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/security-athenz.md b/docs/security-athenz.md index 297a187e054b..12a0bf403e06 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, C++ 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`