Repository navigation
Use RFC 8693 form encoding by default - #27
Merged
Merged
Conversation
bonifaido
requested review from
baluchicken,
stoader and
waynz0r
and
a lite review from Copilot
November 4, 2026 14:57
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
A moderate active finding remains because RFC 8693 telemetry omits the selected body format, preventing operators from distinguishing form and JSON request failures.
1 open issue
What changed in this PR
Updates RFC 8693 token exchanges to use application/x-www-form-urlencoded by default while retaining JSON support for JSON-only endpoints such as OpenAI. The PR also documents migration behavior and adds private vulnerability-reporting guidance.
Changes:
- Adds
BodyFormatandWithBodyFormat, with form encoding as the default. - Keeps the OpenAI helper on JSON.
- Expands tests for form encoding, JSON overrides, escaping, and OpenAI requests.
- Adds migration documentation and
SECURITY.mdreporting instructions.
| File | Summary |
|---|---|
SECURITY.md |
Adds private vulnerability-reporting instructions. |
README.md |
Links contributors to the security policy. |
pkg/rfc8693/rfc8693.go |
Implements configurable form or JSON token request encoding. Moderate issue (2 votes): credential.fetch spans do not record cfg.body_format, making form-versus-JSON failures difficult to diagnose; add the attribute and telemetry coverage. |
pkg/rfc8693/rfc8693_test.go |
Tests form-default behavior, JSON encoding, escaped values, and OpenAI requests. |
pkg/rfc8693/option.go |
Adds the WithBodyFormat option. |
pkg/rfc8693/openai.go |
Forces JSON encoding for OpenAI workload identity requests. |
docs/rfc8693.md |
Documents the new default, migration requirements, and OpenAI behavior. |
Review effort: Lite
Like RFC 7523, so a form or JSON rejection shows in the trace.
pbalogh-sa
approved these changes
Nov 5, 2026
baluchicken
approved these changes
Nov 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
application/x-www-form-urlencodedby default.WithBodyFormat(BodyFormatJSON)for JSON-only endpoints and keep the OpenAI helper on JSON.Compatibility
The default changes from JSON in v0.7.0. Callers using a JSON-only endpoint through
GetCredentialsmust passWithBodyFormat(BodyFormatJSON)when upgrading. The OpenAI helper selects JSON automatically.Waterwheel remains pinned to tokenex v0.7.0 for now; its companion docs PR narrows the supported RFC 8693 claim until a tagged tokenex release is available.
Verification
go test ./...go test -race -count=1 ./pkg/rfc8693