Skip to content
Merged
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
43 changes: 41 additions & 2 deletions docs/security-athenz.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand All @@ -194,7 +194,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":"C++","value":"C++"},{"label":"Go","value":"Go"}]}>
values={[{"label":"Java","value":"Java"},{"label":"Python","value":"Python"},{"label":"C++","value":"C++"},{"label":"Node.js","value":"Node.js"},{"label":"Go","value":"Go"}]}>
<TabItem value="Java">

```java
Expand All @@ -214,6 +214,27 @@ PulsarClient client = PulsarClient.builder()
.build();
```

</TabItem>
<TabItem value="Python">

```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),
)
```

</TabItem>
<TabItem value="C++">

Expand All @@ -231,6 +252,24 @@ config.setAuth(auth);
Client client("pulsar://my-broker.com:6650", config);
```

</TabItem>
<TabItem value="Node.js">

```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
});

```
</TabItem>
<TabItem value="Go">

Expand Down