Skip to content

Commit b89c8e5

Browse files
committed
chore: removed nilai-auth and moved nuc-helpers to nilai_api/auth
1 parent cb20e14 commit b89c8e5

File tree

38 files changed

+74
-1315
lines changed

38 files changed

+74
-1315
lines changed

docker-compose.dev.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,16 +106,11 @@ services:
106106
depends_on:
107107
nilauth-postgres:
108108
condition: service_healthy
109-
<<<<<<< HEAD
110109
healthcheck:
111110
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/health"]
112111
interval: 30s
113112
retries: 3
114113
start_period: 15s
115114
timeout: 10s
116-
=======
117-
118-
119-
>>>>>>> a4d2f92 (feat: first working version of payments for nilAI)
120115
volumes:
121116
postgres_data:

nilai-api/pyproject.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ description = "Add your description here"
55
readme = "README.md"
66
authors = [
77
{ name = "José Cabrero-Holgueras", email = "jose.cabrero@nillion.com" },
8-
{ name = "Manuel Santos", email = "manuel.santos@nillion.com" },
9-
{ name = "Dimitris Mouris", email = "dimitris@nillion.com" }
8+
{ name = "Baptiste Lefort", email = "baptiste.lefort@nillion.com" }
109
]
1110
requires-python = ">=3.12"
1211
dependencies = [
@@ -31,7 +30,6 @@ dependencies = [
3130
"verifier",
3231
"web3>=7.8.0",
3332
"click>=8.1.8",
34-
"nuc-helpers",
3533
"nuc>=0.1.0",
3634
"pyyaml>=6.0.1",
3735
"trafilatura>=1.7.0",
@@ -47,7 +45,6 @@ build-backend = "hatchling.build"
4745

4846
[tool.uv.sources]
4947
nilai-common = { workspace = true }
50-
nuc-helpers = { workspace = true }
5148

5249
# TODO: Remove this once the secretvaults package is released with the fix
5350
secretvaults = { git = "https://github.com/jcabrero/secretvaults-py", rev = "main" }

nilai-api/src/nilai_api/auth/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from nilai_api.auth.strategies import AuthenticationStrategy
99

1010
from nuc.validate import ValidationException
11-
from nuc_helpers.usage import UsageLimitError
11+
from nilai_api.auth.nuc_helpers.usage import UsageLimitError
1212

1313
from nilai_api.auth.common import (
1414
AuthenticationInfo,

nilai-api/src/nilai_api/auth/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
from typing import Optional
33
from fastapi import HTTPException, status
44
from nilai_api.db.users import UserData
5-
from nuc_helpers.usage import TokenRateLimits, TokenRateLimit
6-
from nuc_helpers.nildb_document import PromptDocument
5+
from nilai_api.auth.nuc_helpers.usage import TokenRateLimits, TokenRateLimit
6+
from nilai_api.auth.nuc_helpers.nildb_document import PromptDocument
77

88

99
class AuthenticationError(HTTPException):

nilai-api/src/nilai_api/auth/jwt.py

Lines changed: 0 additions & 156 deletions
This file was deleted.

nilai-api/src/nilai_api/auth/nuc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
from nilai_common.logger import setup_logger
1111

12-
from nuc_helpers.usage import TokenRateLimits
13-
from nuc_helpers.nildb_document import PromptDocument
12+
from nilai_api.auth.nuc_helpers.usage import TokenRateLimits
13+
from nilai_api.auth.nuc_helpers.nildb_document import PromptDocument
1414

1515
logger = setup_logger(__name__)
1616

nilai-auth/nuc-helpers/src/nuc_helpers/__init__.py renamed to nilai-api/src/nilai_api/auth/nuc_helpers/__init__.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
from nuc_helpers.helpers import (
2-
RootToken,
3-
DelegationToken,
4-
InvocationToken,
1+
from nilai_api.auth.nuc_helpers.helpers import (
52
get_wallet_and_private_key,
63
pay_for_subscription,
74
get_root_token,
@@ -10,11 +7,11 @@
107
get_nilai_public_key,
118
get_nilauth_public_key,
129
validate_token,
13-
NilAuthPublicKey,
14-
NilAuthPrivateKey,
15-
NilchainPrivateKey,
1610
)
11+
from cosmpy.crypto.keypairs import PrivateKey as NilchainPrivateKey
12+
from secp256k1 import PublicKey as NilAuthPublicKey, PrivateKey as NilAuthPrivateKey
1713

14+
from nilai_api.auth.nuc_helpers.types import RootToken, DelegationToken, InvocationToken
1815

1916
__all__ = [
2017
"RootToken",

nilai-auth/nuc-helpers/src/nuc_helpers/helpers.py renamed to nilai-api/src/nilai_api/auth/nuc_helpers/helpers.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@
55
import httpx
66

77
# Importing the types
8-
from nuc_helpers.types import RootToken, DelegationToken, InvocationToken, ChainId
8+
from nilai_api.auth.nuc_helpers.types import (
9+
RootToken,
10+
DelegationToken,
11+
InvocationToken,
12+
ChainId,
13+
)
914

1015
# Importing the secp256k1 library dependencies
1116
from secp256k1 import PrivateKey as NilAuthPrivateKey, PublicKey as NilAuthPublicKey

nilai-auth/nuc-helpers/src/nuc_helpers/main.py renamed to nilai-api/src/nilai_api/auth/nuc_helpers/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from nuc_helpers import (
1+
from nilai_api.auth.nuc_helpers import (
22
get_wallet_and_private_key,
33
pay_for_subscription,
44
get_root_token,

0 commit comments

Comments
 (0)