test: extend identity injection and auth header regression coverage#385
Draft
cursor[bot] wants to merge 12 commits into
Draft
test: extend identity injection and auth header regression coverage#385cursor[bot] wants to merge 12 commits into
cursor[bot] wants to merge 12 commits into
Conversation
Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
Add focused unit tests for buildBodyNormalized wrapped-body identifier injection and conflict detection, plus harness-client non-FME header casing and connector update success path regression coverage for PR #328. Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
…nd create path Add body-normalizer unit tests for unwrapKey injection (service, environment) and flat-body override updates. Add harness_update integration tests for service identifier injection and environment conflict rejection. Assert connector create never auto-injects connector_id from params. Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
… id coercion Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
|
|
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.
Summary
Adds focused regression tests for recently merged identity-injection and auth-header behavior in the Harness MCP server.
Risky behavior now covered
buildBodyNormalizedmust injectconnector_id/service_id/environment_idinto wrapped YAML/JSON update bodies, not the outer envelope.resource_idand bodyidentifierdisagree (connectors, services, environments).connector_idfor a missing body identifier; explicit body identifiers are preserved.Authorization/x-api-keymust be honored regardless of header casing; FME requests must strip allx-api-keyvariants.x-api-keyheaders are present, the first non-placeholder value is used for bearer auth and all variants are removed before the request is sent.resource_idvalues without false conflicts.Test files added/updated
tests/utils/body-normalizer.test.tsinjectFieldswithwrapKey, boolean/numeric coerciontests/client/harness-client.test.tstests/tools/tool-handlers.test.tsharness_update/harness_createflows for connector, service, and environment identity handlingtests/resources/pipeline-yaml.test.tstests/resources/execution-summary.test.tsWhy this reduces regression risk
These paths sit on the boundary between agent input and Harness API calls — silent mis-injection or auth layering bugs cause hard-to-debug 4xx failures or credential leaks to third-party endpoints (Split.io). The tests lock the public contract at both the unit layer (
body-normalizer,HarnessClient) and the tool dispatch layer (harness_update/harness_create), so refactors to shared body builders or header helpers cannot regress without a failing test.Validation