-
Notifications
You must be signed in to change notification settings - Fork 372
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
[Pending] Specifying hashInputOrder #937
base: master
Are you sure you want to change the base?
Conversation
This implementation makes sense to me. It also happens to match an internally approved API proposal. @bojeil-google WDYT? |
@@ -570,6 +570,8 @@ export namespace admin.auth { | |||
pageToken?: string; | |||
} | |||
|
|||
type HashInputOrderType = 'SALT_FIRST' | 'PASSWORD_FIRST'; |
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.
You will need to update the implementation. They are now autogenerating the type definitions. Take a look at some of the latest Auth changes related to modularization in the repo
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.
I don't quite understand here. You're referring to the usage of HashInputOrderType but not this line right?
Cause what I saw is like removing "?" or "| null" along with the type.
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.
Hey @xil222, I don't refer specifically to this line, but in general, they are moving away from auth.d.ts
and now are auto-generating the type definitions from the code. This PR may be helpful to understand these changes:
https://github.com/firebase/firebase-admin-node/pull/1009/files
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.
It took me sometime but I am not sure I understand it correctly or PR did help.
-
I didn't see how it resolved auto-generating type definition. In the link above, the only reference to type is line 79 in src/auth/user-import-builder-internal.ts:
export type ValidatorFunction = (data: UploadAccountUser) => void;
It's exactly the same implementation as line 158 in src/auth/user-import-builder.ts
There's no sign of auto-generating type definition here.
What I can see in src/auth/user-import-builder-internal.ts doing is importing few interfaces exported in src/auth/user-import-builder.ts, but I didn't see how it do with autogenerating the type definitions. -
In the link above, src/auth/user-import-builder-internal.ts was implemented in another branch which hasn't been merged into master branch yet. Even if my first point was wrong, that few lines of code edition could realize the auto-generating of type definitions, real implementation should be done only after that branch has been merged. I can't remove or take off the definition of this line.
-
I need more clarification on auto-generating type definitions. I can't see how the implementation could help with that.
Therefore, maybe it's better merge this PR into master for now.
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.
Ok it is fine to stick with the current implementation in master. Though I think if this ends up landing after the other branch lands, you may have to make the changes then.
@hiranya911 just a heads on this.
waiting for requirement of md5 confirmation
add functionality and tests for specifying inputHashOrder for algorithms:
hmac{md5, sha1, sha256, sha512} and {sha1, sha256, sha512}