Repository navigation
add(ocm): shared OCM HTTP transport package - #5833
Conversation
098743e to
a50256d
Compare
|
This pulls the OCM transport into one flowchart TD
CFG["TransportConfig"] --> T["trusted client"]
CFG --> P["public-only client"]
T --> TP["always ProxyFromEnvironment"]
P --> G["Dialer.Control"]
G --> Z{"zoned IPv6?"}
Z -->|yes| R["reject"]
Z -->|no| IP["isAllowedIP"]
P --> PX{"UseEnvProxy"}
PX -->|false, default| D["Proxy = nil"]
PX -->|true| E["ProxyFromEnvironment"]
The zone check is the part you might ask about. I reject zones outright instead of stripping them, since a public-only client has no reason to honor a link-local zone. The other thing is The proxy change is its own commit, so it can be reverted without touching the zone fix. And the reason is that you might need to have all your OCM outbound routed through MITM, like I do when I'm in the Test Suite. |
|
Hi Giuseppe, good question in Matrix. I went to check all the places and the distinction between trusted and untrusted. A party counts as trusted once the operator has admitted it through the provider authorizer (mentix or the json file), and that's what flowchart LR
Auth["provider authorizer (mentix / json)"] --> Gate{"IsProviderAllowed"}
Gate -->|admitted| GI["GetInfoByDomain"]
GI --> T["NewTrustedHTTPClient"]
Dir["WAYF configured directory URLs"] --> T
T --> T1["invite manager: InviteAccepted"]
T --> T2["share provider: NewShare"]
Gate -->|unknown or caller-named host| P["NewPublicOnlyHTTPClient"]
P --> P1["inbound /shares: sender IdP + WebDAV"]
P --> P2["received-share storage: WebDAV"]
P --> P3["open authorizer probe"]
P --> P4["WAYF untrustedClient: /discover + listed servers"]
The trusted client keeps the env proxy and skips the dial guard, and it's used in exactly three places:
In the two gRPC cases the target comes from Anywhere a caller gets to name the host, it goes through the public-only client. One thing I want to be sure about: |
|
This adds an explicit private-network exception to the public-only client.
The zero value allows nothing, so behavior doesn't change until a service sets it. The next PRs wire it up as flowchart TD
IN["CIDR strings from service config"] --> PF["ParseFederationCIDRs"]
PF -->|"any invalid entry"| ERR["whole list rejected"]
PF -->|"ok"| TC["TransportConfig.AllowedFederationCIDRs"]
TC --> D["newPublicOnlyDialer, policy cloned"]
D --> Z{"zoned IPv6?"}
Z -->|"yes"| R["refuse"]
Z -->|"no"| LB{"loopback and AllowLoopback?"}
LB -->|"yes"| OK["dial"]
LB -->|"no"| PUB{"public IP?"}
PUB -->|"yes"| OK
PUB -->|"no"| PR{"private and inside a listed CIDR?"}
PR -->|"yes"| OK
PR -->|"no"| R
The parser is strict on purpose. Each entry has to be a canonical prefix with host bits cleared and sit wholly inside So This is also the piece I need for the Test Suite. There the MITM sits on a private Docker network, and with |
7f70478 to
8304ef7
Compare
8304ef7 to
590104c
Compare
590104c to
b221c25
Compare
Signed-off-by: Mahdi Baghbani <[email protected]>
Signed-off-by: Mahdi Baghbani <[email protected]>
Signed-off-by: Mahdi Baghbani <[email protected]>
Signed-off-by: Mahdi Baghbani <[email protected]>
Signed-off-by: Mahdi Baghbani <[email protected]>
b221c25 to
6601082
Compare
This PR is part of the cs3org/OCM-STA#48
Summary
pkg/ocm/client, a shared OCM HTTP transport package withTransportConfigand trusted/public-only HTTP client constructors, centralizing transport and address-policy logic currently inlined inocmd. Existingocmd.OCMClientcallers are unchanged; public-only clients still bypass environment proxies and use the guarded dialer.