Enable request overrides at the *Builder level and HyperClient method calls#149
Enable request overrides at the *Builder level and HyperClient method calls#149michaelborn wants to merge 11 commits intodevelopmentfrom
Conversation
|
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
|---|---|---|---|---|---|
| 28573790 | Triggered | Username Password | b6caa22 | test-harness/tests/specs/unit/HyperClientTest.cfc | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secret safely. Learn here the best practices.
- Revoke and rotate this secret.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
There was a problem hiding this comment.
Pull request overview
This PR introduces per-request connection/request configuration overrides across cbElasticsearch’s fluent builders (e.g., IndexBuilder, SearchBuilder, Document) and direct HyperClient method calls, allowing callers to tweak request-level settings such as timeouts, headers, and credentials without changing global config.
Changes:
- Added a shared
BaseModelthat captures fluent.with*()calls into arequestOverridesstruct for builder/model instances. - Extended
HyperPool.newRequest()and manyHyperClientmethods to accept arequestOverridesstruct and apply it to the underlying HyperRequest. - Added unit tests and documentation describing builder-level overrides and direct client call overrides.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| test-harness/tests/specs/unit/HyperClientTest.cfc | Adds unit tests covering request override behavior (timeout, credentials, headers). |
| models/io/HyperPool.cfc | Adds overrides parameter to newRequest() and attempts to apply override keys onto HyperRequest instances. |
| models/io/HyperClient.cfc | Threads requestOverrides through many public API calls and merges them with builder-level overrides. |
| models/SearchBuilder.cfc | Extends BaseModel to support fluent request overrides. |
| models/Pipeline.cfc | Extends BaseModel to support fluent request overrides. |
| models/IndexBuilder.cfc | Extends BaseModel to support fluent request overrides. |
| models/ILMPolicyBuilder.cfc | Extends BaseModel to support fluent request overrides. |
| models/Document.cfc | Extends BaseModel to support fluent request overrides. |
| models/BaseModel.cfc | New base class implementing requestOverrides storage and .with*() capture via onMissingMethod(). |
| models/AliasBuilder.cfc | Extends BaseModel to support fluent request overrides. |
| docs/Getting-Started/Configuration.md | Documents request override usage, merge precedence, and examples for builders and HyperClient calls. |
Thanks, Copilot. :)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
adobe@2025 Test Results 1 files ± 0 17 suites ±0 20s ⏱️ -39s For more details on these failures and errors, see this check. Results for commit e9ab26d. ± Comparison against base commit 0a12b02. This pull request removes 83 and adds 8 tests. Note that renamed tests count towards both. |
adobe@2025 Test Results 1 files ± 0 17 suites ±0 19s ⏱️ -40s For more details on these failures and errors, see this check. Results for commit 834dfcc. ± Comparison against base commit 0a12b02. This pull request removes 83 and adds 8 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
adobe@2023 Test Results 1 files ± 0 17 suites ±0 21s ⏱️ -39s For more details on these failures and errors, see this check. Results for commit 834dfcc. ± Comparison against base commit 0a12b02. This pull request removes 83 and adds 8 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
adobe@2021 Test Results 1 files ± 0 17 suites ±0 20s ⏱️ -40s For more details on these failures and errors, see this check. Results for commit 834dfcc. ± Comparison against base commit 0a12b02. This pull request removes 83 and adds 8 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This PR adds the ability to set custom connection parameters for each request, both at the Builder level:
as well as the individual HyperClient method calls like
applyIndex(),indexExists(),executeSearch(), etc.: