-
Notifications
You must be signed in to change notification settings - Fork 305
feat(typescript): support omitting username/password in basic auth when configured in IR #14406
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
Changes from all commits
d964ecb
34f45a3
753d586
0dad189
a876e08
04da60e
fab2111
de92ad0
5063e6b
95c8bf8
caebd4a
9628f06
309a34a
a37a0a5
7941e22
d886376
07fa558
dfdd31d
c2fd811
d2040a9
d335ffa
f193396
a62122c
a046153
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Generator emits unused PASSWORD_PARAM/USERNAME_PARAM constants for omitted basic auth fields When This is confirmed by the generated seed output at (Refers to lines 169-170) Prompt for agentsWas this helpful? React with 👍 or 👎 to provide feedback. |
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.
🟡 Generator emits unused USERNAME_PARAM/PASSWORD_PARAM constants for omitted auth fields
In
writeConstantsatBasicAuthProviderGenerator.ts:159-170, bothUSERNAME_PARAMandPASSWORD_PARAMare always emitted regardless of omit flags. When a field is omitted (e.g.passwordOmit: true), the corresponding constant is never referenced incanCreate,getAuthRequest, or theAuthOptionstype — it becomes dead code.The generated seed output at
seed/ts-sdk/basic-auth-optional/src/auth/BasicAuthProvider.ts:7confirms this:const _PASSWORD_PARAM = "password" as const;— the linter renamed it with an underscore prefix because it's unused. The fix would be to conditionally skip generating the constant when the corresponding omit flag is true.(Refers to lines 169-170)
Was this helpful? React with 👍 or 👎 to provide feedback.
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.
Valid observation about the unused constant. This is a minor issue — the generated biome config already renames it with an underscore prefix (
_PASSWORD_PARAM), and the constant is still referenced in the module namespace for theAUTH_CONFIG_ERROR_MESSAGE_PASSWORDstring template in the non-omit case. Conditionally skipping the constant would require tracking which fields are omitted across bothwriteConstantsandwriteOptions, adding complexity for a cosmetic improvement. I'll leave this as-is unless the maintainer wants it addressed.