Skip to content

[PureGo] Add auth provider interfaces and per-table token cache#495

Draft
zlata-stefanovic-db wants to merge 1 commit into
purego-transport-headersfrom
purego-auth-cache
Draft

[PureGo] Add auth provider interfaces and per-table token cache#495
zlata-stefanovic-db wants to merge 1 commit into
purego-transport-headersfrom
purego-auth-cache

Conversation

@zlata-stefanovic-db

@zlata-stefanovic-db zlata-stefanovic-db commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Second of a 3-PR stack. Stacked on #494 (base branch purego-transport-headers).

Introduces the auth package foundations:

  • HeadersProvider interface — the single auth extension point, matching the Rust SDK (and duck-type compatible with the transport's local HeadersProvider from [PureGo] Add custom auth-header hook to transport #494).
  • StaticHeadersProvider — returns a fixed headers map, for tests or externally managed credentials.
  • A per-table token cache with proactive refresh and single-flight minting, which bounds a failing token endpoint to one mint per burst rather than N serial attempts.

OAuth-backed providers land in the follow-up PR.

Stack

  1. [PureGo] Add custom auth-header hook to transport #494 — transport header hook
  2. this PR — auth HeadersProvider + token cache
  3. [PureGo] Add UC OAuth token provider with per-table caching #496 — UC OAuth provider

Test plan

  • go build ./internal/auth/ and go test ./internal/auth/ pass.

Note

Rebased on the updated #494, which dropped StreamParams.Token in favor of the HeadersProvider hook. Auth is expressed solely through HeadersProvider; a speculative TokenProvider interface (and StaticTokenProvider) was dropped as unused, mirroring the Rust SDK where HeadersProvider is the only extension point. The header-provider types live in headers_provider.go.

@zlata-stefanovic-db zlata-stefanovic-db force-pushed the purego-transport-headers branch from 9a37c80 to dd85ce6 Compare July 13, 2026 09:53
@zlata-stefanovic-db zlata-stefanovic-db force-pushed the purego-transport-headers branch from dd85ce6 to 9bd111b Compare July 13, 2026 10:01
@zlata-stefanovic-db zlata-stefanovic-db self-assigned this Jul 13, 2026
@zlata-stefanovic-db zlata-stefanovic-db force-pushed the purego-transport-headers branch from 9bd111b to ac84862 Compare July 13, 2026 10:30
@zlata-stefanovic-db zlata-stefanovic-db force-pushed the purego-transport-headers branch from ac84862 to a8ccc95 Compare July 13, 2026 10:33
@zlata-stefanovic-db zlata-stefanovic-db force-pushed the purego-transport-headers branch from cf75cbf to b22dc27 Compare July 13, 2026 15:51
@zlata-stefanovic-db zlata-stefanovic-db force-pushed the purego-auth-cache branch 5 times, most recently from 0048318 to f030ec5 Compare July 14, 2026 12:45
Introduce the auth package's HeadersProvider interface with a
StaticHeadersProvider implementation, plus a per-table token cache with
proactive refresh and single-flight minting to bound a failing token endpoint
to one mint per burst. OAuth-backed providers land in a follow-up.

Signed-off-by: Zlata Stefanovic <zlata.stefanovic@databricks.com>
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.

1 participant