Skip to content

Add External Auth Policy to Ingress#9521

Merged
pdabelf5 merged 53 commits intomainfrom
feat/external-auth-ingress
Apr 21, 2026
Merged

Add External Auth Policy to Ingress#9521
pdabelf5 merged 53 commits intomainfrom
feat/external-auth-ingress

Conversation

@AlexFenlon
Copy link
Copy Markdown
Contributor

@AlexFenlon AlexFenlon commented Apr 2, 2026

This pull request introduces a new externalAuth policy to the NGINX Ingress Controller, enabling authentication of client requests using an external authentication server (such as oauth2-proxy or a custom service). The changes include updates to the CRD schema, documentation, and a comprehensive example demonstrating how to use the new feature with both HTTP Basic Auth and OAuth2 Proxy in a Mergeable Ingress scenario.

Examples and Usage

  • Introduces a new example (examples/ingress-resources/external-auth-mergeable) that demonstrates how to use the externalAuth policy with both HTTP Basic Auth and OAuth2 Proxy (GitHub) in a Mergeable Ingress configuration. The example includes step-by-step instructions, file descriptions, and testing guidance.
  • Provides a sample Policy manifest for HTTP Basic Auth using the new externalAuth field, showing how to configure TLS verification and reference the appropriate backend service and CA secret.

docs: nginx/documentation#1838

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

pdabelf5 and others added 23 commits April 2, 2026 14:07
- Updated NGINX ingress templates to wrap header values in quotes for consistency.
- Removed the generateProxySetHeaders function and replaced its usage with direct header setting in templates.
- Simplified header validation logic in validation.go to improve readability and maintainability.
- Added comprehensive tests for proxy set header validation to ensure proper error handling for various cases.
- Enhanced existing tests to reflect changes in header formatting and validation.
@github-actions github-actions Bot added enhancement Pull requests for new features/feature enhancements go Pull requests that update Go code python Pull requests that update Python code labels Apr 2, 2026
Comment thread tests/suite/utils/policy_resources_utils.py Dismissed
Comment thread tests/suite/utils/policy_resources_utils.py Fixed
Comment thread tests/suite/utils/policy_resources_utils.py Fixed
Comment thread tests/suite/utils/custom_assertions.py Fixed
Comment thread tests/suite/test_external_auth_policies_ingress.py Outdated
Comment thread tests/suite/utils/policy_resources_utils.py Dismissed
Comment thread tests/suite/utils/policy_resources_utils.py Dismissed
vepatel
vepatel previously approved these changes Apr 15, 2026
Comment thread tests/suite/test_external_auth_policies_ingress.py Outdated
Comment thread tests/suite/utils/external_auth_utils.py Outdated
Comment thread tests/suite/utils/external_auth_utils.py Outdated
Comment thread internal/configs/ingress.go Outdated
Comment thread internal/configs/ingress.go
Comment thread tests/suite/utils/external_auth_utils.py Outdated
Comment thread tests/suite/test_external_auth_policies_ingress.py Outdated
- Simplified test cases in  by removing redundant code and utilizing the new header building function.
- Updated the  fixture to be more flexible with parameters, allowing for easier configuration of test scenarios.
github-advanced-security[bot]

This comment was marked as outdated.

vepatel
vepatel previously approved these changes Apr 17, 2026
Signed-off-by: AlexFenlon <a.fenlon@f5.com>
Signed-off-by: AlexFenlon <a.fenlon@f5.com>
Signed-off-by: AlexFenlon <a.fenlon@f5.com>
@pdabelf5 pdabelf5 added this pull request to the merge queue Apr 20, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 20, 2026
@pdabelf5 pdabelf5 added this pull request to the merge queue Apr 21, 2026
Merged via the queue into main with commit a500f2d Apr 21, 2026
130 of 132 checks passed
@pdabelf5 pdabelf5 deleted the feat/external-auth-ingress branch April 21, 2026 12:33
@github-project-automation github-project-automation Bot moved this from Todo ☑ to Done 🚀 in NGINX Ingress Controller Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Pull requests for new features/feature enhancements go Pull requests that update Go code python Pull requests that update Python code

Projects

Status: Done 🚀

Development

Successfully merging this pull request may close these issues.

Add support for external authentication

6 participants