Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[improve][fn] Add Go support for pulsar function secrets #22768

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DavidRayner
Copy link

@DavidRayner DavidRayner commented May 23, 2024

Fixes #8425

Motivation

Currently the Java and Python pulsar functions can access secrets that are set when functions are installed, but not pulsar functions written in Go.

Modifications

  • The pulsar function runtime code has been updated so that secretsProviderClassName and secretsProviderConfig are passed to Go pulsar functions.
  • The default secretsProviderClassName for Go functions has been set to ClearTextSecretsProvider
  • Go pulsar function start-up has been updated to setup the secrets provider.
  • A new Go method GetSecretValue has been added to the FunctionContext type so that a pulsar function can retrieve secrets.

Verifying this change

  • Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:

  • A pulsar function runtime unit test has been updated to ensure that secretsProviderClassName and secretsProviderConfig are passed to the Go function.
  • New Go unit tests have been written to test the GetValue method for the two Go SecretsProvider implementations

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API

A new Go method GetSecretValue has been added to the FunctionContext type.

  • The schema
  • The default values of configurations

The default secretsProviderClassName for Go functions has been set to ClearTextSecretsProvider

  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Pulsar-site changes here: apache/pulsar-site#903

Matching PR in forked repository

PR in forked repository: DavidRayner#3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-required Your PR changes impact docs and you will update later.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[pulsar-function-go]add secrets provider for golang function
1 participant