GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [fix][fn] enable Go function token auth and TLS by flowchartsman · Pull Request #20468 · apache/pulsar

Conversation

@flowchartsman

@flowchartsman flowchartsman commented Jun 1, 2023

Copy link
Copy Markdown
Contributor

Fixes #20451

Motivation

Go functions die when auth is turned on. I would like them to not die.

Modifications

Added transport of auth plugin and auth plugin params to go instance config.
Added parsing of these values into the pf sdk

Verifying this change

  • Make sure that the change passes the CI checks.
  • Cannot integration test functions with auth

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
  • The schema
  • The default values of configurations
  • 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

No doc change needed, because the docs don't mention the exception, so now the intuitive assumption holds.

Matching PR in forked repository

PR in forked repository: flowchartsman#6

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
flowchartsman and others added 4 commits May 31, 2023 15:01
@flowchartsman
Rest idle timer and drain if appt during main loop
f797ba3
Fix apache#20449
@flowchartsman
WIP - Go Function auth support
6a58fb9
This is the intial checkin of the work on apache#20451, currently
supporting org.apache.pulsar.client.impl.auth/AuthenticationToken only.
@flowchartsman
Add support for plaintext token
c488806
@flowchartsman
Merge branch 'apache:master' into go_functions_get_authspec
e788a49
@github-actions github-actions Bot added the doc-not-needed Your PR changes do not impact docs label Jun 1, 2023
@flowchartsman

flowchartsman commented Jun 1, 2023

Copy link
Copy Markdown
Contributor Author

NOTE Unless I missed something there are no unit integration tests for functions that enable auth. The closest I could find was the tests in tests/integration/src/test/java/org/apache/pulsar/tests/integration/functions/PulsarFunctionsTest.java, however it makes no mention of auth. I'm not familiar enough with the testing framework of the product to know if there's a way to easily run one of these tests with auth enabled, so if we want those tests, I'm going to need some assistance.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

michaeljmarshall
michaeljmarshall approved these changes Jun 1, 2023
View reviewed changes

@michaeljmarshall michaeljmarshall left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGTM. The one detail I see that might be missing for the go function runtime is an ability to configure TLS. Token based auth is recommended to be performed over TLS.

That feature would go in another PR. At the very least, we'll want to document this limitation to make sure users are aware of the current state of go functions.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread ...ar-functions/runtime/src/test/java/org/apache/pulsar/functions/runtime/RuntimeUtilsTest.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

flowchartsman added 2 commits June 1, 2023 17:10
@flowchartsman
gofmt
43826c5
@flowchartsman
rm empty lines
b5bda83
@flowchartsman
flowchartsman marked this pull request as draft June 1, 2023 22:33
@flowchartsman

flowchartsman commented Jun 1, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

Converting this to draft to integrate TLS (see #20453 / PIP-273) Ready for review

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@flowchartsman
Add TLS support for Go Functions
4a3aed9
@flowchartsman flowchartsman changed the title [fix][fn] enable Go function token auth [fix][fn] enable Go function token auth and TLS Jun 2, 2023
@flowchartsman
flowchartsman marked this pull request as ready for review June 2, 2023 18:23
@flowchartsman
Chore: small tweak
c27d3ca
@flowchartsman

flowchartsman commented Jun 2, 2023

Copy link
Copy Markdown
Contributor Author

That feature would go in another PR.
Hold my 🍺

michaeljmarshall reacted with rocket emoji
All reactions
  • 🚀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

flowchartsman added 2 commits June 2, 2023 17:01
@flowchartsman
add unit test for authconfig
9eb0690
@flowchartsman
remove deprecated useTls
684a266
michaeljmarshall
michaeljmarshall approved these changes Jun 2, 2023
View reviewed changes

@michaeljmarshall michaeljmarshall left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Great work @flowchartsman! I left one comment, but it's very minor.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pulsar-function-go/pf/instanceConf.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

@michaeljmarshall michaeljmarshall assigned flowchartsman Jun 2, 2023
@michaeljmarshall michaeljmarshall added area/function area/security labels Jun 2, 2023
@michaeljmarshall michaeljmarshall added this to the 3.1.0 milestone Jun 2, 2023
@flowchartsman
tlsCertsPath -> tlsTrustCertsPath
9537ccb
michaeljmarshall
michaeljmarshall approved these changes Jun 2, 2023
View reviewed changes
@codecov-commenter

codecov-commenter commented Jun 2, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.33333% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.91%. Comparing base (5e6e6ce) to head (9537ccb).
⚠️ Report is 2214 commits behind head on master.

Files with missing lines Patch % Lines
.../apache/pulsar/functions/runtime/RuntimeUtils.java 76.92% 0 Missing and 3 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #20468      +/-   ##
============================================
- Coverage     72.95%   72.91%   -0.05%     
+ Complexity    31914    31907       -7     
============================================
  Files          1867     1867              
  Lines        138485   138540      +55     
  Branches      15202    15208       +6     
============================================
- Hits         101037   101014      -23     
- Misses        29438    29509      +71     
- Partials       8010     8017       +7     
Flag Coverage Δ
inttests 24.14% <0.00%> (+0.02%) ⬆️
systests 24.98% <33.33%> (-0.06%) ⬇️
unittests 72.20% <83.33%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...pulsar/functions/instance/go/GoInstanceConfig.java 100.00% <100.00%> (ø)
.../apache/pulsar/functions/runtime/RuntimeUtils.java 78.26% <76.92%> (-0.17%) ⬇️

... and 66 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@michaeljmarshall
michaeljmarshall requested review from lhotari, nlu90 and wolfstudy June 2, 2023 23:24
tisonkun
tisonkun approved these changes Jun 2, 2023
View reviewed changes
@tisonkun

tisonkun commented Jun 2, 2023

Copy link
Copy Markdown
Member

Merging...

Thanks for your contribution @flowchartsman!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tisonkun
tisonkun merged commit 8b3c085 into apache:master Jun 2, 2023
michaeljmarshall pushed a commit to datastax/pulsar that referenced this pull request Jun 6, 2023
@flowchartsman @michaeljmarshall
[fix][fn] enable Go function token auth and TLS (apache#20468)
6b6b6f9
Note: there were conflicts with the go.sum file.

In order to get things working, I cleared out the conflicts and then
ran `go mod tidy` in the `pulsar-funcion-go/examples` directory.

Co-authored-by: Andy Walker <[email protected]>
(cherry picked from commit 8b3c085)
@lhotari lhotari added the release/3.0.4 label Mar 27, 2024
lhotari pushed a commit that referenced this pull request Mar 27, 2024
@flowchartsman @lhotari
[fix][fn] enable Go function token auth and TLS (#20468)
961fee1
Co-authored-by: Andy Walker <[email protected]>
(cherry picked from commit 8b3c085)
@lhotari lhotari added the cherry-picked/branch-3.0 label Mar 27, 2024
@merlimat merlimat mentioned this pull request Oct 23, 2026
[feature][functions]Support auth for function go #15907
Closed
1 of 5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@tisonkun tisonkun tisonkun approved these changes
@michaeljmarshall michaeljmarshall michaeljmarshall approved these changes
@nlu90 nlu90 Awaiting requested review from nlu90
@wolfstudy wolfstudy Awaiting requested review from wolfstudy
@lhotari lhotari Awaiting requested review from lhotari

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@flowchartsman flowchartsman

Labels

area/function area/security cherry-picked/branch-3.0 doc-not-needed Your PR changes do not impact docs release/3.0.4

Projects

None yet

Milestone

3.1.0

Development

Successfully merging this pull request may close these issues.

[Bug][fn] Go functions runtime does not support any sort of auth.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@flowchartsman @codecov-commenter @tisonkun @michaeljmarshall @lhotari
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.