Skip to content

fix: use sequential api key nonces#94

Merged
ibruno merged 2 commits into
mainfrom
fix/sequential-api-key-nonces
May 26, 2026
Merged

fix: use sequential api key nonces#94
ibruno merged 2 commits into
mainfrom
fix/sequential-api-key-nonces

Conversation

@ibruno

@ibruno ibruno commented May 26, 2026

Copy link
Copy Markdown
Contributor

Summary by cubic

Switches API key generation to sequential nonces derived from existing key metadata across Kuest services. Removes manual nonce input, prevents mismatches and duplicate signing, and makes key creation reliable across services.

  • Bug Fixes

    • Compute the next nonce from fetched key metadata; ignore malformed or negative nonces.
    • If creation fails on all services, derive the existing key via /auth/derive-api-key to avoid duplicate errors.
    • Prevent duplicate signature requests during key creation with an in-flight guard.
    • Always allow key revocation; removed the “Different nonce” restriction.
  • New Features

    • Added listKuestKeyMetadata and nextKuestNonceFromMetadata; listKuestKeys now returns only active keys.
    • Listing keys now requests metadata and revoked keys, merges metadata across services, and signs using the full path with query.
    • UI: removed the nonce input and added a “Generate another key” button after success.

Written for commit f5c0ac2. Summary will update on new commits. Review in cubic

@vercel

vercel Bot commented May 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
auth Ready Ready Preview, Comment May 26, 2026 5:29pm

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 issues found across 3 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/features/keygen/key-generator.tsx">

<violation number="1" location="src/features/keygen/key-generator.tsx:410">
P3: Restore the correct ESLint rule name; otherwise the dependency warning is no longer suppressed.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread src/lib/kuest.ts Outdated
Comment thread src/lib/kuest.ts
Comment thread src/features/keygen/key-generator.tsx
// We intentionally react to connection/chain/signing state transitions.
// Handler identities are recreated on render and are not used as effect triggers.
// eslint-disable-next-line react-hooks/exhaustive-deps
// eslint-disable-next-line react/exhaustive-deps

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: Restore the correct ESLint rule name; otherwise the dependency warning is no longer suppressed.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/features/keygen/key-generator.tsx, line 410:

<comment>Restore the correct ESLint rule name; otherwise the dependency warning is no longer suppressed.</comment>

<file context>
@@ -411,7 +407,7 @@ export function KeyGenerator() {
     // We intentionally react to connection/chain/signing state transitions.
     // Handler identities are recreated on render and are not used as effect triggers.
-    // eslint-disable-next-line react-hooks/exhaustive-deps
+    // eslint-disable-next-line react/exhaustive-deps
   }, [
     autoProceedAfterConnect,
</file context>
Suggested change
// eslint-disable-next-line react/exhaustive-deps
// eslint-disable-next-line react-hooks/exhaustive-deps

@ibruno

ibruno commented May 26, 2026

Copy link
Copy Markdown
Contributor Author

@cubic-dev-ai

@cubic-dev-ai

cubic-dev-ai Bot commented May 26, 2026

Copy link
Copy Markdown

@cubic-dev-ai

@ibruno I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 3 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/features/keygen/key-generator.tsx">

<violation number="1" location="src/features/keygen/key-generator.tsx:410">
P3: Restore the correct ESLint rule name; otherwise the dependency warning is no longer suppressed.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread src/lib/kuest.ts
@ibruno ibruno merged commit c74b926 into main May 26, 2026
8 checks passed
@ibruno ibruno deleted the fix/sequential-api-key-nonces branch May 26, 2026 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant