Skip to content

FIX Pulsar pubsub component initialization when using oauth2ClientSecretPath#4161

Merged
cicoyle merged 4 commits intodapr:mainfrom
MyMirelHub:fix-pulsar-file-auth
Jan 15, 2026
Merged

FIX Pulsar pubsub component initialization when using oauth2ClientSecretPath#4161
cicoyle merged 4 commits intodapr:mainfrom
MyMirelHub:fix-pulsar-file-auth

Conversation

@MyMirelHub
Copy link
Copy Markdown
Contributor

@MyMirelHub MyMirelHub commented Jan 12, 2026

Description

Fixes oauth2ClientSecretPath (which previously incorrectly looked for token instead of client secret), offloads file loading to common client credentials library, and introduces oauth2CredentialsFile for loading client_id, client_secret, and issuer_url from a JSON file.

  • oauth2ClientSecretPath: Fixed to load client secret from file (previously incorrectly looked for token)

  • oauth2CredentialsFile: New field for loading client_id, client_secret, and issuer_url from a JSON file

    • JSON format: {"client_id": "...", "client_secret": "...", "issuer_url": "..."}

Implementation Details

  • Offloaded file loading logic to common/authentication/oauth2 package
  • Added LoadCredentialsFromJSONFile function for parsing JSON credential files
  • Metadata fields override file values

Issue reference

#4162

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

@MyMirelHub MyMirelHub marked this pull request as ready for review January 12, 2026 15:36
@MyMirelHub MyMirelHub requested review from a team as code owners January 12, 2026 15:36
@MyMirelHub MyMirelHub changed the title fix(pulsar): update authentication method to use token supplier inste… FIX Pulsar pubsub component initialization when using oauth2ClientSecretPath Jan 12, 2026
@MyMirelHub MyMirelHub marked this pull request as draft January 12, 2026 16:34
@MyMirelHub MyMirelHub marked this pull request as ready for review January 13, 2026 11:58
Copy link
Copy Markdown

@atrauzzi atrauzzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like each supported format should be a separate field, for consistency and expectations. Also protects against the 🛸 future 🛸 in case we reach a point where there are too many scenarios to sort out?

Comment thread common/authentication/oauth2/clientcredentials.go Outdated
@MyMirelHub
Copy link
Copy Markdown
Contributor Author

I feel like each supported format should be a separate field, for consistency and expectations. Also protects against the 🛸 future 🛸 in case we reach a point where there are too many scenarios to sort out?

Agreed - we should split the paths/functions

      - name: oauth2CredentialsFile
        type: string
        description: |
          The path to a JSON file containing both client_id and client_secret.
        example: "/path/to/oauth2/credentials.json"
      - name: oauth2ClientSecretPath
        type: string
        description: |
          The path to a plain text file containing the OAuth Client Secret.
        example: "/path/to/oauth2/client_secret.txt"

…e supports

Signed-off-by: MyMirelHub <15373565+MyMirelHub@users.noreply.github.com>
@MyMirelHub MyMirelHub force-pushed the fix-pulsar-file-auth branch from ddb7953 to 69ae0ba Compare January 14, 2026 08:50
@cicoyle
Copy link
Copy Markdown
Contributor

cicoyle commented Jan 15, 2026

Can you open a docs PR noting the metadata fields @MyMirelHub ?

@cicoyle cicoyle added the documentation required This issue needs documentation label Jan 15, 2026
@cicoyle cicoyle added this to the v1.17 milestone Jan 15, 2026
@cicoyle
Copy link
Copy Markdown
Contributor

cicoyle commented Jan 15, 2026

Scratch that - docs PR is here

@cicoyle cicoyle merged commit 8575df0 into dapr:main Jan 15, 2026
93 of 96 checks passed
passuied pushed a commit to passuied/components-contrib that referenced this pull request Feb 14, 2026
…retPath (dapr#4161)

Signed-off-by: MyMirelHub <15373565+MyMirelHub@users.noreply.github.com>
Co-authored-by: Josh van Leeuwen <me@joshvanl.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation required This issue needs documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants