go function failed to run with authentication enabled
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- go, kubernetes
- Domain
- authentication, backend, distributed-systems
Research direction
Start with the Function resource's pulsar.authSecret configuration and the Go function connection setup; trace how test-auth is passed to the function and how the broker authentication settings are consumed. Use the reported connection log as the failure point, and consider the issue done when the Go function connects successfully with AuthenticationToken enabled.
Written by the indexing model from the issue text.
Description
Hi,
I have a pulsar cluster with auth enabled, using AuthenticationProviderToken.
authenticationEnabled: "true"
authenticationProviders: "org.apache.pulsar.broker.authentication.AuthenticationProviderToken"
However, the go function runs with this error.
go-function-sample-function-0 pulsar-function 2022/05/11 16:04:04.677 asm_amd64.s:1581: [info] [TCP connection established] remote_addr=pulsar://pulsar-broker.pulsar:6650 local_addr=172.20.11.22:51436
go-function-sample-function-0 pulsar-function 2022/05/11 16:04:04.682 connection.go:225: [warning] Failed to establish connection with broker: 'Unable to authenticate' remote_addr=pulsar://pulsar-broker.pulsar:6650 local_addr=172.20.11.22:51436
How does my go function use AuthenticationToken, provided in the test-auth secret, to connect the broker? Any examples?
Here's my config file:
apiVersion: compute.functionmesh.io/v1alpha1
kind: Function
metadata:
name: go-function-sample
namespace: default
spec:
image: lichuan33/pulsar-go-function:t1
forwardSourceMessageProperty: true
maxPendingAsyncRequests: 1000
replicas: 1
maxReplicas: 1
logTopic: persistent://public/default/go-function-logs
input:
topics:
- persistent://public/default/go-function-input-topic
output:
topic: persistent://public/default/go-function-output-topic
resources:
requests:
cpu: "0.1"
memory: 1G
limits:
cpu: "0.2"
memory: 1.1G
pulsar:
pulsarConfig: "test-go-pulsar"
authSecret: "test-auth"
golang:
go: /pulsar/examples/go-function
goLocation: ""
clusterName: pulsar
autoAck: true
---
apiVersion: v1
kind: ConfigMap
metadata:
name: test-go-pulsar
data:
webServiceURL: http://pulsar-broker.pulsar:8080
brokerServiceURL: pulsar://pulsar-broker.pulsar:6650
---
apiVersion: v1
kind: Secret
metadata:
name: test-auth
stringData:
clientAuthenticationPlugin: "org.apache.pulsar.client.impl.auth.AuthenticationToken"
clientAuthenticationParameters: "token:xxx.yyy.zzz"
Thanks.
- 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
-
Type/Bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
OpenNSW/nsw-srilanka#497 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
milvus-io/birdwatcher#545 ·
-
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
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
caddyserver/caddy#8046 ·