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

ref(crons): Prefer DSN based auth #1545

Merged
merged 3 commits into from
Mar 24, 2023
Merged

ref(crons): Prefer DSN based auth #1545

merged 3 commits into from
Mar 24, 2023

Conversation

kamilogorek
Copy link
Contributor

Replaces #1541 and #1543

@kamilogorek
Copy link
Contributor Author

@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", "");
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup, it's here -

sentry-cli/src/config.rs

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.

Copy link
Member

Choose a reason for hiding this comment

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

Nice

@mattjohnsonpint
Copy link
Contributor

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.

@mattjohnsonpint
Copy link
Contributor

... 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.

@kamilogorek
Copy link
Contributor Author

DSN auth is not too accurate tbh. It's the same "auth" as you'd do with using send-event or send-envelope. Which is more of an "identification" than "authorization".

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.

None yet

4 participants