Skip to content

Commit b571a53

Browse files
authored
Merge branch 'v1.17' into workflow-reminder-policy-cli
2 parents ca0ea6f + 1839a6f commit b571a53

File tree

1 file changed

+71
-3
lines changed
  • daprdocs/content/en/reference/components-reference/supported-pubsub

1 file changed

+71
-3
lines changed

daprdocs/content/en/reference/components-reference/supported-pubsub/setup-pulsar.md

Lines changed: 71 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,21 @@ It is recommended that you use a secret reference for the client secret.
131131
The pulsar OAuth2 authenticator is not specifically complaint with OIDC so it is your responsibility to ensure fields are compliant. For example, the issuer URL must use the `https` protocol, the requested scopes include `openid`, etc.
132132
If the `oauth2TokenCAPEM` field is omitted then the system's certificate pool is used for connecting to the OAuth2 issuer if using `https`.
133133

134+
135+
**Note:** Metadata values override file values.
136+
134137
| Field | Required | Details | Example |
135138
|--------|:--------:|---------|---------|
136-
| oauth2TokenURL | N | URL to request the OIDC client_credentials token from. Must not be empty. | "https://oauth.example.com/o/oauth2/token"` |
139+
| oauth2CredentialsFile | N | JSON file with `client_id`, `client_secret`, `issuer_url`. Use this **OR** individual fields below. | `"/path/to/credentials.json"` |
140+
| oauth2TokenURL | N | URL to request the OIDC client_credentials token from. Required if not using `oauth2CredentialsFile`. | `"https://oauth.example.com/token"` |
141+
| oauth2ClientID | N | OIDC client ID. Required if not using `oauth2CredentialsFile`. | `"my-client-id"` |
142+
| oauth2ClientSecret | N | OIDC client secret. Required if using `oauth2ClientID` (not `oauth2ClientSecretPath`). | `"my-client-secret"` |
143+
| oauth2ClientSecretPath | N | Plain text file with client secret. Requires `oauth2ClientID` and `oauth2TokenURL`. | `"/path/to/client_secret.txt"` |
137144
| oauth2TokenCAPEM | N | CA PEM certificate bundle to connect to the OAuth2 issuer. If not defined, the system's certificate pool will be used. | `"---BEGIN CERTIFICATE---\n...\n---END CERTIFICATE---"` |
138-
| oauth2ClientID | N | OIDC client ID. Must not be empty. | `"my-client-id"` |
139-
| oauth2ClientSecret | N | OIDC client secret. Must not be empty. | `"my-client-secret"` |
140145
| oauth2Audiences | N | Comma separated list of audiences to request for. Must not be empty. | `"my-audience-1,my-audience-2"` |
141146
| oauth2Scopes | N | Comma separated list of scopes to request. Must not be empty. | `"openid,profile,email"` |
142147

148+
#### Using metadata fields directly
143149

144150
```yaml
145151
apiVersion: dapr.io/v1alpha1
@@ -168,6 +174,68 @@ spec:
168174
value: "openid,profile,email"
169175
```
170176

177+
#### Using a JSON credentials file
178+
179+
You can store credentials in a JSON file with the following format:
180+
181+
```json
182+
{
183+
"client_id": "my-client-id",
184+
"client_secret": "my-client-secret",
185+
"issuer_url": "https://oauth.example.com/o/oauth2/token"
186+
}
187+
```
188+
189+
```yaml
190+
apiVersion: dapr.io/v1alpha1
191+
kind: Component
192+
metadata:
193+
name: messagebus
194+
spec:
195+
type: pubsub.pulsar
196+
version: v1
197+
metadata:
198+
- name: host
199+
value: "pulsar.example.com:6650"
200+
- name: oauth2CredentialsFile
201+
value: "/path/to/oauth2/credentials.json"
202+
- name: oauth2TokenCAPEM
203+
value: "---BEGIN CERTIFICATE---\n...\n---END CERTIFICATE---"
204+
- name: oauth2Audiences
205+
value: "my.pulsar.example.com,another.pulsar.example.com"
206+
- name: oauth2Scopes
207+
value: "openid,profile,email"
208+
```
209+
210+
#### Using a plain text secret file
211+
212+
You can store just the client secret in a plain text file:
213+
214+
```yaml
215+
apiVersion: dapr.io/v1alpha1
216+
kind: Component
217+
metadata:
218+
name: messagebus
219+
spec:
220+
type: pubsub.pulsar
221+
version: v1
222+
metadata:
223+
- name: host
224+
value: "pulsar.example.com:6650"
225+
- name: oauth2TokenURL
226+
value: https://oauth.example.com/o/oauth2/token
227+
- name: oauth2ClientID
228+
value: my-client-id
229+
- name: oauth2ClientSecretPath
230+
value: "/path/to/oauth2/client_secret.txt"
231+
- name: oauth2TokenCAPEM
232+
value: "---BEGIN CERTIFICATE---\n...\n---END CERTIFICATE---"
233+
- name: oauth2Audiences
234+
value: "my.pulsar.example.com,another.pulsar.example.com"
235+
- name: oauth2Scopes
236+
value: "openid,profile,email"
237+
```
238+
171239
### Enabling message delivery retries
172240

173241
The Pulsar pub/sub component has no built-in support for retry strategies. This means that sidecar sends a message to the service only once and is not retried in case of failures. To make Dapr use more spohisticated retry policies, you can apply a [retry resiliency policy]({{% ref "retries-overview.md" %}}) to the Pulsar pub/sub component. Note that it will be the same Dapr sidecar retrying the redelivery the message to the same app instance and not other instances.

0 commit comments

Comments
 (0)