Skip to content

Conversation

@shaun-nx
Copy link
Contributor

@shaun-nx shaun-nx commented Nov 25, 2025

Proposed changes

This change adds a new GoLang API type to apis/v1alpha1 for the AuthenticationFilter
This change only adds the types required for Basic Auth to work, and does not include types specific to JWT Auth. These will be added in future work.

Closes #4309

Example manifest for basic auth

apiVersion: gateway.nginx.org/v1alpha1
kind: AuthenticationFilter
metadata:
  name: basic-auth
spec:
  type: Basic
  basic:
    secretRef:
      name: basic-auth-users
      key: htpasswd
    realm: "Restricted"
    onFailure:
      statusCode: 401
      scheme: Basic

Example output from kubectl describe authenticationfilters.gateway.nginx.org basic-auth

Name:         basic-auth
Namespace:    default
Labels:       <none>
Annotations:  <none>
API Version:  gateway.nginx.org/v1alpha1
Kind:         AuthenticationFilter
Metadata:
  Creation Timestamp:  2025-11-25T13:22:59Z
  Generation:          1
  Resource Version:    4380
  UID:                 3d6f797d-bc10-4cd4-bcf9-5bb88a4f6dd5
Spec:
  Basic:
    On Failure:
      Body Policy:  Unauthorized
      Scheme:       Basic
      Status Code:  401
    Realm:          Restricted
    Secret Ref:
      Key:   htpasswd
      Name:  basic-auth-users
  Type:      Basic
Events:      <none>

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have updated necessary documentation
  • I have rebased my branch onto main
  • I will ensure my PR is targeting the main branch and pulling from my branch from my own fork

Release notes

If this PR introduces a change that affects users and needs to be mentioned in the release notes,
please add a brief note that summarizes the change.

NONE

@shaun-nx shaun-nx requested a review from a team as a code owner November 25, 2025 13:57
@github-actions github-actions bot added the enhancement New feature or request label Nov 25, 2025
@shaun-nx shaun-nx changed the base branch from main to feat/authentication-filter November 25, 2025 13:58
@codecov
Copy link

codecov bot commented Nov 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.09%. Comparing base (7dbd83f) to head (5b970bb).

Additional details and impacted files
@@                      Coverage Diff                       @@
##           feat/authentication-filter    #4339      +/-   ##
==============================================================
- Coverage                       86.11%   86.09%   -0.02%     
==============================================================
  Files                             132      132              
  Lines                           14342    14342              
  Branches                           35       35              
==============================================================
- Hits                            12350    12348       -2     
- Misses                           1789     1791       +2     
  Partials                          203      203              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 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.

Copy link
Collaborator

@sjberman sjberman left a comment

Choose a reason for hiding this comment

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

Design needs to be completed before this should be implemented/reviewed.

@github-project-automation github-project-automation bot moved this from 🆕 New to 🏗 In Progress in NGINX Gateway Fabric Nov 25, 2025
@shaun-nx shaun-nx requested a review from sjberman November 27, 2025 08:58
@shaun-nx shaun-nx deleted the branch feat/authentication-filter November 27, 2025 10:15
@shaun-nx shaun-nx closed this Nov 27, 2025
@github-project-automation github-project-automation bot moved this from 🏗 In Progress to ✅ Done in NGINX Gateway Fabric Nov 27, 2025
@shaun-nx shaun-nx deleted the feat/authfilter-base-crd branch November 27, 2025 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Generate base CRDs for AuthenticationFilter

3 participants