Skip to content

[coverage] AUTH-245901: Caller-Supplied Credentials Provider Authenticates Every Request #1092

Backlog

Description

@oss-engineer-bot

Expected behavior

Connect with a CALLER-SUPPLIED credentials provider as the only credential source -- no static token, OAuth, JWT or Azure credential is configured on the connection -- and drive a session through ope…

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
- provider_invocations:
    min: 2
- oauth_token_calls:
    expected: 0
protocol:
  thrift:
  - call_min:
      method: OpenSession
      min: 1
  - call_min:
      method: ExecuteStatement
      min: 1
  - call_min:
      method: CloseSession
      min: 1
  - request_header:
      scope: all_warehouse_requests
      name: Authorization
      present: true
  - request_header:
      scope: all_warehouse_requests
      name: X-Databricks-Driver-Test-Provider
      equals: provider-sentinel
  sea:
  - call_min:
      operation: CreateSession
      min: 1
  - call_min:
      operation: ExecuteStatement
      min: 1
  - call_min:
      operation: DeleteSession
      min: 1
  - request_header:
      scope: all_warehouse_requests
      name: Authorization
      present: true
  - request_header:
      scope: all_warehouse_requests
      name: X-Databricks-Driver-Test-Provider
      equals: provider-sentinel

What this driver does

  • Thrift: Thrift: TokenFederationProvider caches a caller-supplied credentials provider's first Authorization for the whole connection, so the provider is consulted once per session and its headers reach no request after the first
    • test: test_caller_supplied_credentials_provider_authenticates_every_request
  • Thrift: TokenFederationProvider caches a caller-supplied credentials provider's first Authorization for the whole connection (auth/token_federation.py:110-126), so the provider is consulted once per session and the headers it returns reach no request after the first — a caller cannot rotate or refresh a credential that expires while the session is open.

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