Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 22 additions & 6 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Dependabot config (issue #118). Keeps both Go modules' go.mod/go.sum and the
# SHA-pinned GitHub Actions current — supply-chain hygiene that travels with the
# engine library when the downstream consumer pins it.
# Dependabot config (issue #118). Keeps every Go module's go.mod/go.sum and the
# SHA-pinned GitHub Actions current — supply-chain hygiene for the root binary,
# importable engine, reusable authn adapter, and opt-in providers.
#
# Dependabot processes each gomod directory INDEPENDENTLY, so the workspace's two
# modules (root + engine) each get their own update config. Minor+patch bumps are
# GROUPED into a single PR per ecosystem to cut review noise; majors stay separate
# Dependabot processes each gomod directory INDEPENDENTLY, so every workspace
# module gets its own update config. Minor+patch bumps are GROUPED into a single
# PR per ecosystem to cut review noise; majors stay separate
# (they can break, so they deserve an individual PR).
#
# The repo SHA-pins every GitHub Action with a `# vX.Y.Z` comment. Dependabot
Expand Down Expand Up @@ -45,6 +45,22 @@ updates:
- minor
- patch

# Opt-in caller-identity adapter module (ADR 0103; not a provider).
- package-ecosystem: gomod
directory: "/authn/oidc"
schedule:
interval: weekly
open-pull-requests-limit: 10
commit-message:
prefix: "chore(deps)"
labels:
- dependencies
groups:
go-minor-patch:
update-types:
- minor
- patch

# Opt-in LLM-provider submodules (ADR 0093) — each its own go.mod closure.
- package-ecosystem: gomod
directory: "/provider/anthropic"
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ jobs:
cache-dependency-path: |
go.sum
engine/go.sum
authn/oidc/go.sum
provider/ssefilter/go.sum
provider/anthropic/go.sum
provider/openai/go.sum
Expand All @@ -67,6 +68,9 @@ jobs:
- name: go build (engine module)
run: cd engine && go build ./...

- name: go build (OIDC authn module)
run: cd authn/oidc && go build ./...

# provider/ holds the opt-in LLM-provider Go submodules (ADR 0093), each
# its own module under the workspace — build them explicitly too.
- name: go build (provider modules)
Expand All @@ -92,6 +96,7 @@ jobs:
cache-dependency-path: |
go.sum
engine/go.sum
authn/oidc/go.sum
provider/ssefilter/go.sum
provider/anthropic/go.sum
provider/openai/go.sum
Expand All @@ -110,6 +115,9 @@ jobs:
- name: go test -race (engine module)
run: cd engine && go test -race ./...

- name: go test -race (OIDC authn module)
run: cd authn/oidc && go test -race ./...

# provider/ submodules (ADR 0093) — each its own module under the workspace.
- name: go test -race (provider modules)
run: |
Expand All @@ -134,6 +142,7 @@ jobs:
cache-dependency-path: |
go.sum
engine/go.sum
authn/oidc/go.sum
provider/ssefilter/go.sum
provider/anthropic/go.sum
provider/openai/go.sum
Expand Down Expand Up @@ -164,6 +173,9 @@ jobs:
- name: golangci-lint (engine module)
run: cd engine && golangci-lint run --config ../.golangci.yml --allow-parallel-runners --timeout=8m ./...

- name: golangci-lint (OIDC authn module)
run: cd authn/oidc && golangci-lint run --config ../../.golangci.yml --allow-parallel-runners --timeout=8m ./...

# provider/ submodules (ADR 0093) — each its own module, sharing the ROOT
# golangci config so the depguard allowlists stay the single source of truth.
- name: golangci-lint (provider modules)
Expand All @@ -179,6 +191,9 @@ jobs:
- name: go vet (engine module)
run: cd engine && go vet ./...

- name: go vet (OIDC authn module)
run: cd authn/oidc && go vet ./...

- name: go vet (provider modules)
run: |
(cd provider/ssefilter && go vet ./...)
Expand Down Expand Up @@ -233,6 +248,7 @@ jobs:
cache-dependency-path: |
go.sum
engine/go.sum
authn/oidc/go.sum
provider/ssefilter/go.sum
provider/anthropic/go.sum
provider/openai/go.sum
Expand Down Expand Up @@ -388,6 +404,7 @@ jobs:
cache-dependency-path: |
go.sum
engine/go.sum
authn/oidc/go.sum
provider/ssefilter/go.sum
provider/anthropic/go.sum
provider/openai/go.sum
Expand Down Expand Up @@ -431,6 +448,7 @@ jobs:
cache-dependency-path: |
go.sum
engine/go.sum
authn/oidc/go.sum
provider/ssefilter/go.sum
provider/anthropic/go.sum
provider/openai/go.sum
Expand Down Expand Up @@ -459,6 +477,13 @@ jobs:
cd engine && go run golang.org/x/vuln/cmd/govulncheck@v1.1.4 -format json ./... \
| go run ../.github/scripts/govulncheck-gate.go # v1.1.4

- name: govulncheck (OIDC authn module — strict, no allowlist)
shell: bash
run: |
set -o pipefail
cd authn/oidc && go run golang.org/x/vuln/cmd/govulncheck@v1.1.4 -format json ./... \
| go run ../../.github/scripts/govulncheck-gate.go # v1.1.4

# provider/ submodules (ADR 0093) — each its own module; scan against its
# own go.mod so the provider library's closure is checked independently.
- name: govulncheck (provider modules — strict, no allowlist)
Expand Down Expand Up @@ -494,6 +519,7 @@ jobs:
cache-dependency-path: |
go.sum
engine/go.sum
authn/oidc/go.sum
provider/ssefilter/go.sum
provider/anthropic/go.sum
provider/openai/go.sum
Expand Down
36 changes: 29 additions & 7 deletions .github/workflows/k8s-e2e.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# kind-based k8s e2e suite for mecak8s (ADR 0048).
#
# Spins a real kind cluster + Redis StatefulSet + two storage-free mecak8s agent
# replicas and asserts lease exclusion, graceful failover, and session persistence.
# The suite lives under e2e/k8s/ (build tag `kind_e2e`); `task e2e:k8s` runs
# `go test -tags kind_e2e -count=1 -timeout 15m ./e2e/k8s/...`. Slow (~3-5 min) and
# needs Docker, so it is NOT part of `task test` and runs only on relevant-path
# replicas and asserts lease exclusion, graceful failover, session persistence,
# and caller identity against an in-cluster Dex OIDC provider. The suite lives
# under e2e/k8s/ (build tag `kind_e2e`); `task e2e:k8s` runs
# `GOWORK=off go test -tags kind_e2e -count=1 -timeout 30m ./e2e/k8s/...`. Slow
# (~5-8 min) and needs Docker, so it is NOT part of `task test` and runs only on
# changes (the mecak8s binary, the Redis store, the server surface it composes, the
# deploy manifests, the suite itself, and the build config).
#
Expand All @@ -28,26 +29,36 @@ on:
branches: [main]
paths:
- cmd/mecak8s/**
- internal/cliconfig/**
- internal/adapter/redisstore/**
- internal/adapter/server/authn.go
- internal/adapter/server/service.go
- internal/adapter/server/errors.go
- internal/adapter/server/grpc.go
- internal/adapter/server/http.go
- deploy/mecak8s/**
- deploy/mecak8s-oidc/**
- e2e/k8s/**
- go.mod
- go.sum
- .ko.yaml
- Taskfile.yml
- .github/workflows/k8s-e2e.yml
pull_request:
paths:
- cmd/mecak8s/**
- internal/cliconfig/**
- internal/adapter/redisstore/**
- internal/adapter/server/authn.go
- internal/adapter/server/service.go
- internal/adapter/server/errors.go
- internal/adapter/server/grpc.go
- internal/adapter/server/http.go
- deploy/mecak8s/**
- deploy/mecak8s-oidc/**
- e2e/k8s/**
- go.mod
- go.sum
- .ko.yaml
- Taskfile.yml
- .github/workflows/k8s-e2e.yml
Expand All @@ -71,8 +82,8 @@ jobs:
k8s-e2e:
name: k8s e2e (kind)
runs-on: ubuntu-24.04
# The suite normally finishes in ~3-5 minutes; 20 covers a slow kind pull day.
# This is the cheap backstop UNDER the suite's own 15m `go test -timeout`.
# The suite normally finishes in ~5-8 minutes; 20 covers a slow kind pull day.
# This is the cheap backstop UNDER the suite's own 30m `go test -timeout`.
timeout-minutes: 20
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand All @@ -94,6 +105,17 @@ jobs:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}

# Validate the published base and OIDC overlay before the runtime suite. The
# Dex fixture adds its test-only private-issuer relaxation imperatively, so
# it cannot prove the operator-facing overlay remains safe or well-formed.
- name: Install deploy manifest validators
run: |
go install sigs.k8s.io/kustomize/kustomize/v5@v5.7.1
go install github.com/yannh/kubeconform/cmd/kubeconform@v0.7.0

- name: task deploy:check
run: task deploy:check

# kind: pinned version, installed via `go install` (no third-party action —
# the house idiom for go-installable tools, matching actionlint/govulncheck
# in ci.yml). v0.32.0 is the current release.
Expand All @@ -109,7 +131,7 @@ jobs:
# kubectl is pre-installed on ubuntu-24.04 runners; no install step.

# `task e2e:k8s` == `task build` (deps), then
# `go test -tags kind_e2e -count=1 -timeout 30m ./e2e/k8s/...`.
# `GOWORK=off go test -tags kind_e2e -count=1 -timeout 30m ./e2e/k8s/...`.
# KO_DOCKER_REPO=ko.local keeps the image local (no push, no credentials).
# The suite builds + resolves in a SINGLE `ko resolve` step (one image ref,
# no retagging), then `<runtime> save` + `kind load image-archive` loads the
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@
# below does NOT match `provider/<name>/v*` (the tag has a leading path segment),
# so a provider release never fires this container build, and an image release
# never re-tags a provider module.
#
# Authn-module note (ADR 0103): the reusable OIDC validator is the separate
# github.com/stacklok/mecatl/authn/oidc module, released as authn/oidc/vX.Y.Z.
# It is not a provider module. Its path-prefixed tags likewise do not match the
# root image trigger below.
name: Release

on:
Expand Down Expand Up @@ -117,6 +122,7 @@ jobs:
cache-dependency-path: |
go.sum
engine/go.sum
authn/oidc/go.sum

- uses: ko-build/setup-ko@61b4d1d396f5b2e7d6bb6fefdce3dc38d1a13445 # v0.10
- uses: sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 # v4.1.2
Expand Down Expand Up @@ -241,6 +247,7 @@ jobs:
cache-dependency-path: |
go.sum
engine/go.sum
authn/oidc/go.sum

- uses: ko-build/setup-ko@61b4d1d396f5b2e7d6bb6fefdce3dc38d1a13445 # v0.10
- uses: sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 # v4.1.2
Expand Down
16 changes: 16 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,22 @@ linters:
deny:
- pkg: os
desc: 'agent (application loop) must not import os (CLAUDE.md layering rule); side effects belong in adapters/composition'
# --- authn/oidc opt-in caller-identity module (ADR 0103) ---------------
# Production verification depends only on stdlib, the narrow engine
# principal projection, and ToolHive's authn implementation. Tests are
# exempt per the repository convention for local fixtures.
authn-oidc:
list-mode: strict
files:
- '**/authn/oidc/**.go'
- '!$test'
allow:
- $gostd
- github.com/stacklok/mecatl/engine/session
- github.com/stacklok/toolhive-core/authn
deny:
- pkg: os
desc: 'the OIDC adapter must not touch the host OS or import the root module'
# --- provider/* opt-in LLM-provider submodules (ADR 0093) ----------------
# The real provider wire-format adapters graduated OUT of internal/adapter
# into their own opt-in Go modules (consumers import the SDK transitively
Expand Down
Loading
Loading