-
-
Notifications
You must be signed in to change notification settings - Fork 13.2k
fnox 1.2.3 (new formula) #252266
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
Closed
Closed
fnox 1.2.3 (new formula) #252266
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| class Fnox < Formula | ||
| desc "Fort Knox for your secrets - flexible secret management tool" | ||
| homepage "https://fnox.jdx.dev/" | ||
| url "https://github.com/jdx/fnox/archive/refs/tags/v1.2.3.tar.gz" | ||
| sha256 "a71ace05facbea5238ac6dbeb457dcbda179d9db4d4904f5e7ea59d3a23599d3" | ||
| license "MIT" | ||
| head "https://github.com/jdx/fnox.git", branch: "main" | ||
|
|
||
| livecheck do | ||
| url :stable | ||
| strategy :github_latest | ||
| end | ||
|
|
||
| depends_on "rust" => :build | ||
|
|
||
| on_linux do | ||
| depends_on "openssl@3" | ||
| end | ||
|
|
||
| def install | ||
|
Check failure on line 20 in Formula/f/fnox.rb
|
||
| # Ensure that the `openssl` crate picks up the intended library on Linux | ||
| ENV["OPENSSL_DIR"] = Formula["openssl@3"].opt_prefix.to_s if OS.linux? | ||
| ENV["OPENSSL_NO_VENDOR"] = "1" | ||
|
|
||
| system "cargo", "install", *std_cargo_args | ||
|
|
||
| generate_completions_from_executable(bin/"fnox", "completion") | ||
| end | ||
|
|
||
| test do | ||
| assert_match "fnox #{version}", shell_output("#{bin}/fnox --version") | ||
|
|
||
| # Generate test age key using system age-keygen | ||
| test_key = shell_output("age-keygen") | ||
| test_key_line = test_key.lines.grep(/^# public key:/).first.sub(/^# public key: /, "").strip | ||
| secret_key_line = test_key.lines.grep(/^AGE-SECRET-KEY-/).first.strip | ||
|
|
||
| # Test with age encryption | ||
| (testpath/"fnox.toml").write <<~TOML | ||
| [providers] | ||
| age = { type = "age", recipients = ["#{test_key_line}"] } | ||
|
|
||
| [secrets] | ||
| TEST_SECRET = { provider = "age", value = "test-value" } | ||
| TOML | ||
|
|
||
| # Set the secret properly so it gets encrypted | ||
| ENV["FNOX_AGE_KEY"] = secret_key_line | ||
| system bin/"fnox", "set", "TEST_SECRET", "test-value", "--provider", "age" | ||
|
|
||
| # Test list shows the secret | ||
| output = shell_output("#{bin}/fnox list") | ||
| assert_match "TEST_SECRET", output | ||
|
|
||
| # Test list --values shows decrypted value | ||
| output = shell_output("FNOX_AGE_KEY='#{secret_key_line}' #{bin}/fnox list --values") | ||
| assert_match "TEST_SECRET.*test-value", output | ||
| end | ||
| end | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The
openssl@3dependency is declared in theon_linuxblock but is unconditionally used in theinstallmethod viaFormula['openssl@3']. Consider adding a guard to ensure the formula reference only occurs when the dependency is actually declared, or move the dependency outside the platform-specific block with appropriate conditions.