adminclient

package
v0.7.9-rc.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 11, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package adminclient constructs the CLI's gRPC client to the control plane's AdminService. It composes auth primitives (mTLS material + signed JWT assertions) with CP-specific network topology (127.0.0.1:adminPort target, Hydra token endpoint, ServerName).

Auth primitives live in internal/auth — this package owns the wiring that turns those primitives into a working AdminServiceClient.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dial

func Dial(ctx context.Context, adminPort, hydraPort int, opts ...grpc.DialOption) (adminv1.AdminServiceClient, *grpc.ClientConn, error)

Dial connects to the CP's gRPC AdminService with mTLS + OAuth2.

  1. Load signing key + CA cert + client cert from auth material
  2. Build TLS config trusting the CLI CA
  3. Create a tokenSource that auto-refreshes via Hydra /oauth2/token
  4. Dial gRPC with mTLS + auto-refreshing bearer token in metadata

Callers may pass additional grpc.DialOption values (e.g. keepalive, observability interceptors via grpc.WithChainUnaryInterceptor). The auth/TLS baseline is appended last:

  • WithTransportCredentials: single-slot, last-wins — baseline mTLS cannot be disabled by caller intent.
  • Auth bearer-token interceptor: registered via grpc.WithChainUnaryInterceptor so it composes additively with caller chain interceptors; a caller's own grpc.WithUnaryInterceptor (if any) is prepended by grpc-go as the outermost wrapper.

Do NOT pass grpc.WithUnaryInterceptor — grpc-go stores it in a single field with last-wins semantics, so your interceptor will be silently dropped (baseline auth wins). Use grpc.WithChainUnaryInterceptor.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL