Skip to content

fix(security)!: require create-security params for quicknode-sdk 0.4 (DX-5869)#45

Merged
johnpmitsch merged 1 commit into
mainfrom
dx-5869-require-create-security-params-for-quicknode-sdk-04
Jun 24, 2026
Merged

fix(security)!: require create-security params for quicknode-sdk 0.4 (DX-5869)#45
johnpmitsch merged 1 commit into
mainfrom
dx-5869-require-create-security-params-for-quicknode-sdk-04

Conversation

@johnpmitsch

Copy link
Copy Markdown
Collaborator

Summary

Adapts the CLI to quicknode-sdk 0.4.0, which flips five previously-optional fields to required across the four create-security request structs:

Struct Field
CreateReferrerRequest referrer
CreateIpRequest ip
CreateJwtRequest public_key, name
CreateRequestFilterRequest method

Drops the Some(...) wrappers at the call sites in src/commands/endpoint/security.rs so the CLI compiles against 0.4. The CLI already collected these as required types at the arg layer, with one exception: endpoint security jwt add --name was optional. It's now a required flag, matching the API contract, so users get a clear arg-parser error instead of a server 400. Empty-but-present values still round-trip to the server's 400.

Test plan

  • Updated endpoint_security_jwt_add_with_kid to pass --name and assert it in the body.
  • Added endpoint_security_jwt_add_requires_name (omitting --name exits non-zero, zero requests reach the mock).
  • Backfilled the previously-untested create paths: endpoint security ip add and endpoint security request-filter create, with exact body_json matchers.
  • cargo test (117 lib + all integration), cargo clippy --all-targets -- -D warnings, cargo fmt --check, cargo build --release all pass.
  • Manual: qn endpoint security jwt add ep-1 --public-key pk --kid kid-1 now errors --name <NAME> required.

Closes DX-5869

…(DX-5869)

quicknode-sdk 0.4.0 flips five previously-optional fields to required
across the four create-security request structs (referrer, ip, jwt
public_key/name, request-filter method). Drop the `Some(...)` wrappers
at the call sites in endpoint/security.rs so the CLI compiles against 0.4.

`endpoint security jwt add --name` becomes a required flag, matching the
API contract: users get a clear arg-parser error instead of a server 400.
Empty-but-present values still round-trip to the server's 400.

Updates the jwt-add test to pass --name, adds a test asserting --name is
required (zero requests reach the mock), and backfills the previously
untested create paths for `ip add` and `request-filter create`.
@johnpmitsch johnpmitsch merged commit 5fcbf27 into main Jun 24, 2026
13 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.

2 participants