-
Notifications
You must be signed in to change notification settings - Fork 18
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
Support using env vars for macOS notarization even if a macOS config exists #246
Conversation
…exists. Currently there is another related bug in the schema parsing that doesn't allow actually specifying the notarization authentication parameters in the package metadata of Cargo.toml, so this change is actually the only way to currently use the notarization features on macOS.
Thanks for approving the CI checks. I took a look at the clippy logs and the failures do not appear to be related to this PR's small changeset. |
This is intentional for security, as passwords shouldn't be specified in command line and |
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.
Thanks for the PR, just need a change file in .changes
directory with the following content
---
"cargo-packager": "patch"
"@crabnebula/packager": "patch"
---
On macOS, fix notarization skipping needed environment variables when macos specific config has been specified in the config file.
and also a little nit-pick I left below
Ah I see, thanks for clarifying. Makes sense. As a new user of this crate, I figured it was just an accidental oversight or a mismatch between the schema and Rust-level struct defs. Given that this is intentional, I think it'd be helpful to specify that design choice via a notice/warning in the doc comments of that |
Also, while we're on this topic, I do have a couple of other questions about that design philosophy, i.e., what is and is not exposed via
|
Add `.changes` file.
Finished all requested changes. Thanks for the feedback! |
Yeah, that would be nice, there is not many fields that are ignored when parsing config file but those can be easily found which will have |
I am not a macOS developer, so can't really say whether it is sensitive or not, so I'd rather leave this to @lucasfernog-crabnebula to answer, but having it as a CLI arg seems fine to me. |
There is nothing bad about using CLI args or env vars, both should be acceptable. I usually see secrets stored in env vars and then passed to CLI args, for example |
The reasons why I wouldn't want these be explicitly managed here is to allow flexibility for a higher tool atop of I wouldn't say this would fragment the ecosystem at all, since it is the CLI frontend that would need to be implemented atop of
So, 1 to 3, are pretty standard things for any wrapper CLI to do, and I don't see a way around not implementing these in the wrapper other than using a prebuilt binary of our CLI. |
Excellent, thanks for the tip. |
Sounds good to me, thanks for sharing your view here.
By this, I merely meant that we (Project Robius) are trying to avoid creating tools that duplicate functionality that already exists in the ecosystem. I've also discussed this goal at length with the Linebender project, though not relevant to this packaging concern specifically. Either way, it's okay with me --- we'll continue on the path to creating a frontend wrapper around cargo-packager, and I can then periodically submit PRs here for features that I consider worthy of including in cargo-packager itself. |
Thanks for your contributions |
Thanks, and thank you for all the additional information about this crate! |
Turns out that whether the |
Thanks for this fantastic crate! We're starting to use it for packaging up some Project Robius applications.
This PR fixes a minor mistake where the notarization credentials specified via environment variables are not used if a macos-specific config (
[package.metadata.packager.macos]
) has been specified in theCargo.toml
, but that config section doesn't include thenotification_credentials
field.Currently there is another related bug in the schema parsing that doesn't actually allow you to provide the
notarization_credentials
in the package metadata of Cargo.toml, so this change is actually the only way to currently use the notarization features on macOS, as far as I can tell.More specifically, when I attempt to specify the
notarization_credentials
field in[package.metadata.packager.macos]
, I get an error about that field not existing in the schema. I'm not personally sure how to fix that, though.However, even when that has been fixed, I still think it's beneficial to be able to specify secrets like this via env vars on the command line, instead of being required to place it in the
Cargo.toml
file, for security purposes.