Repository navigation
v0.5.0
byward v0.5.0
v0.5.0 makes byward's exit fit one 25 s budget, lets the operator set the token lifetimes and bound a slow stdio upstream, and checks a registered redirect URI's host and port by the same rule as the URL settings. Every log line and printed value now hides the secrets that config refuses. Read Breaking changes before you upgrade.
byward puts any MCP server, HTTP or stdio, behind OAuth 2.1 and your identity provider: Microsoft Entra ID first-class, and Okta, Keycloak, Google, Auth0 or any other OpenID Connect provider.
Pre-1.0, and no independent security audit yet. Read the security posture before deploying it.
A minor release on v0.4.1. No store migration: the SQLite schema stays at v8, and the PostgreSQL store is unchanged.
Breaking changes
A registered redirect URI follows the URL settings' host rule (#712, #707)
A client's redirect URI must now pass the host rule that BYWARD_UPSTREAM_URL already follows (ADR-0032 §3). This applies to DCR, CIMD and static clients.
| Refused | Reason | Example |
|---|---|---|
A host with a non-ASCII character, a byte that is not UTF-8, or a character other than a letter, digit, -, . or _ |
host |
https://bücher.example/cb, https://app~x.example/cb |
| An IPv6 zone | host |
https://[fe80::1%25eth0]/cb |
| A port of 0, above 65535, with a leading zero, or empty | port |
http://127.0.0.1:0/cb, http://[::1]:080/cb, http://127.0.0.1:/cb |
| White space, a control character or an invisible formatting character anywhere in the URI, the path included | malformed |
https://app.example/c b |
Each kind of client handles a refused URI its own way (ADR-0009):
- A new DCR registration keeps the URIs that pass and drops the rest.
- A stored DCR registration holding a refused URI is treated as an unknown client. The app registers again.
- A CIMD document with a refused URI is refused whole.
- A static client with a refused URI stops byward from starting. The error names the URI and the rule.
The loopback set (127.0.0.1, [::1], localhost, over http, any port from 1 to 65535) is unchanged.
Upgrade. Run the new version's byward check --offline against your configuration; it checks the static clients file. A URI refused now is one a browser or dialer would have read differently from byward. Write an internationalized host in its xn-- form (https://xn--bcher-kva.example/cb), percent-encode white space or invisible characters in a path, and give a port from 1 to 65535 or none.
A stdio request now times out after 5 minutes without an answer (#726, #721)
BYWARD_STDIO_REQUEST_TIMEOUT is new, and its default is 5m. A stdio tool that sends nothing for more than 5 minutes after a request used to be waited on with no limit. Now that request gets a timeout answer. See Features for what is timed and what isn't.
Upgrade. If a tool of yours can take longer than 5 minutes before it sends its first message, set BYWARD_STDIO_REQUEST_TIMEOUT higher, up to 1h.
Security
- Logs and printed values hide every kind of secret that config refuses (#701, #657, #634, #641, #647).
- The log redactor, a stdio upstream's stderr,
revoke-user's output andinit entranow use one list of secret kinds, the same one config uses to refuse a pasted secret. - Newly redacted in logs: a GitHub or Slack token, found by its documented prefix, and a connection string with a password. This includes such a value inside a JSON log line, where it is read by its keys and strings.
init entrarefuses a--public-urlor--upstream-urlthat would print a secret in the script it writes.- One test walks every printing surface and pins what each one does with every kind of secret.
- The log redactor, a stdio upstream's stderr,
/callback/{idp}answers only GET and HEAD (#735, #734). Any other method gets 405 withAllow: GET, HEAD. The method is checked before the rate limit and before the login cookie is read, so no code is issued and the login stays unused. This is hardening, not a vulnerability fix: the login cookie isSameSite=Laxand single-use. The other broker routes already worked this way.revoke-userquotes a user key that holds a bidi or invisible formatting character (#740, #654). Its success line printed the key raw, so the terminal could show it reordered or hide characters. It now shows the key as config shows a value, quoted. By @Yshuro (from #655).
Features
-
The token lifetimes can be set, within ADR-0006's bounds (#730, #722). Each setting takes whole minutes, and startup checks it.
Setting Default Range BYWARD_ACCESS_TOKEN_LIFETIME1h5m to 1h BYWARD_REFRESH_TOKEN_LIFETIME720h(30 days)1h to 2136h(89 days, so a grant ends before its DCR registration does)BYWARD_REFRESH_TOKEN_IDLE_LIFETIME336h(14 days)from the access-token lifetime to the refresh-token lifetime - An idle lifetime outside its range stops startup. The error names both settings and the value each would need.
- What a change affects: a grant keeps the absolute lifetime it was created with. A new idle lifetime applies from a refresh token's next rotation. A token issued before the change keeps its own expiry.
- The consent page shows the configured lifetime in days, hours or minutes, rounded up.
-
BYWARD_STDIO_REQUEST_TIMEOUTbounds how long a stdio upstream may take to answer a request (#726, #721). Default5m, from 1s to 1h, asBYWARD_UPSTREAM_HEADER_TIMEOUTdoes for an HTTP upstream.- What it times: the wait for the first message of the answer. An answer that has started streaming is not limited.
- On timeout: the request gets the same timeout answer the HTTP relay gives, and a timed-out
tools/callgets the relay's tool result. A 2026-07-28 upstream getsnotifications/cancelled. The process stays up and keeps serving its other requests. - Not timed:
subscriptions/listenand the legacy GET stream.
-
One 25 s budget for the whole exit, and a second signal ends byward at once (#725, #710).
- One budget: after SIGTERM or SIGINT, the whole exit fits in 25 s (
ShutdownTimeout): 23 s to shut down, then 2 s to flush traces. Before, each step had its own 25 s, one after another. - The stdio upstream stops while the public listener closes. A process group still running at the deadline is killed (SIGKILL), so none outlives byward on a host.
- Tracing: an OTLP export that the collector never answers ends within the 2 s flush.
- A second SIGINT or SIGTERM kills the stdio processes and ends byward at once, by that signal. If SIGINT was ignored when byward started (
nohup), byward exits 1 after about 1 s. - Measured worst case: 24.8 s, with a client that never reads a large stdio answer and a collector that never answers.
- A signal during startup stops it at once. The store open, the first revocation-list sync and the upstream address lookup now stop on the signal. byward logs
stopped during startupand exits 0. Before, startup ignored the signal until those steps finished or ran out their own timeouts: a PostgreSQL store at an address that never answered took 29 s.
- One budget: after SIGTERM or SIGINT, the whole exit fits in 25 s (
Fixed
- A store call on a request that ended is answered by how it ended (#709, #693).
- On SQLite and PostgreSQL, a store call fails when its request has already ended: the client went away, or a shutdown ended the request, for example during a rolling deploy. The broker treated that failure as a store outage: an ERROR line, a 5xx answer and, at
/register, an audited failed registration. - Now the client gets 499, or 503 with
Connection: close, and nothing is logged or audited as a failure. - A real outage, or a detached store call that times out, still logs ERROR and answers 5xx.
- On SQLite and PostgreSQL, a store call fails when its request has already ended: the client went away, or a shutdown ended the request, for example during a rolling deploy. The broker treated that failure as a store outage: an ERROR line, a 5xx answer and, at
- A secret file that byward cannot read, or that is a directory, says so (#720, #719). The error names the setting, the cause and the fix: run byward as the file's owner, or
chownthe file to uid 65532 in the image. Withdocker run -v, a missing host file is created as a directory, and the error says that too. Before, these files got the error meant for a secret pasted where its path belongs. revoke-userrefuses a flag-like argument as a user key (#660, #653).byward revoke-user --yesused to look for a user whose key is--yes. Now an argument that starts with-is refused with the usage line and exit 2, and-hor--helpprints the usage. To revoke a key that starts with-, give it as--key=<user key>. By @Yshuro.
Docs
-
Serve users from several identity providers (#708, #705): a new how-to. It covers federating at the IdP (Keycloak as a broker, Entra B2B guests, Auth0 or Okta connections) and running one byward per IdP. The Keycloak path was run end to end. The Entra, Auth0 and Okta sections follow the vendors' docs.
-
Give byward time to stop (#717, #731): a new section 10 in
deploy.mdgives the 30 s setting for each runtime, and that runtime's default from its own docs:- Docker and Compose;
- Kubernetes, with a 5 s
preStopsleephandler, as the image has nosleepbinary; - Amazon ECS;
- Azure Container Apps;
- Fly.io;
- systemd, with
KillMode=mixed; - Google Cloud Run's fixed 10 s, listed as a limit.
It also covers running an init as PID 1 (
--init) for a stdio upstream that leaves child processes behind. Without one, a test left 15 zombies.harden-a-deployment.mdgets a checklist for stopping. -
Every HTTP endpoint byward serves, in one reference (#737, #733):
docs/reference/endpoints.mdgives each route's listener, methods, spec, rate limit, setting and ADR. A test keeps it true: it scans the code for routes and requests each one on both listeners. -
security-insights.ymland an OSPS Baseline self-assessment (#729, #723). The file follows OpenSSF Security Insights spec v2.2.0 and is checked against its schema in CI.docs/security/osps-baseline.mdwalks the OSPS Baseline requirements at levels 1 and 2: 40 met, 2 not met, 2 not applicable. It is self-assessed, not certified. -
The docs name the latest release (#717): the docs lint now reads the latest release from the git tags, so the README and the guides can no longer fall behind it.
-
Clients and providers re-verified on main (#716, #704), and the README reorganized around what a reader wants to do.
-
The OpenSSF Best Practices badge in the README (#715, #265).
Internal:
- A test now walks every store call on each request path and checks that a request ended after each call gets the ending's answer (#728, #714).
- The shell tests that build git fixtures run in a clean environment (#724, #718).
- The real-client test fixtures' dependencies were bumped, and the stdio-node example's image is pinned by digest (#711).
- A CodeQL finding in a test client was fixed (#713).
None of these changes behaviour.
Every change runs CI: unit and integration tests, PostgreSQL 15 and 18, the MCP SDK clients (TypeScript, Python, Go), MCP Inspector and the MCP conformance authorization suite.
Upgrading
-
Read Breaking changes. Run the new version's
byward check --offlineagainst your configuration. -
Give byward 30 s to stop in your runtime:
- Docker:
--stop-timeout 30; - Compose:
stop_grace_period: 30s; - Kubernetes:
terminationGracePeriodSeconds: 35with a 5 spreStopsleep.
See deploy.md section 10.
- Docker:
-
A stdio tool that takes more than 5 minutes before it sends anything now gets a timeout. Raise
BYWARD_STDIO_REQUEST_TIMEOUT, up to 1h. -
revoke-userwith a key that starts with-now needs--key=<user key>. -
The token lifetimes default to v0.4.1's fixed values, so nothing changes unless you set them. Lowering a lifetime is always safe. If you raise
BYWARD_REFRESH_TOKEN_LIFETIME, read the first Known gap below.
Upgrading from v0.3.3 or earlier, read the v0.4.0 notes first: v0.4.0 has breaking setting changes.
Install
docker pull ghcr.io/byward-dev/byward:v0.5.0latest now points at v0.5.0. Verify the release as in packaging.
Known gaps
- A remembered consent covers a longer grant after the refresh-token lifetime is raised (#727). After an operator raises
BYWARD_REFRESH_TOKEN_LIFETIME, a consent remembered under the old lifetime covers the longer grants without showing the page again. This lasts at most the consent's own 30 days. It affects only clients whose consent is remembered: static clients and trusted CIMD hosts. To make every user see the page again, runbyward revoke-all. - A value holding an invisible character that Go counts as printable is shown unquoted (#739): U+034F, U+FE0F or U+3164, in
revoke-user's output,--print-configand the text log. The bidi and zero-width characters that #740 covers are quoted. - An opaque Bearer or Basic credential, pasted with its scheme into a setting that is not secret, is printed whole by
--print-config(#657). Logs redact it. - A secret with no documented prefix, pasted into a setting that is not secret, is still accepted and shown (#495). The likeliest is an Entra client secret given as an app role value.
- Two revocations can still be lost on a request that ends (#693): a reused refresh token within the grace that is not the latest one, and a
/revokewhose CIMD client's metadata or key fetch runs to its own 5 s timeout. Both are accepted, with the reasons in the security posture. - A span limit
OTEL_*setting that is not a number is printed with its value by the OpenTelemetry SDK, even with tracing off. - stdio upstream processes share byward's uid (#182). The operator isolates them by host settings, or separate containers or VMs.
The security posture lists the rest.
Credits
Thanks to @Yshuro for two fixes to revoke-user: refusing a flag-like argument as a user key (#660, #653), and quoting a user key with invisible formatting characters (#740, #654, from #655).
MCP is a trademark of LF Projects, LLC. byward is an independent project.