Skip to content

feat: dynamic authentication headers support with request_arguments#77

Merged
hgiasac merged 7 commits intomainfrom
toan/plat-1121-dynamic-authentication-headers-support-request_argumentsfor
Sep 24, 2025
Merged

feat: dynamic authentication headers support with request_arguments#77
hgiasac merged 7 commits intomainfrom
toan/plat-1121-dynamic-authentication-headers-support-request_argumentsfor

Conversation

@hgiasac
Copy link
Copy Markdown
Collaborator

@hgiasac hgiasac commented Sep 23, 2025

Support dynamic authentication headers with request-level arguments.

You can use a Pre-NDC Request Plugin to modify the request, and add dynamic headers in runtime via request_arguments.headers field, which is a string map. Those headers will be merged into the HTTP request headers before being sent to external services.

See the full example at Pre-NDC Request Plugin Request

{
  // ...
  "ndcRequest": {
    // ...
    "request_arguments": {
        "headers": {
            "Authorization": "Bearer <token>",
            "X-Custom-Header": "foo"
        }
    }
  }
}

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Sep 23, 2025

Code Coverage

Package Line Rate Health
github.com/hasura/ndc-http/connector 62%
github.com/hasura/ndc-http/connector/internal/argument 56%
github.com/hasura/ndc-http/connector/internal 56%
github.com/hasura/ndc-http/connector/internal/contenttype 60%
github.com/hasura/ndc-http/connector/internal/security 67%
github.com/hasura/ndc-http/exhttp 63%
github.com/hasura/ndc-http/ndc-http-schema/command 60%
github.com/hasura/ndc-http/ndc-http-schema/configuration 63%
github.com/hasura/ndc-http/ndc-http-schema/ndc/internal 57%
github.com/hasura/ndc-http/ndc-http-schema/ndc 72%
github.com/hasura/ndc-http/ndc-http-schema/openapi/internal 74%
github.com/hasura/ndc-http/ndc-http-schema/openapi 56%
github.com/hasura/ndc-http/ndc-http-schema/schema 66%
github.com/hasura/ndc-http/ndc-http-schema/utils 50%
Summary 63% (7578 / 11971)

Minimum allowed line rate is 40%

Correct grammatical errors and improve clarity in the documentation regarding dynamic headers and DataConnectorLink metadata.
@hgiasac hgiasac marked this pull request as ready for review September 24, 2025 09:55
@hgiasac hgiasac requested a review from Copilot September 24, 2025 09:55
Copy link
Copy Markdown

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

This PR introduces support for dynamic authentication headers through request-level arguments, enabling runtime header injection via Pre-NDC Request Plugins. The primary change allows headers to be passed through request_arguments.headers field and merged into HTTP requests before sending to external services.

Key changes:

  • Added support for dynamic headers via request_arguments.headers in query and mutation operations
  • Updated method signatures throughout the codebase to pass request arguments
  • Added new documentation for dynamic headers forwarding

Reviewed Changes

Copilot reviewed 30 out of 33 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
connector/query.go Added request arguments parsing and passing to execution methods
connector/mutation.go Added request arguments parsing and passing to execution methods
connector/internal/upstream.go Updated HTTP client creation to merge dynamic headers
connector/internal/types.go Added HTTPRequestArguments struct definition
connector/internal/client.go Updated client to use request arguments
docs/dynamic_headers.md New documentation for dynamic headers functionality
Multiple schema files Comment corrections and best practice improvements

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread ndc-http-schema/openapi/oas3.go
Comment thread ndc-http-schema/openapi/oas2.go
Comment thread connector/connector_test.go
@hgiasac hgiasac merged commit 63249f6 into main Sep 24, 2025
1 check passed
@hgiasac hgiasac deleted the toan/plat-1121-dynamic-authentication-headers-support-request_argumentsfor branch September 24, 2025 09:58
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