Skip to content

Conversation

@eluce2
Copy link
Collaborator

@eluce2 eluce2 commented Dec 19, 2025

Note

Improves env var/auth resolution (username/password), adds alias-aware OData codegen and import preservation, and upgrades UI tables/fields editors (sticky headers, scrolling, bulk include/exclude) with new tests and snapshots.

  • Typegen/Auth:
    • Normalize envNames.auth shape and read/validate all auth envs (API key or username/password) across getEnvValues, server client creation, and layout client guards.
    • Update client generation to pick OttoAdapter vs FetchAdapter based on provided creds.
  • OData Generation:
    • Apply import aliases in field builders and preserve/merge existing import aliases when regenerating files.
    • Track used builders pre-alias and maintain zod usage detection.
  • Types/Config:
    • Unify envNames.auth schema to a single object with optional apiKey, username, password.
  • Web UI:
    • Data grids use sticky headers with scroll areas; remove built-in pagination in dialogs.
    • Tables/Fields editors: add Include/Exclude All, selection badge, narrower include column, and minor copy tweak.
  • Tests/Snapshots:
    • Add tests asserting OttoAdapter vs FetchAdapter selection; update zod import snapshot.

Written by Cursor Bugbot for commit d180094. This will update automatically on new commits. Configure here.

@vercel
Copy link

vercel bot commented Dec 19, 2025

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

Project Deployment Review Updated (UTC)
proofkit-docs Ready Ready Preview Dec 20, 2025 1:27pm

@eluce2 eluce2 marked this pull request as ready for review December 19, 2025 21:06
This was referenced Dec 19, 2025
Copy link
Collaborator Author

eluce2 commented Dec 19, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@eluce2 eluce2 force-pushed the fix_username/password_auth branch from e5e8d9c to 51287c9 Compare December 19, 2025 21:10
@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 19, 2025

Open in StackBlitz

@proofkit/better-auth

pnpm add https://pkg.pr.new/proofgeist/proofkit/@proofkit/better-auth@81

@proofkit/cli

pnpm add https://pkg.pr.new/proofgeist/proofkit/@proofkit/cli@81

create-proofkit

pnpm add https://pkg.pr.new/proofgeist/proofkit/create-proofkit@81

@proofkit/fmdapi

pnpm add https://pkg.pr.new/proofgeist/proofkit/@proofkit/fmdapi@81

@proofkit/fmodata

pnpm add https://pkg.pr.new/proofgeist/proofkit/@proofkit/fmodata@81

@proofkit/typegen

pnpm add https://pkg.pr.new/proofgeist/proofkit/@proofkit/typegen@81

@proofkit/webviewer

pnpm add https://pkg.pr.new/proofgeist/proofkit/@proofkit/webviewer@81

commit: 6f5e5f6

"username" in envNames.auth
) {
addTypeGuardStatements(sourceFile, {
envVarName: envNames.auth?.username ?? defaultEnvNames.username,
Copy link

Choose a reason for hiding this comment

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

Bug: Generated code requires all auth env vars unnecessarily

The type guard generation now adds throw statements for apiKey, username, AND password environment variables whenever envNames.auth is an object. Previously, it only added guards for the specific auth method being used. Now, if a user configures only API key authentication, the generated client will throw errors for missing FM_USERNAME and FM_PASSWORD env vars that aren't actually needed, making the generated code unusable.

Fix in Cursor Fix in Web

envNames?.auth && "password" in envNames.auth
? (envNames.auth.password ?? defaultEnvNames.password)
: defaultEnvNames.password,
},
Copy link

Choose a reason for hiding this comment

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

Bug: Auth object structure always causes OttoAdapter selection

The auth object passed to buildLayoutClient now always includes apiKey with a default value, regardless of the authentication method configured. This breaks the adapter selection logic in buildLayoutClient.ts (lines 27-35), which uses "apiKey" in envNames.auth to choose between OttoAdapter and FetchAdapter. Since apiKey is now always present, OttoAdapter is always imported and FetchAdapter is never used, completely breaking username/password authentication.

Fix in Cursor Fix in Web

@cursor
Copy link

cursor bot commented Dec 20, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

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.

2 participants