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

Support function authentication with OpenFaaS IAM #15

Merged
merged 2 commits into from
Jun 17, 2024

Conversation

welteki
Copy link
Member

@welteki welteki commented May 23, 2024

Description

If JWT authentication is enabled by setting the env variable jwt_auth: true in the stack.yml file the watchdog requires an OpenFaaS function token for request authentication.

Authentication tokens can be optioned through OpenFaaS IAM.

The watchdog verifies the token is valid and checks of an actor is authorized to invoke the function by looking at the function claim in the token and validating the permissions.

Motivation and Context

  • I have raised an issue to propose this change (required)

Support IAM authentication for functions.

How Has This Been Tested?

  • Changes have been tested by running the watchdog locally and invoking it with and without a function token.
    During these test the OPENFAAS_NAME and OPENFAAS_NAMESPACE env variable were changed to simulate different functions in multiple namespaces.

    fprocess="env" \
    jwt_auth=true \
    jwt_auth_local=true \
    jwt_auth_debug=true \
    OPENFAAS_NAMESPACE=staging \
    OPENFAAS_NAME=env \
    port=8083 ./bin/fwatchdog-amd64
  • Changes have been tested E2E in cluster.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I've read the CONTRIBUTION guide
  • I have signed-off my commits with git commit -s
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Signed-off-by: Han Verstraete (OpenFaaS Ltd) <[email protected]>
Signed-off-by: Han Verstraete (OpenFaaS Ltd) <[email protected]>
@welteki welteki marked this pull request as ready for review June 17, 2024 09:36
Copy link
Member

@alexellis alexellis left a comment

Choose a reason for hiding this comment

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

Approved

@alexellis alexellis merged commit 2ae37c2 into openfaas:master Jun 17, 2024
1 check passed
@welteki welteki deleted the function-auth branch June 17, 2024 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants