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

go function failed to run with authentication enabled #362

Open
wexgjduv opened this issue May 11, 2022 · 2 comments
Open

go function failed to run with authentication enabled #362

wexgjduv opened this issue May 11, 2022 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@wexgjduv
Copy link

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.

@freeznet
Copy link
Member

freeznet commented May 14, 2022

@lichuan6 thanks for asking, but pulsar golang functions do not support auth yet. So function mesh cannot pass the auth data to golang functions.
Should add auth support to pulsar go functions, then support passing auth data to go instance via function mesh.

@freeznet freeznet added help wanted Extra attention is needed and removed compute/serverless labels May 31, 2022
@liangyuanpeng
Copy link

This PR is work for pulsar function go auth. apache/pulsar#15907

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants