-
Notifications
You must be signed in to change notification settings - Fork 335
Change global config perm #286
Change global config perm #286
Conversation
8e6fea7
to
22c2ba5
Compare
2dfae76
to
529d445
Compare
|
||
// check dir permissions (but not on windows) | ||
if !cfg!(target_os = "windows") { | ||
let mut command = Command::new("stat"); |
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.
let metadata = config_file.clone().metadata().unwrap();
let permissions = metadata.permissions();
assert_eq!(permissions.mode(), 0o600);
The API returned odd modes, that's why I used stat
.
b313e47
to
d25d65b
Compare
Could you explain a bit more what this is doing? Having a hard time grokking from title + comment. Does this have to do with how wrangler is installed? |
sent on gchat. |
); | ||
|
||
// check dir permissions (but not on windows) | ||
if !cfg!(target_os = "windows") { |
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.
What do we do on Windows?
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.
I don't know, cc @steveklabnik @ashleygwilliams do you have an idea?
20d9e75
to
cc7782a
Compare
cc7782a
to
efb6953
Compare
529d445
to
6b566d6
Compare
efb6953
to
cd52965
Compare
6b566d6
to
057da57
Compare
f0f130d
to
0054bf9
Compare
This changes the way `wrangler config` works, previously both the email and the api_key were passed as arguments which would be captured by the terminal history. When launching the command it will prompt for an email, once stdin receive a line it will prompt for the api_key. Both lines are values and will be stored in the config.
057da57
to
7740667
Compare
Avoid the global user config to be system readable, restrict any access to the current user (600). Extends the global_config API to allow to specify a configuration directory to create the configuration file, it's needed for testing.
7740667
to
6f9af42
Compare
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.
lgtm
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.
can we add some tests for this please?
Avoid the global user config to be system readable, restrict any access
to the current user and only in read only (600).
Merge #239 first.