-
Notifications
You must be signed in to change notification settings - Fork 10
feat: Update NUCs to compatibility with public keys #110
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
Conversation
7e55246 to
60a8eeb
Compare
60a8eeb to
ec364b1
Compare
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 introduces support for public key updates and service subscriptions for nilAI by updating the NUC token creation flow and related helper functions. Key changes include:
- Refactoring NUC token generation in nuc-helpers to require and propagate public keys and support different blind modules.
- Adding new tests and fixtures to verify NILDB commands and subcommand behavior.
- Updating configuration files (Docker, pyproject.toml) to lock dependencies and select specific image tags.
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/e2e/test_openai.py | Added fixture and test for NILDB client and command handling. |
| tests/e2e/test_http.py | Added fixture and test for NILDB HTTP client with updated headers. |
| tests/e2e/nuc.py | Refactored token creation functions to include public key checks and delegation token logic. |
| nilai-auth/nuc-helpers/src/nuc_helpers/types.py | Added pydantic models for token types. |
| nilai-auth/nuc-helpers/src/nuc_helpers/main.py | Updated subscription payment to use public keys from server_private_key. |
| nilai-auth/nuc-helpers/src/nuc_helpers/helpers.py | Adjusted helper functions to pass additional parameters (chain_id, blind_module) and context to validators. |
| nilai-auth/nuc-helpers/pyproject.toml | Locked nuc dependency version with a git tag. |
| nilai-auth/nilai-auth-server/src/nilai_auth_server/app.py | Updated subscription payment to use public key from server_private_key. |
| nilai-auth/nilai-auth-client/examples/tutorial.ipynb | Updated messaging and key representation to reflect public key usage. |
| nilai-api/src/nilai_api/auth/nuc.py | Added a function to check Nilai subcommand and enforced it in token validation. |
| nilai-api/pyproject.toml | Updated nuc dependency configuration with version locking. |
| docker/nilauth/config.yaml | Modified subscription cost structure to support multiple keys. |
| docker-compose.dev.yml | Updated nilauth Docker image to a specific version tag. |
Comments suppressed due to low confidence (1)
nilai-api/src/nilai_api/auth/nuc.py:84
- The raised AuthenticationError is not imported or defined within this file; please ensure that the appropriate exception is imported or defined to avoid unresolved reference errors.
raise AuthenticationError("NUC token namespace is not a /nil/ai attenuation")
| get_unil_balance(wallet.address(), grpc_endpoint=grpc_endpoint) | ||
| < nilauth_client.subscription_cost() | ||
| ): | ||
| if get_unil_balance( |
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.
Should this check be done further down when you realize you need to pay because you're not subscribed?
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.
Agreed. Made the changes to do that
This PR adds support for public key updates and service subscriptions on nilAI. For that:
nuc-helpersto receivepubkeyas requiered.authlibraries for nilAI that require nucs for that./nil/ai.