codedna 0.8.0__tar.gz → 0.8.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {codedna-0.8.0 → codedna-0.8.1}/PKG-INFO +1 -1
- {codedna-0.8.0 → codedna-0.8.1}/codedna/__init__.py +1 -1
- {codedna-0.8.0 → codedna-0.8.1}/codedna/api.py +5 -5
- {codedna-0.8.0 → codedna-0.8.1}/codedna/rate_limit.py +3 -3
- {codedna-0.8.0 → codedna-0.8.1}/pyproject.toml +1 -1
- {codedna-0.8.0 → codedna-0.8.1}/.gitignore +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/LICENSE +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/README.md +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/codedna/ai.py +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/codedna/ai_box.py +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/codedna/ai_fingerprint.py +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/codedna/analyzer.py +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/codedna/auth.py +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/codedna/bus_factor.py +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/codedna/cli.py +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/codedna/db.py +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/codedna/demo.py +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/codedna/git_hook.py +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/codedna/integrations/__init__.py +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/codedna/integrations/github_bot.py +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/codedna/integrations/jira.py +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/codedna/integrations/lemonsqueezy.py +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/codedna/interview.py +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/codedna/onboarding.py +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/codedna/plan.py +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/codedna/protection.py +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/codedna/scorer.py +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/codedna/sprint_health.py +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/codedna/survey.py +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/codedna/tech_debt.py +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/.env.local.example +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/.gitignore +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/README.md +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/app/ai-compare/page.tsx +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/app/api/auth/login/route.ts +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/app/api/auth/logout/route.ts +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/app/api/auth/me/route.ts +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/app/api/auth/register/route.ts +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/app/api/billing/checkout/route.ts +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/app/billing/page.tsx +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/app/bus-factor/page.tsx +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/app/commits/page.tsx +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/app/debt/page.tsx +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/app/favicon.ico +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/app/files/page.tsx +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/app/fonts/GeistMonoVF.woff +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/app/fonts/GeistVF.woff +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/app/globals.css +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/app/interview/page.tsx +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/app/layout.tsx +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/app/login/page.tsx +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/app/onboarding/page.tsx +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/app/page.tsx +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/app/pricing/page.tsx +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/app/protected/page.tsx +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/app/register/page.tsx +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/app/settings/integrations/page.tsx +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/app/sprints/page.tsx +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/components/AuthProvider.tsx +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/components/ClientProviders.tsx +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/components/CommitTable.tsx +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/components/CostInfoTooltip.tsx +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/components/ErrorBanner.tsx +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/components/FeatureGate.tsx +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/components/FileHeatmap.tsx +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/components/LanguageSwitcher.tsx +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/components/NavClient.tsx +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/components/OverviewTitles.tsx +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/components/QuickInsights.tsx +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/components/RiskBadge.tsx +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/components/SummaryCards.tsx +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/components/UnderstandingChart.tsx +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/components/UpgradeBanner.tsx +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/lib/api.ts +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/lib/auth.ts +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/lib/i18n/en.ts +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/lib/i18n/index.tsx +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/lib/i18n/tr.ts +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/lib/plan.ts +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/next-env.d.ts +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/next.config.mjs +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/package-lock.json +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/package.json +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/postcss.config.mjs +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/tailwind.config.ts +0 -0
- {codedna-0.8.0 → codedna-0.8.1}/dashboard/tsconfig.json +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codedna
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.1
|
|
4
4
|
Summary: AI Code Transparency Tool - detect AI-written code and measure developer understanding
|
|
5
5
|
Project-URL: Homepage, https://codedna.dev
|
|
6
6
|
Project-URL: Repository, https://github.com/natureco-official/codedna
|
|
@@ -1322,17 +1322,17 @@ async def auth_login(data: LoginInput, request: Request) -> dict:
|
|
|
1322
1322
|
email_key = f"email:{data.email.strip().lower()}"
|
|
1323
1323
|
|
|
1324
1324
|
for key in (ip, email_key):
|
|
1325
|
-
allowed, remaining = login_limiter.
|
|
1325
|
+
allowed, remaining = login_limiter.check(key)
|
|
1326
1326
|
if not allowed:
|
|
1327
1327
|
raise HTTPException(status_code=429, detail=f"Too many failed attempts. Please wait {remaining} seconds.")
|
|
1328
1328
|
|
|
1329
1329
|
try:
|
|
1330
1330
|
result = login_user(data.email, data.password, db)
|
|
1331
|
-
login_limiter.
|
|
1332
|
-
login_limiter.
|
|
1331
|
+
login_limiter.record_success(ip)
|
|
1332
|
+
login_limiter.record_success(email_key)
|
|
1333
1333
|
except ValueError:
|
|
1334
|
-
login_limiter.
|
|
1335
|
-
login_limiter.
|
|
1334
|
+
login_limiter.record_failure(ip)
|
|
1335
|
+
login_limiter.record_failure(email_key)
|
|
1336
1336
|
raise HTTPException(status_code=401, detail="Invalid email or password.")
|
|
1337
1337
|
|
|
1338
1338
|
return {"user_id": result["user_id"], "token": result["token"], "plan": result["plan"], "subscription_status": result["subscription_status"]}
|
|
@@ -37,7 +37,7 @@ class RateLimiter:
|
|
|
37
37
|
self._locks: dict[str, int] = {} # {key: lock_expiry_time}
|
|
38
38
|
self._lock = Lock()
|
|
39
39
|
|
|
40
|
-
def
|
|
40
|
+
def check(self, key: str) -> tuple[bool, Optional[int]]:
|
|
41
41
|
"""
|
|
42
42
|
Check whether to allow the request.
|
|
43
43
|
|
|
@@ -63,7 +63,7 @@ class RateLimiter:
|
|
|
63
63
|
]
|
|
64
64
|
return True, None
|
|
65
65
|
|
|
66
|
-
def
|
|
66
|
+
def record_failure(self, key: str) -> None:
|
|
67
67
|
"""Record a failed attempt, lock if threshold reached."""
|
|
68
68
|
now = int(time.time())
|
|
69
69
|
with self._lock:
|
|
@@ -72,7 +72,7 @@ class RateLimiter:
|
|
|
72
72
|
if failures >= self._max_attempts:
|
|
73
73
|
self._locks[key] = now + self._lockout
|
|
74
74
|
|
|
75
|
-
def
|
|
75
|
+
def record_success(self, key: str) -> None:
|
|
76
76
|
"""Reset records on successful login."""
|
|
77
77
|
with self._lock:
|
|
78
78
|
self._records[key] = []
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|