Skip to content

Allow TOKEN_FILE to specifiy a token instead of using TOKEN#15

Open
CodeLongAndProsper90 wants to merge 1 commit into
cjdenio:masterfrom
CodeLongAndProsper90:token_file
Open

Allow TOKEN_FILE to specifiy a token instead of using TOKEN#15
CodeLongAndProsper90 wants to merge 1 commit into
cjdenio:masterfrom
CodeLongAndProsper90:token_file

Conversation

@CodeLongAndProsper90

@CodeLongAndProsper90 CodeLongAndProsper90 commented Apr 14, 2022

Copy link
Copy Markdown

This lets you specify a file TOKEN_FILE, from which the contents are read. TOKEN takes precedence over this. The main use case for this, right now, is a NixOS module I'm writing (it'd be bad to leave the token in a flake).

Comment thread src/auth.rs
if read_result.is_err() {
return Outcome::Failure((Status::Unauthorized, String::from("Invalid API token.")));
}
read_result.expect("")

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Ideally this condition wouldn't cause the app to crash

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

It wouldn't, because we already checked is_err().

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