Skip to content

Add _U_AUTH_TYPE env var to init_in_cluster()#662

Open
mhotan wants to merge 1 commit intomainfrom
mike/auth-bypass
Open

Add _U_AUTH_TYPE env var to init_in_cluster()#662
mhotan wants to merge 1 commit intomainfrom
mike/auth-bypass

Conversation

@mhotan
Copy link
Contributor

@mhotan mhotan commented Feb 12, 2026

Summary

  • Adds support for the _U_AUTH_TYPE environment variable in init_in_cluster(), allowing task pods to override the default PKCE auth type
  • When set to "Passthrough", the SDK skips OAuth metadata fetching (AuthMetadataService.GetOAuth2Metadata()), which prevents cascading DEADLINE_EXCEEDED errors against endpoints that don't implement AuthMetadataService
  • Intended for selfhosted / closed network environments where OAuth is not required and task pods connect directly to internal services (e.g. the queue service) bypassing ingress and authentication

Test plan

  • Verify _U_AUTH_TYPE=Passthrough is picked up by init_in_cluster() and passed through to init.aio() as auth_type
  • Verify task pods in selfhosted deployments no longer hit DEADLINE_EXCEEDED on EnqueueAction gRPC calls
  • Verify default behavior (no env var set) is unchanged — PKCE auth is used as before

🤖 Generated with Claude Code

Allow selfhosted task pods to override the auth type via the
_U_AUTH_TYPE environment variable. When set to "Passthrough", the SDK
skips OAuth metadata fetching against the queue service endpoint,
which doesn't implement AuthMetadataService and would cause cascading
DEADLINE_EXCEEDED errors.

This is intended for selfhosted environments where OAuth is not
required, e.g. closed network deployments where task pods connect
directly to internal services bypassing ingress and authentication.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Michael Hotan <mike@union.ai>
# where the endpoint is the queue service which doesn't implement AuthMetadataService)
auth_type_str = os.getenv(AUTH_TYPE_OVERRIDE, "")
if auth_type_str:
remote_kwargs["auth_type"] = auth_type_str
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

qq: can we always set it to Passthrough when _U_INSECURE_SKIP_VERIFY is true

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