Skip to content

test(alias): cover RC_HOST access-key percent errors#192

Merged
overtrue merged 1 commit into
mainfrom
codex/test-rc-host-access-key-percent
May 10, 2026
Merged

test(alias): cover RC_HOST access-key percent errors#192
overtrue merged 1 commit into
mainfrom
codex/test-rc-host-access-key-percent

Conversation

@overtrue
Copy link
Copy Markdown
Contributor

Related Issue

No direct issue. This follows up on recent RC_HOST credential parsing fixes.

Background

Recent changes reject malformed percent-encoding in RC_HOST credentials and ensure JSON errors do not expose credentials. Existing tests covered the malformed secret-key path, but the access-key branch used the same decoder without direct coverage.

Solution

Added a core parser regression test for malformed access-key percent-encoding. Added a CLI JSON-contract test that verifies alias list returns usage exit code 2, reports the access-key error, and redacts both access and secret values from stderr.

Test Status

  • cargo test -p rc-core test_parse_rc_host_alias_rejects_invalid_access_key_percent_encoding
  • cargo test -p rustfs-cli --test env_alias alias_list_rejects_invalid_rc_host_access_key_percent_encoding_without_credentials
  • make pre-commit

@overtrue overtrue marked this pull request as ready for review May 10, 2026 09:14
Copilot AI review requested due to automatic review settings May 10, 2026 09:14
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds regression coverage to ensure malformed percent-encoding in RC_HOST access-key credentials is rejected and that CLI JSON error output does not leak credentials, complementing existing coverage for the secret-key branch.

Changes:

  • Added a core parser unit test asserting invalid percent-encoding in the access key is rejected and credentials are not included in the error string.
  • Added a CLI JSON-contract integration test asserting rc alias list --json returns exit code 2, reports the access-key decoding error, and redacts access/secret values from stderr.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
crates/core/src/alias.rs Adds a unit test covering invalid access-key percent-encoding and credential redaction in the parser error output.
crates/cli/tests/env_alias.rs Adds an integration test ensuring alias list --json surfaces the access-key percent-encoding error with exit code 2 and redacted stderr JSON.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@overtrue overtrue merged commit 112974c into main May 10, 2026
19 checks passed
@overtrue overtrue deleted the codex/test-rc-host-access-key-percent branch May 10, 2026 10:10
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.

2 participants