Skip to content

fix: Bruno secret vars import and macOS launcher - #39

Open
Bulletdev wants to merge 3 commits into
mainfrom
fix/bru-secret-vars-and-launcher
Open

Bulletdev wants to merge 3 commits into
mainfrom
fix/bru-secret-vars-and-launcher

Conversation

@Bulletdev

Copy link
Copy Markdown
Member

Summary

  • BruImporter: support Bruno's vars:secret [...] bracket syntax, parsing comma-separated secret variable names into EnvVariable entries with empty values
  • BruImporter: block parser now handles both {} and [] delimiters, preventing parse corruption when vars:secret [...] blocks precede other blocks
  • loadDotEnv: merge .env file values into existing environments' empty secret variables (e.g. "qa") instead of only creating a separate ".env" environment
  • anarchrypto launcher: replace grep -oP (GNU-only Perl regex) with sed for macOS compatibility

Context

When importing a Bruno collection, secret variables (keycloak_client_id, keycloak_client_secret, etc.) were not being resolved because:

  1. Bruno's vars:secret [name1, name2] format uses [] brackets, which the block parser didn't recognize
  2. The .env file values were loaded as a separate ".env" environment instead of filling the secret placeholders in existing environments like "qa"

Test plan

  • Import a Bruno collection that uses vars:secret [...] format -- secret variable names should appear in the environment editor
  • Verify .env values are merged into existing environments' empty secrets
  • Verify the anarchrypto launcher works on macOS (version detection via sed)
  • Run ./gradlew test -- all tests pass

- BruImporter: support vars:secret [...] bracket syntax from Bruno,
  parsing comma-separated secret variable names with empty values
- BruImporter: block parser now handles both {} and [] delimiters
- loadDotEnv: merge .env values into existing environments' empty
  secret variables instead of only creating a separate ".env" env
- anarchrypto: replace grep -oP (GNU-only) with sed for macOS compat
@github-actions

Copy link
Copy Markdown

Semgrep Static Analysis

Severity Count
Errors 0
Critical (HIGH confidence) 0
Warnings 0

✅ No issues found.

@github-actions

Copy link
Copy Markdown

SpotBugs + FindSecBugs

  • Total findings: 0
  • High priority (P1/P2): 0

✅ No high-priority issues.

@github-actions

Copy link
Copy Markdown

Security Scan Summary

Check Status
SpotBugs + FindSecBugs ✅ success
Semgrep ✅ success
Secret Detection ✅ success

✅ All security checks passed!

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 6 complexity · 0 duplication

Metric Results
Complexity 6
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

- populateEnvCombo now restores the previously selected environment
  instead of resetting to "(no env)", which caused variables to silently
  stop resolving after any env combo refresh
- Reset sessionContext when environment editor saves, ensuring updated
  variable values are picked up on the next request
@github-actions

Copy link
Copy Markdown

Semgrep Static Analysis

Severity Count
Errors 0
Critical (HIGH confidence) 0
Warnings 0

✅ No issues found.

@github-actions

Copy link
Copy Markdown

SpotBugs + FindSecBugs

  • Total findings: 0
  • High priority (P1/P2): 0

✅ No high-priority issues.

@github-actions

Copy link
Copy Markdown

Security Scan Summary

Check Status
SpotBugs + FindSecBugs ✅ success
Semgrep ✅ success
Secret Detection ✅ success

✅ All security checks passed!

The \s* after the colon in the KV regex matched newlines, causing
variables with empty values (e.g. secret_key:) to swallow the next
line as their value. Replace with [ \t]* to match only horizontal
whitespace, keeping each key:value on its own line.
@github-actions

Copy link
Copy Markdown

Semgrep Static Analysis

Severity Count
Errors 0
Critical (HIGH confidence) 0
Warnings 0

✅ No issues found.

@github-actions

Copy link
Copy Markdown

SpotBugs + FindSecBugs

  • Total findings: 0
  • High priority (P1/P2): 0

✅ No high-priority issues.

@github-actions

Copy link
Copy Markdown

Security Scan Summary

Check Status
SpotBugs + FindSecBugs ✅ success
Semgrep ✅ success
Secret Detection ✅ success

✅ All security checks passed!

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.

1 participant