Skip to content

[coverage] AUTH-245902: Credentials-Provider Header Replaces Configured Custom Header Of Same Name #1093

Backlog

Description

@oss-engineer-bot

Expected behavior

When a connection configures caller custom headers AND a caller-supplied credentials provider, the provider -- consulted per request, so it is the live source -- wins for the header names it returns,…

Per the shared spec:

  • result has exactly 1 row(s)
  • col 0, row 0 == 1 (type Int32)
  • full assertion contract:
result:
- row_count: 1
- column:
    index: 0
    row: 0
    type: Int32
    equals: 1
protocol:
  thrift:
  - call_min:
      method: OpenSession
      min: 1
  - call_min:
      method: ExecuteStatement
      min: 1
  - request_header:
      scope: all_warehouse_requests
      name: X-Databricks-Driver-Test
      equals: provider-sentinel
  - request_header:
      scope: all_warehouse_requests
      name: X-Databricks-Driver-Test-Other
      equals: configured-other
  sea:
  - call_min:
      operation: CreateSession
      min: 1
  - call_min:
      operation: ExecuteStatement
      min: 1
  - request_header:
      scope: all_warehouse_requests
      name: X-Databricks-Driver-Test
      equals: provider-sentinel
  - request_header:
      scope: all_warehouse_requests
      name: X-Databricks-Driver-Test-Other
      equals: configured-other

What this driver does

  • Thrift: Thrift: TokenFederationProvider.add_headers copies only Authorization out of a caller-supplied credentials provider's headers and silently discards every other header it returned, so a provider header never replaces a configured http_headers entry of the same name
    • test: test_credentials_provider_header_replaces_configured_header_of_same_name
  • Thrift: TokenFederationProvider.add_headers copies only Authorization out of a caller-supplied credentials provider's headers and silently discards every other header it returned, so a provider header never replaces a configured http_headers entry of the same name.

Reproduce

SELECT 1 AS test_value

About this finding

Candidate finding from the cross-driver coverage run for databricks/databricks-sql-kernel#527. The test that found it is in https://github.com/databricks/databricks-driver-test/pull/2460, which is still in review. If that PR closes without merging, this issue no longer applies.

The spec describes what users of every driver should see. It doesn't ask this driver to copy another driver's implementation. If this driver gets the same user-visible result another way, or the spec asks for more than the product guarantees, say so on the coverage PR and the spec will change instead.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions