-
Notifications
You must be signed in to change notification settings - Fork 10
feat: Dual Authentication Mechanism API + NUC #101
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45976d4 to
973e20a
Compare
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
0be7c36 to
79b718f
Compare
9072f82 to
4bf1007
Compare
4bf1007 to
53c075c
Compare
Contributor
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.
Pull Request Overview
This PR enables a parallel transition period where API key and NUC authentication coexist by duplicating containers, updating routing, and adapting tests and CI to handle both methods.
- Refactored E2E tests to use a unified
api_key_getter, disable SSL verification in test clients, and add skips based onAUTH_STRATEGY. - Enhanced configuration (
config.py) with amatchonAUTH_STRATEGYto setBASE_URLand token retrieval dynamically. - Updated Docker Compose and Caddy to include NUC-specific
nuc-postgresandnuc-apiservices with path-based routing, and expanded CI to run tests for both auth strategies.
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/e2e/test_openai.py | Updated fixtures to call api_key_getter(), added custom HTTP clients with verify=False, and skip markers. |
| tests/e2e/test_http.py | Switched to api_key_getter(), added verify=False flags, improved assertion messages, and skip markers. |
| tests/e2e/config.py | Introduced AUTH_STRATEGY, refactored BASE_URL and api_key_getter definitions via match. |
| scripts/wait_for_ci_services.sh | Added health check logic for the new nilai-nuc-api container. |
| docker-compose.yml | Added nuc-postgres and nuc-api services, volumes, and healthchecks for NUC support. |
| docker-compose.dev.yml | Exposed nuc-api and nuc-postgres ports for local development. |
| caddy/Caddyfile | Configured /nuc and /nuc/* routing to the nuc-api service. |
| .github/workflows/ci.yml | Installed python3.12-dev, fixed typos, and added separate CI steps for NUC and API key E2E tests. |
| .env.ci | Adjusted NILAI_GUNICORN_WORKERS and default AUTH_STRATEGY for CI. |
mfontanini
approved these changes
May 23, 2025
lumasepa
approved these changes
May 23, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
After Phase 0 finishes, there will be a transition period where API keys and NUCs may live together. In this PR, we duplicate
apiandpostgrescontainers and addcaddyredirection under/nucsubdomain to that NUC instances. This makes it so that users can choose to connect to nilAI through both NUCs and API keys during the transition period where both NUCs and API Keys are both working.Furthermore, to make sure both authentication methods remain operational, we modified
ciandtestsso that both are passed.