Skip to content

Add default TypeAuthorizer routing for controlplane services#291

Open
mhotan wants to merge 10 commits intomainfrom
mike/selfhosted-authz-routing
Open

Add default TypeAuthorizer routing for controlplane services#291
mhotan wants to merge 10 commits intomainfrom
mike/selfhosted-authz-routing

Conversation

@mhotan
Copy link
Contributor

@mhotan mhotan commented Mar 19, 2026

Summary

  • All non-authorizer services now default to TypeAuthorizer, routing Authorize() calls to the in-cluster authorizer service
  • The authorizer service itself defaults to TypeNoop (no enforcement)
  • Adds documentation comment showing how to configure TypeExternal for customer-provided authorization servers
  • Templatized endpoint uses fullnameOverride | default "authorizer" for robustness

This moves generic authorization routing config that was previously injected by Terraform overlays into the helm chart defaults. A follow-up cloud PR will remove the redundant Terraform overrides.

Test plan

  • helm template renders correct authorizer config in all service ConfigMaps
  • Deploy to ext-authz staging environment and verify authorization routing
  • Verify authorizer service ConfigMap shows type: Noop (not routing to itself)

🤖 Generated with Claude Code

@aviator-app
Copy link
Contributor

aviator-app bot commented Mar 19, 2026

Current Aviator status

Aviator will automatically update this comment as the status of the PR changes.
Comment /aviator refresh to force Aviator to re-examine your PR (or learn about other /aviator commands).

This pull request is currently open (not queued).

How to merge

To merge this PR, comment /aviator merge or add the mergequeue label.


See the real-time status of this PR on the Aviator webapp.
Use the Aviator Chrome Extension to see the status of your PR within GitHub.

@mhotan mhotan force-pushed the mike/selfhosted-authz-routing branch from 8181474 to 8882661 Compare March 19, 2026 00:33
# enforcement). To enable external authorization, configure TypeExternal on
# the authorizer service:
#
# services.authorizer.configMap.authorizer:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why can't we move this comment directly to where authorizer needs to be configured?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call — moved the TypeExternal config example to services.authorizer.configMap.authorizer where users actually configure it. The configMap.authorizer comment now just points to that section. See d6df680.

@mhotan mhotan force-pushed the mike/selfhosted-authz-routing branch 2 times, most recently from d360c78 to 95b786c Compare March 19, 2026 10:35
mhotan and others added 3 commits March 19, 2026 09:54
All non-authorizer services now route Authorize() calls to the in-cluster
authorizer service by default. The authorizer service itself defaults to
Noop (no enforcement). To enable external authorization, override the
authorizer service config with TypeExternal pointing to a customer's
gRPC authorization server.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Relocates the external authorization configuration comment from
configMap.authorizer (where non-authorizer services are configured)
to services.authorizer.configMap.authorizer (where users actually
configure the authorizer service). Addresses PR review feedback.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The external authorization client now uses apimachinery/grpc.Config
(grpcConfig) instead of flat endpoint/timeout/plaintextGrpc fields.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mhotan mhotan force-pushed the mike/selfhosted-authz-routing branch from 95b786c to df456a7 Compare March 19, 2026 16:54
mhotan and others added 3 commits March 19, 2026 18:36
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Picks up #293 (consolidated ingress auth annotations) which fixes
ListRuns 400 on selfhosted — nginx was missing the /me auth subrequest
annotations on the gRPC ingress, so browser requests had no identity
headers.

Conflict resolution: kept TypeAuthorizer routing (our branch) over
UserClouds (main), updated authorizerEndpoint to use dns:/// scheme.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
All non-authorizer services now default to TypeAuthorizer, routing
authorization calls through the in-cluster authorizer service via
nginx. The authorizer service itself defaults to Noop.

Documents how to configure the authorizer backend for:
- Union Cloud (UserClouds) — with full config example
- Selfhosted (External) — customer-provided gRPC authz server

Also documents UserClouds override patterns for flyteadmin and
cacheservice configs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
# userCloudsClient:
# tenantUrl: 'http://{{ .Release.Name }}-union-authz.{{ .Release.Namespace }}.svc.cluster.local:8080'
# tenantID: '623771e7-ddd6-4575-bedb-7c970ec75b87'
# clientID: '{{ .Values.union.authz.clientID }}'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can we not use the existing internal service to service OAuth App?

# For Union Cloud deployments, set type to "UserClouds":
# authorizer:
# type: "UserClouds"
# userCloudsClient:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It would probably make sense and be less confusing for customers to just uncomment config that they should never worry about. It's gated on type: UserClouds

mhotan and others added 4 commits March 25, 2026 17:10
Change authorizerEndpoint from nginx ingress controller to the
authorizer service directly. The nginx path applies /me auth
subrequests to all protected-grpc routes including internal
AuthorizerService calls, causing 401s on service-to-service
Authorize() calls that don't carry browser cookies.

Direct routing bypasses this — internal services talk to the
authorizer over plain gRPC without nginx auth interference.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Migrate from bare `authorizerEndpoint` string to structured
`authorizerClient` with `grpcConfig` (host, insecure, etc.) and
`forwardHeaders`. This matches the ExternalClient config pattern
and allows transport settings to be configured via values.

Sets `insecure: true` for direct plaintext gRPC to the authorizer
service, and explicitly lists forwarded metadata headers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove the `global.AUTHZ_TYPE` variable and all derived logic:
- Remove the forced Noop override in _helpers.tpl that stomped on
  any authorizer type set via values overlays
- Replace AUTHZ_TYPE guards in templates/authz/* with
  union.authz.enabled (controls UserClouds sidecar pods only)
- Remove AUTHZ_TYPE from global defaults

Authorization mode is now configured solely through
services.authorizer.configMap.authorizer.type and the corresponding
client config (authorizerClient, externalClient, userCloudsClient).
No global flag needed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace union.authz.enabled with a check on
services.authorizer.configMap.authorizer.type == "UserClouds".
The union-authz (userclouds-lite) pods now auto-deploy when the
authorizer backend is set to UserClouds — no separate enable flag.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mhotan mhotan force-pushed the mike/selfhosted-authz-routing branch from a120b88 to f16f8f6 Compare March 25, 2026 08:36
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