How to provide secrets with authConfig
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- java, kubernetes
- Domain
- authentication, infrastructure
Research direction
Start by tracing the Function spec entries for pulsar.authConfig, authSecret, and secretsMap, using the supplied Kubernetes YAML as the reproduction. Compare how genericAuth and the secret-backed environment variables are handled for the Java function; done means clientAuthenticationParameters and clientAuthenticationPlugin remain secret-backed while authentication succeeds.
Written by the indexing model from the issue text.
Description
Hi,
I'm trying to use authentication for a java function with the common use of Secrets to store the JWT token needed to access pulsar.
authSecret works
As I understand, the authSecret is legacy.
apiVersion: compute.functionmesh.io/v1alpha1
kind: Function
metadata:
name: test
namespace: test
spec:
className: com.test.Test
image: streamnative/pulsar-functions-java-runner:2.11.2.9
forwardSourceMessageProperty: true
maxPendingAsyncRequests: 1000
replicas: 1
maxReplicas: 3
#logTopic: persistent://test/functions.log
input:
topics:
- persistent://test/test
resources:
requests:
cpu: "100m"
memory: "1G"
limits:
cpu: "2"
memory: "2G"
pulsar:
pulsarConfig: "pulsar-config"
authSecret: "pulsar-auth"
---
apiVersion: v1
kind: ConfigMap
metadata:
namespace: test
name: pulsar-config
data:
webServiceURL: https://test:8443
brokerServiceURL: pulsar+ssl://test:6651
---
apiVersion: v1
data:
clientAuthenticationParameters: XXX # org.apache.pulsar.client.impl.auth.AuthenticationToken
clientAuthenticationPlugin: XXX # "token:eyJ..."
kind: Secret
type: Opaque
authConfig doesn't work
either combination of the approaches:
as environment variables
pulsar:
pulsarConfig: "pulsar-config"
secretsMap:
"clientAuthenticationParameters":
path: "pulsar-auth"
key: "clientAuthenticationParameters"
"clientAuthenticationPlugin":
path: "pulsar-auth"
key: "clientAuthenticationPlugin"
authConfig
pulsar:
pulsarConfig: "pulsar-config"
authConfig:
genericAuth: "pulsar-auth"
apiVersion: compute.functionmesh.io/v1alpha1
kind: Function
metadata:
name: test
namespace: test
spec:
className: com.test.Test
image: streamnative/pulsar-functions-java-runner:2.11.2.9
forwardSourceMessageProperty: true
maxPendingAsyncRequests: 1000
replicas: 1
maxReplicas: 3
#logTopic: persistent://test/functions.log
input:
topics:
- persistent://test/test
resources:
requests:
cpu: "100m"
memory: "1G"
limits:
cpu: "2"
memory: "2G"
pulsar:
pulsarConfig: "pulsar-config"
secretsMap:
"clientAuthenticationParameters":
path: "pulsar-auth"
key: "clientAuthenticationParameters"
"clientAuthenticationPlugin":
path: "pulsar-auth"
key: "clientAuthenticationPlugin"
---
apiVersion: v1
kind: ConfigMap
metadata:
namespace: test
name: pulsar-config
data:
webServiceURL: https://test:8443
brokerServiceURL: pulsar+ssl://test:6651
---
apiVersion: v1
data:
clientAuthenticationParameters: XXX # org.apache.pulsar.client.impl.auth.AuthenticationToken
clientAuthenticationPlugin: XXX # "token:eyJ..."
kind: Secret
type: Opaque
I don't want to put the Auth Token into a configmap. How is the correct approach for supplying clientAuthenticationParameters as environment variable from a secret in combination with "authConfig"?
- Dominant language
- Go
- Stars
- 228
- Forks
- 30
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 2
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from streamnative/function-mesh
-
streamnative/function-mesh#811 · 1 assignee ·
-
Difficulty 2/5 Half a day Newbie friendliness 45/100
streamnative/function-mesh#806 ·
-
streamnative/function-mesh#801 · 1 assignee ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
streamnative/function-mesh#796 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
streamnative/function-mesh#769 ·
All issues in streamnative/function-mesh
Similar issues
-
kind/bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
kubernetes-sigs/prow#953 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
caddyserver/caddy#8046 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
L1 recommended for recruits
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
area/entangle bug
Difficulty 1/5 Under an hour Newbie friendliness 92/100