test(alias): cover RC_HOST access-key percent errors#192
Merged
Conversation
Contributor
There was a problem hiding this comment.
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 --jsonreturns 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.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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