-
-
Notifications
You must be signed in to change notification settings - Fork 222
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
ref(crons): Prefer DSN based auth #1545
Conversation
@evanpurkhiser feel free to merge it once you test it out |
.with_response_file("monitors/post-monitors.json"), | ||
); | ||
if cfg!(windows) { | ||
register_test("monitors/monitors-run-token-auth-win.trycmd").env("SENTRY_DSN", ""); |
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.
Ahh, I was trying to clear it out like this but that wasn't working since even having a blank value was reading it :-)
There must be some logic somewhere that treats empty as None in the new code
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.
Yup, it's here -
Lines 407 to 416 in ac6532f
/// Return the DSN | |
pub fn get_dsn(&self) -> Result<Dsn> { | |
if let Ok(val) = env::var("SENTRY_DSN") { | |
Ok(val.parse()?) | |
} else if let Some(val) = self.ini.get_from(Some("auth"), "dsn") { | |
Ok(val.parse()?) | |
} else { | |
bail!("No DSN provided"); | |
} | |
} |
Empty string fails to
.parse()
as Dsn
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.
Nice
Some explanation would be useful. What is "DSN based auth"? And does it only apply to certain Sentry CLI operations, or anything? For example, does this mean I could use a DSN instead of an auth token to upload debug info files? Thanks. |
... I'm guessing not. But at any rate, it DSN based auth it a thing for Sentry CLI, should it be mentioned in docs, such as in Configuration and Authentication? Thanks. |
DSN auth is not too accurate tbh. It's the same "auth" as you'd do with using |
Replaces #1541 and #1543