-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
fix: remove unnecessary logging for webauthn auth #5077
Conversation
ffabff9
to
4f2bf86
Compare
no statistically significant performance changes detected timing results
|
6ba885f
to
a100c69
Compare
a100c69
to
5c4116d
Compare
@hfaulds @MylesBorins why is this "unnecessary"? The whole reason to log the location is for end-user clarity/security. |
@darcyclarke It’s also showing a URL in the output that prompts for login. |
@darcyclarke I updated the PR description with a screenshot of what the output looked like prior to this PR |
The registry url and the webauthn URL aren’t the same though. Isn’t the registry url important? |
@ljharb two things to clarify
Also worth mentioning, this functionality has not yet been implemented by any public or private registry. we have something currently in staging that we are testing which is where we found this unnecessary copy that makes the login experience noisy |
@MylesBorins in the screenshot, the registry is |
ok I'm seeing the distinction now between the registry URL and the auth URL... one of which is registry.npmjs.com and the other which would be www.npmjs.com We can keep both, it just seems noisy. Maybe we could change the copy to be a bit more explicit than the current text... previously when logging in you would be prompted for username and have no insight into where you were logging in. Now you will see a URL you are clicking. While it won't have necessarily have "registry" in the URL it will be explicitly tied to the registry / service you are authenticating with. |
@MylesBorins: So what would you prefer we do? 🙂 |
I think we can still log this information but at a different log level (verbose rather than info). I think we can consider this a post GA improvement rather than exit criteria. What isn't clear is if we want to make this loglevel vebose for all login, or just for web based login. As such I think we can punt on this being blocking Thoughts? |
I think #5172 might fix this in a much more holistic way. |
@wraithgar would the account for the |
That would still be there, but the default loglevel is This PR means we don't have to worry about this logging showing up as apparently duplicate info. |
I really honestly don't see what the problem is here. It really is not that noisy and this does feel like anticipating a problem that doesn't exist. I don't think changing it to Especially given that the web login url is not the same as the registry, I think both are appropriate. Also, I was in error about the other PR being related, that one affects publish, not login. |
Description
When authenticating using
Webauthn
it is unnecessary to logLog in on...
. This PR hides that logging in that case.Prior to this PR the output looks like:
An alternative approach would be to use the existing auth handler polymorphism, rather than adding branching into
lib/auth/legacy.js
. If we introduce a newlib/auth/webauthn.js
handler and move ourlegacy.js
logic there, thenlegacy.js
can log the notice and then callwebauthn.js
. This would avoid the branching introduced by this PR and the unfortunate confusion oflegacy.js
checking ifauthType == 'legacy'
. The downside of that approach is the merge conflicts it will create with ongoing work to these files, and the naming confusion aroundlegacy
andwebauthn
.References