diff --git a/docs/security-athenz.md b/docs/security-athenz.md index 6040f67664c5..de290474ee68 100644 --- a/docs/security-athenz.md +++ b/docs/security-athenz.md @@ -183,7 +183,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. -Currently, Pulsar supports Copper Argos in Java, C++, and Go. When using Copper Argos, you need to provide at least the following four parameters: +When using Copper Argos, you need to provide at least the following four parameters: * `providerDomain` * `x509CertChain` * `privateKey` @@ -194,7 +194,7 @@ In this case, `tenantDomain`, `tenantService` and `keyId` are ignored. ````mdx-code-block + values={[{"label":"Java","value":"Java"},{"label":"Python","value":"Python"},{"label":"C++","value":"C++"},{"label":"Node.js","value":"Node.js"},{"label":"Go","value":"Go"}]}> ```java @@ -214,6 +214,27 @@ PulsarClient client = PulsarClient.builder() .build(); ``` + + + +```python +authPlugin = "athenz" +authParams = """ +{ +"ztsUrl": "http://localhost:9998", +"providerDomain": "pulsar", +"x509CertChain": "file:///path/to/x509cert.pem", +"privateKey": "file:///path/to/private.pem", +"caCert": "file:///path/to/cacert.pem" +} +""" + +client = Client( + "pulsar://my-broker.com:6650", + authentication=Authentication(authPlugin, authParams), +) +``` + @@ -231,6 +252,24 @@ config.setAuth(auth); Client client("pulsar://my-broker.com:6650", config); ``` + + + +```javascript +const auth = new Pulsar.AuthenticationAthenz({ + ztsUrl: "http://localhost:9998", + providerDomain: "pulsar", + x509CertChain: "file:///path/to/x509cert.pem", + privateKey: "file:///path/to/private.pem", + caCert: "file:///path/to/cacert.pem" +}); + +const client = new Pulsar.Client({ + serviceUrl: 'pulsar://my-broker.com:6650', + authentication: auth +}); + +```