Skip to content

Commit 0efc5f4

Browse files
committed
Feat: Add token-broker service for OAuth session and token management
The token-broker service provides centralized OAuth token acquisition for AI agents via PKCE-based authorization flows, token caching with JWT expiry parsing, and session management with long-polling coordination. Signed-off-by: David Hadas <david.hadas@gmail.com>
1 parent fb22549 commit 0efc5f4

37 files changed

Lines changed: 7801 additions & 15 deletions
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# `--platform=$BUILDPLATFORM` pins the builder stage to the host arch so
2+
# Go cross-compiles to $TARGETARCH instead of running under QEMU. With
3+
# CGO disabled (below), the resulting binary is bit-for-bit identical to
4+
# a native build but ~9x faster for the arm64 variant.
5+
FROM --platform=$BUILDPLATFORM docker.io/golang:1.26 AS builder
6+
ARG TARGETOS
7+
ARG TARGETARCH
8+
9+
WORKDIR /workspace
10+
COPY go.mod go.mod
11+
COPY go.sum go.sum
12+
RUN go mod download
13+
14+
COPY cmd/token-broker/ cmd/token-broker/
15+
COPY internal/tokenbroker/ internal/tokenbroker/
16+
COPY pkg/oauth/ pkg/oauth/
17+
18+
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -o token-broker ./cmd/token-broker/
19+
20+
FROM gcr.io/distroless/static:nonroot
21+
WORKDIR /
22+
COPY --from=builder /workspace/token-broker .
23+
USER 65532:65532
24+
25+
ENTRYPOINT ["/token-broker"]

0 commit comments

Comments
 (0)