Skip to content
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

feat: improve diagnostics, allow custom HTTP options, account for IdP support for scopes #189

Merged
merged 5 commits into from
Mar 11, 2024

Conversation

addaleax
Copy link
Contributor

@addaleax addaleax commented Mar 7, 2024

The commits here are fairly independent (and can be reviewed indepedently), but they would otherwise be fairly small changes or conflict with each other, so this is just one big PR to handle all of them together. If it's easier, I'm happy to split them out and PR them sequentially as well 🙂

chore: add token type to auth-succeeded log event
fix: improve error message when Issuer.discover() fails COMPASS-7605
chore: disable last remaining eslint warning in tests
feat: do not request scopes if the IdP announces lack of support COMPASS-7437
feat: track HTTP calls, allow custom HTTP options MONGOSH-1712

(This would be used to implement useSystemCA support in devtools-connect)

try {
parsed = new URL(url);
} catch {
return '<Invalid URL>';
Copy link

Choose a reason for hiding this comment

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

NIT: Would be nice to log.debug? somehow the wrong URL or at least return the invalid url in case there is an issue.

Suggested change
return '<Invalid URL>';
return `<Invalid URL: '${url}'>`;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kmruiz Well ... I've gone back and forth on this, the point of this function is to redact URLs so that sensitive parameters like the authorization code don't end up being logged (and consequently stored to disk), so I wanted to err on the side of caution. You're also obviously right that that makes for bad diagnostics, not having the URL available at all :) I'd lean a bit towards leaving it like this, this condition Should Never Happen™ anyway because we should always be working with valid URLs, but let me know if you feel differently

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I merged this for now, but happy to adjust in a follow-up if you have more thoughts on this :)

@addaleax addaleax merged commit 943dd33 into main Mar 11, 2024
20 checks passed
@addaleax addaleax deleted the next branch March 11, 2024 10:56
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