Skip to content
Snippets Groups Projects
Campbell Jones's avatar
Campbell Jones's avatar
  • a9a4b6b5 · upgpkg: 0.40.1-1: Update to v0.40.1
Wiktor Kwapisiewicz's avatar
commented on merge request !192 "Add `signstar-config` crate to handle Signstar configs, administrative and non-administrative credentials on a Signstar host" at Arch Linux / signstar

Okay, I've given it a casual skim. I'll be rebasing my own stuff early next week so I'll probably come with more but I don't want to leave you empt...

Wiktor Kwapisiewicz's avatar
commented on merge request !192 "Add `signstar-config` crate to handle Signstar configs, administrative and non-administrative credentials on a Signstar host" at Arch Linux / signstar

It'd be good to have a smaller code example here so it's immediately clear what does it do.

Wiktor Kwapisiewicz's avatar
commented on merge request !192 "Add `signstar-config` crate to handle Signstar configs, administrative and non-administrative credentials on a Signstar host" at Arch Linux / signstar

Hmm... I don't think PathBuf is marked #[must_use]. Could you check if this works:...

Wiktor Kwapisiewicz's avatar
commented on merge request !192 "Add `signstar-config` crate to handle Signstar configs, administrative and non-administrative credentials on a Signstar host" at Arch Linux / signstar

Is this line necessary?

Wiktor Kwapisiewicz's avatar
commented on merge request !192 "Add `signstar-config` crate to handle Signstar configs, administrative and non-administrative credentials on a Signstar host" at Arch Linux / signstar
/// Sets the file mode of the socket to `666` so that all users on the system have access.
Wiktor Kwapisiewicz's avatar
commented on merge request !192 "Add `signstar-config` crate to handle Signstar configs, administrative and non-administrative credentials on a Signstar host" at Arch Linux / signstar

This is slightly problematic since if the tests fails before this line is reached then the the subprocess will not be killed. Sadly, depending on t...

Wiktor Kwapisiewicz's avatar
commented on merge request !192 "Add `signstar-config` crate to handle Signstar configs, administrative and non-administrative credentials on a Signstar host" at Arch Linux / signstar

expect_err will do that for you:...

Wiktor Kwapisiewicz's avatar
commented on merge request !192 "Add `signstar-config` crate to handle Signstar configs, administrative and non-administrative credentials on a Signstar host" at Arch Linux / signstar

Can user take any other values than "root"? 🤔

Wiktor Kwapisiewicz's avatar
commented on merge request !192 "Add `signstar-config` crate to handle Signstar configs, administrative and non-administrative credentials on a Signstar host" at Arch Linux / signstar

Assert may panic. If you think it's a good idea to have it here I'd at least insert a greppable message:...

Wiktor Kwapisiewicz's avatar
commented on merge request !192 "Add `signstar-config` crate to handle Signstar configs, administrative and non-administrative credentials on a Signstar host" at Arch Linux / signstar

I wonder if these constraints should be part of the documentation (e.g. "creates a password consisting of 30 alphanumeric characters").

Wiktor Kwapisiewicz's avatar
commented on merge request !192 "Add `signstar-config` crate to handle Signstar configs, administrative and non-administrative credentials on a Signstar host" at Arch Linux / signstar

Is there a reason you don't shorten this stuff into:...

Wiktor Kwapisiewicz's avatar
commented on merge request !192 "Add `signstar-config` crate to handle Signstar configs, administrative and non-administrative credentials on a Signstar host" at Arch Linux / signstar

Hmm... I wonder if you want to explicitly assign values to variants to avoid AdminCredentialsConfigFromToml being assigned 0 etc.:...

Wiktor Kwapisiewicz's avatar
commented on merge request !192 "Add `signstar-config` crate to handle Signstar configs, administrative and non-administrative credentials on a Signstar host" at Arch Linux / signstar

What's our current standing on mut variables scope? A couple of months ago there was a suggestion to wrap them in a block to make them immutable? 🤔

Wiktor Kwapisiewicz's avatar
commented on merge request !192 "Add `signstar-config` crate to handle Signstar configs, administrative and non-administrative credentials on a Signstar host" at Arch Linux / signstar

Maybe that's just me but I think it'd be more obvious if the function was called fail_if_non_root 🤔

Wiktor Kwapisiewicz's avatar
commented on merge request !192 "Add `signstar-config` crate to handle Signstar configs, administrative and non-administrative credentials on a Signstar host" at Arch Linux / signstar
    pub fn store<P>(&self, path: impl AsRef<Path>) -> Result<(), crate::Error>
Wiktor Kwapisiewicz's avatar
commented on merge request !192 "Add `signstar-config` crate to handle Signstar configs, administrative and non-administrative credentials on a Signstar host" at Arch Linux / signstar

There's quite a lot of interesting code down there but the test is marked as no_run. Is that intentional?

Wiktor Kwapisiewicz's avatar
commented on merge request !192 "Add `signstar-config` crate to handle Signstar configs, administrative and non-administrative credentials on a Signstar host" at Arch Linux / signstar
                context: "after decrypting".to_string(),
Wiktor Kwapisiewicz's avatar
commented on merge request !192 "Add `signstar-config` crate to handle Signstar configs, administrative and non-administrative credentials on a Signstar host" at Arch Linux / signstar

This equivalent syntax is shorter:...