Skip to content

merge upstream#8

Merged
mattbnz merged 7 commits intomainfrom
merge-upstream
Feb 20, 2026
Merged

merge upstream#8
mattbnz merged 7 commits intomainfrom
merge-upstream

Conversation

@mattbnz
Copy link

@mattbnz mattbnz commented Feb 20, 2026

timflyio and others added 7 commits November 19, 2025 11:07
* Customize tokenizer for my own use as a somewhat open tokenizer proxy.

Require fly src be present when REQUIRE_FLY_SRC=true.

* increase logging and include a tool for specific type of token sealing.

* strip hazmat from processors too

* reject fly-src when it doesnt come from fly-proxy's netblock.

* allow fly-src from 127.0.0.1/16 in test cases.

* add a quickstart doc from my notes, and apply a small fix.

* remove TODO

* include a flag to print the seal key

* get rid of flysrc internal library and instead use public superfly/flysrc-go library.

Since the flysrc parser used to be static, we now have to pass in a context to the authorizers so they can get the flysrc parser instance that was constructed for the tokenizer instance.

* bump dep version

* fix dockerfile for latest changes
…ine (superfly#32)

* support sealing an arbitrary json tokenizer secret from the command line
* update golang version and crypto library to appease vuln scan checks
Earlier merge updated go.mod's golang version, but not the Dockerfile. This fixes the dockerfile so it can build again.
- Add `NO_FLY_SRC=true` env variable option for skipping the flysrc parser.
- Allow the tokenizer to be built without a flysrc parser, unless configured to require fly src.
- Allow the fly src authorizer to run without panicking when there is no flysrc parser. It just returns authorization failures for everything.
* Add body injection support for Vanta token revocation

Implemented InjectBodyProcessor and OAuthBodyProcessor to support
delimiter-based token replacement in request bodies. This enables
Vanta's suspend API to receive the unsealed OAuth token in the
request body without exposing it in the ui-ex application.

Features:
- ParamDelimiter support for specifying custom placeholders
- InjectBodyProcessorConfig for generic body injection
- OAuthBodyProcessorConfig for OAuth-specific body injection
- Automatic Content-Length header updates after replacement

Required for Vanta integration disconnect flow in ui-ex.

* Replace 'delimiter' with 'placeholder' and use streaming replacement

Addressing PR review feedback:
- Rename 'delimiter' to 'placeholder' throughout codebase for clarity
- Use github.com/icholy/replace for streaming replacement instead of io.ReadAll
- Prevents memory exhaustion on large request bodies
- Add comprehensive test cases for body injection processors

Changes:
- Update ParamDelimiter constant to ParamPlaceholder
- Convert InjectBodyProcessorConfig to use streaming replace.Chain()
- Convert OAuthProcessorConfig body injection to use streaming
- Convert OAuthBodyProcessorConfig to use streaming
- Add dependency on github.com/icholy/replace v0.6.0
- Add test coverage for:
  - Simple and multiple placeholder replacements
  - Custom placeholders from params and config
  - Large bodies (50KB+) with streaming
  - OAuth access and refresh tokens
  - Nil/empty bodies

* Add header/body cross-checks to OAuth processor tests

Enhance test coverage to verify mutual exclusivity of header and body injection:
- Body injection: verify Authorization header is NOT set
- Header injection: verify body is NOT modified

This ensures the dual-mode behavior of OAuthProcessorConfig works correctly:
- With placeholder param → only body is modified
- Without placeholder param → only Authorization header is set

* Use chunked transfer encoding for streaming body replacement

Switch from buffering entire request bodies to using chunked transfer
encoding (ContentLength = 0) when performing token replacement. This
eliminates memory overhead for large request bodies by streaming through
the replace.Chain without needing to calculate content length upfront.

Updated processors:
- InjectBodyProcessorConfig.Processor()
- OAuthBodyProcessorConfig.Processor()
- OAuthProcessorConfig.Processor() (when placeholder provided)

Removed unused MaxBodySizeForInjection constant.
@mkmba-conscience mkmba-conscience bot enabled auto-merge (rebase) February 20, 2026 08:40
auto-merge was automatically disabled February 20, 2026 08:41

Rebase failed

@mattbnz mattbnz merged commit 8ec225a into main Feb 20, 2026
1 check passed
@mattbnz mattbnz deleted the merge-upstream branch February 20, 2026 08:57
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.

3 participants