Pomerium is an identity and context-aware access proxy.
  • Go 91.2%
  • TypeScript 6.6%
  • JavaScript 0.6%
  • Shell 0.6%
  • Jsonnet 0.5%
  • Other 0.5%
Find a file
Denis Mishin 8639d614ed
mcp: prefix opaque access/refresh tokens (pom_mat_/pom_mrt_) (#6661)
## Summary

Opaque MCP tokens minted by Pomerium are now self-describing: access
tokens are prefixed `pom_mat_` and refresh tokens `pom_mrt_`. Previously
both were bare base64 blobs, indistinguishable from each other and from
any other opaque credential in a log, a config file, or a bug report.

Parsing dual-accepts prefixed and unprefixed tokens, so tokens issued
before this change keep working until they expire. `_` does not appear
in the standard-base64 token body, so trimming an absent prefix cannot
corrupt a bare token.

This is in anticipation of being able to distinguish two different
sources of tokens arriving to MCP routes - issued to interactive users
and to workloads executing on behalf of the users.

## Related

-
https://github.blog/engineering/platform-security/behind-githubs-new-authentication-token-formats/

## User Explanation

MCP access and refresh tokens issued by Pomerium now start with
`pom_mat_` and `pom_mrt_` respectively. This makes the token type
obvious on sight and lets secret scanners recognize a leaked Pomerium
MCP token. Existing tokens continue to be accepted, so no client needs
to re-authenticate.

## AI disclosure

Claude Code: extracted the change from a larger branch, wrote the tests,
and drafted this description; reviewed by me.

## Checklist

- [x] reference any related issues
- [x] updated unit tests
- [x] add appropriate label (`enhancement`, `bug`, `breaking`,
`dependencies`, `ci`)
- [x] disclosed AI usage (or wrote "none") per AI_POLICY.md
- [ ] ready for review
2026-08-13 15:03:55 -04:00
.github test(acceptance): upstream TLS/mTLS e2e suite (#6648) 2026-08-12 11:10:02 +01:00
authenticate core/config: add New function for config.Config (#6349) 2026-05-14 13:45:09 -06:00
authorize config: support issuer: kubernetes:/// for in-cluster JWKS verification (#6592) 2026-08-11 10:01:49 -04:00
cmd/pomerium zero: add an exported command entry point (#6520) 2026-07-23 13:45:28 -07:00
config testenv: reserve allocated ports so upstreams cannot take them from envoy (#6659) 2026-08-11 17:15:42 -04:00
databroker core/config: add New function for config.Config (#6349) 2026-05-14 13:45:09 -06:00
examples ci: update main dependencies (#6647) 2026-08-10 14:54:31 -06:00
integration migrate deprecated docker module (#6294) 2026-04-24 09:27:24 -07:00
internal mcp: prefix opaque access/refresh tokens (pom_mat_/pom_mrt_) (#6661) 2026-08-13 15:03:55 -04:00
k8s/zero
ospkg enable systemd health checks by default (#5850) 2025-09-25 11:24:08 -04:00
pkg config: support issuer: kubernetes:/// for in-cluster JWKS verification (#6592) 2026-08-11 10:01:49 -04:00
proxy config: support issuer: kubernetes:/// for in-cluster JWKS verification (#6592) 2026-08-11 10:01:49 -04:00
scripts docker: use distroless base-nossl images (#6612) 2026-07-29 15:31:41 -04:00
ui chore(deps): bump the npm group in /ui with 7 updates (#6657) 2026-08-10 14:48:52 -06:00
.clang-format
.dockerignore
.gitattributes Add custom git merge driver for components.json (#6068) 2026-02-10 21:36:49 -05:00
.gitignore feat(mcp/configapi): shared library exposing ConfigService as MCP tools (#6286) 2026-05-13 12:13:15 -07:00
.golangci.yml core/databroker: add a cache invalidator and invalidate cache when the storage backend changes (#6357) 2026-05-27 06:30:55 -06:00
.pre-commit-config.yaml chore(deps): re-tidy root module; run tidy hooks on module changes (#6645) 2026-08-05 12:44:55 -04:00
.tool-versions ci: update main dependencies (#6637) 2026-08-04 11:53:38 -04:00
AGENTS.md Add AI usage policy (#6333) 2026-05-11 06:11:27 -06:00
AI_POLICY.md Add AI usage policy (#6333) 2026-05-11 06:11:27 -06:00
DEBUG.MD docker: standardize pomerium debug image contract (#6261) 2026-04-13 12:53:44 -07:00
Dockerfile ci: update main dependencies (#6647) 2026-08-10 14:54:31 -06:00
go.mod config: support issuer: kubernetes:/// for in-cluster JWKS verification (#6592) 2026-08-11 10:01:49 -04:00
go.sum config: support issuer: kubernetes:/// for in-cluster JWKS verification (#6592) 2026-08-11 10:01:49 -04:00
go.work core: refactor config, databroker proto packages, add go.mods (#6387) 2026-06-01 18:56:06 -06:00
go.work.sum config: support issuer: kubernetes:/// for in-cluster JWKS verification (#6592) 2026-08-11 10:01:49 -04:00
LICENSE fix: CI after pre-commit (#5966) 2025-12-03 13:17:53 -05:00
Makefile config: support issuer: kubernetes:/// for in-cluster JWKS verification (#6592) 2026-08-11 10:01:49 -04:00
pomerium.go
README.md fix: repair broken links and remove stale root markdown (#6373) 2026-05-21 07:24:23 -06:00
SECURITY.md fix: add AI-assisted report policy to SECURITY.md and issue templates (#6374) 2026-05-21 07:25:52 -06:00

pomerium logo

Go Report Card GoDoc LICENSE Docker Pulls

Pomerium is an identity and context-aware reverse proxy. Pomerium builds secure, clientless connections to internal web apps and other services without a corporate VPN.

Pomerium is:

Its not a VPN alternative its the trusted, foolproof way to protect your business. Want a hosted control plane and management GUI? Give Pomerium Zero a try today!

Docs

For comprehensive docs, and tutorials see our documentation.

Contributing

See Contributing for information on how you can contribute to Pomerium.