Skip to content

feat(slack-bot): TLS + OIDC client_credentials for remote deployments - #1054

Merged
kantord merged 3 commits into
mainfrom
slack-bot-staging-deploy
Sep 4, 2026
Merged

kantord merged 3 commits into
mainfrom
slack-bot-staging-deploy

Conversation

@kantord

@kantord kantord commented Sep 3, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Lets the Slack bot example (sdk/typescript/examples/slack-bot) point at a real deployed backend instead of only a local/Compose mecated. MECATL_GRPC_TLS=true switches the target to https:// and mints a bearer via OAuth2 client_credentials (new src/m2mToken.ts), cached and refreshed through the SDK's existing credentialProvider hook — no SDK change needed.
  • Publishes the bot as a signed, attested container image (ghcr.io/stacklok/mecatl/slack-bot) from the same v* release tag as mecated/mecatui/mecak8s, reusing the existing docker/bot.Dockerfile (its "local dev only" framing is softened since it's now also the release artifact).
  • Companion stacklok/infra PR wires this up as a real staging2 deployment talking to the shared mecak8s.

This is Fully or partially written by an AI agent.

Follow-up considered: hardened base image

Raised in review (h/t Samuele): should the released image use a hardened base instead of node:24-slim? Yes, worth doing, deferred deliberately rather than done here — full reasoning is now a comment above the FROM line in docker/bot.Dockerfile. Short version:

  • Not a one-line FROM swap. The build currently runs corepack/pnpm install/pnpm run build inside the final image. A hardened runtime tag (minimal/distroless-style) almost certainly can't do that — this needs a proper multi-stage rewrite: a -dev/full builder stage produces dist/ + a pruned node_modules, a minimal runtime stage COPYs just those in and runs node dist/index.js directly.
  • Chainguard over Docker Hardened Images, when this gets picked up. cgr.dev/chainguard/node is free with no registry login, and this repo already depends on that vendor for every other released image (mecated/mecak8s/mecatui build on cgr.dev/chainguard/static, see .ko.yaml) — zero new vendor relationship, zero new CI credentials. Docker Hardened Images is also genuinely free (Apache 2.0, unpaywalled catalog), but pulling from dhi.io requires docker login dhi.io even on the free tier — a new credential this repo's CI doesn't currently have.
  • The one Chainguard wrinkle: only latest/latest-dev are pullable for free; a specific pinned version tag needs a Chainguard sales conversation. Workaround already precedented in .ko.yaml: pin the digest of latest at build time, not the moving tag.

Not blocking this PR. Tracked as a real follow-up, not a "later, maybe."

Test plan

  • task slack-bot:lint / task slack-bot:typecheck / task slack-bot:test all pass, including new test/env.test.ts coverage for the TLS/M2M branch and its fail-fast-on-missing-var behavior
  • docker build -f examples/slack-bot/docker/bot.Dockerfile . (context sdk/typescript/) succeeds
  • .github/workflows/release.yml's new publish-slack-bot job: YAML-validated and its sibling jobs' full CI run is green on this branch (two unrelated flaky Go race tests hit on the way, confirmed as flakes via rerun — not caused by this change)
  • End-to-end against the real staging mecak8s once the infra-side Okta app + deployment land

🤖 Generated with Claude Code

@kantord
kantord force-pushed the slack-bot-staging-deploy branch 2 times, most recently from 97fe674 to 4eb51d9 Compare September 3, 2026 17:01
kantord and others added 3 commits September 4, 2026 12:06
Lets the Slack bot example point at a real deployed backend (e.g. the
shared staging mecak8s) instead of only a local/Compose mecated.
MECATL_GRPC_TLS=true switches the target to https:// and mints a bearer
via OAuth2 client_credentials (src/m2mToken.ts), cached and refreshed
per call through the SDK's existing credentialProvider hook.

Also publishes the bot as a signed, attested container image
(ghcr.io/stacklok/mecatl/slack-bot) from the same v* release tag as
mecated/mecatui/mecak8s, reusing the existing docker/bot.Dockerfile.

Co-authored-by: Claude Sonnet 5 <[email protected]>
Leftover from rebasing onto #996 (server-owned session placement) -
this paragraph should have been fixed in the same commit that dropped
the workspace concept elsewhere in this file, but the edit never got
staged.

Co-authored-by: Claude Sonnet 5 <[email protected]>
Not switching node:24-slim to a hardened base now - it would need a
multi-stage rewrite (corepack/pnpm/build currently run inside the
final image, which a minimal hardened runtime almost certainly can't
do). Records why Chainguard would be favored over Docker Hardened
Images when this gets picked up: no new vendor relationship (mecatl
already builds mecated/mecak8s/mecatui on cgr.dev/chainguard/static),
no new CI credential, versus DHI's free tier still requiring a
dhi.io registry login.

Co-authored-by: Claude Sonnet 5 <[email protected]>
@kantord
kantord force-pushed the slack-bot-staging-deploy branch from 9b098f8 to be48950 Compare September 4, 2026 10:07
@kantord
kantord merged commit 7eac22b into main Sep 4, 2026
58 of 63 checks passed
@kantord
kantord deleted the slack-bot-staging-deploy branch September 4, 2026 10:38
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