Skip to content

web/flow: generate a single API object for network transactions and use it for the lifetime of the FlowExecutor#20030

Merged
kensternberg-authentik merged 138 commits intomainfrom
web/flow/one-true-api
Feb 21, 2026
Merged

web/flow: generate a single API object for network transactions and use it for the lifetime of the FlowExecutor#20030
kensternberg-authentik merged 138 commits intomainfrom
web/flow/one-true-api

Conversation

@kensternberg-authentik
Copy link
Contributor

web/flow: dedupe the creation of fresh FlowApi instances

What

Generates a single instance of FlowApi() that the FlowExecutor can use over the course of its lifetime.

Why

Looking at the code generated by OpenApi, it’s clear that the parameters with which the API commits network transactions are immutable after construction; likewise, our particular invocation of DEFAULT_GLOBALS is also immutable with respect to a single instance of the FlowExecutor. With that in mind, there’s no reason to keep rebuilding the same network transaction object over and over; just instantiate it and live with it. In the conflict between rules-of-thumb “Never store what you can express” and “Extract repetitious expressions into instances,” the latter rule wins here.

Loading
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