Repository navigation
Version 0.3.4: a configured TLS never falls back to plaintext, and a caller's id, realm or base URL cannot send a request to another resource. No change to the public API; cargo update brings it to every project on 0.3.
Fixes over 0.3.3, with no change to the public API. Most refuse, with
Error::InvalidRequest and before anything is sent, a value that used to go
somewhere other than where the caller meant. A few make a value work as it
was meant instead: whitespace and a trailing backslash are trimmed from a
base URL, a realm or an authorization server, an identity provider domain
may carry its https://, ws:// becomes wss:// under TLS, and grpcs://
means TLS.
Fixed
Found by testing the published 0.3.3 from an application, and then by
sweeping every HTTP, WebSocket and gRPC client for the same kind of mistake.
-
TLS could be dropped without an error, with the bearer token sent in
plaintext.JsonClient::with_tlsturned only a literalhttp://intohttps://.
A base URL that URL parsing reads ashttp://hostwithout being spelt
that way —http:/host,http:host,http:\\host, a tab inside the
scheme — went out as plain HTTP. With TLS configured the JSON client now
refuses any URL that is nothttps.- A
ws://base with TLS opened a plain WebSocket. It now becomes
wss://, and the WebSocket lane refuses a non-wssURL when TLS is
configured. - On gRPC,
Config::with_tlswith agrpcs://,grpc://,dns://or
other non-HTTP endpoint connected in plaintext HTTP/2, because tonic
picks TLS by the scheme.grpcs://now means TLS, ashttps://does;
with TLS configured, any other scheme isError::InvalidRequest.
-
A path argument could address another resource.
- URL parsing resolves
.and..against the path, so
RegistryClient::instrument("..")asked for the list of instruments,
ScanClient::featured_app_right("..")for the list of every featured-app
right (and read it as "not featured"), andJsonClient::get_partiesand
package_statusfor other endpoints. - URL parsing also drops tab, CR and LF, so
instrument("USD\tC")read
instrumentUSDC, and.\t.became... - It reads a backslash as
/, sopackage_status(r"..\..\v2\users")
asked for/v2/users/status.
An empty,
.or..segment, a segment with a control character, and a
package id with a backslash are nowError::InvalidRequest, before anything
is sent. Scan's API version argument is checked the same way. - URL parsing resolves
-
The OIDC presets put the realm, the authorization server and the domain
into the token URL as they were.OidcConfig::keycloakwith a realm of
AppProvider/../masterasked themasterrealm for a token, an Okta
auth_serverof.reached the org authorization server, and a domain of
evil.example\.okta.comwas hostevil.example. A realm or an
authorization server that would not stay one path segment (empty,.,
..,%2e%2e, or one with a/,\,?,#or control character), and
a domain that is not a barehost[:port], are now refused by the first
TokenProvider::token, before the secret is sent. Every other value is
sent as before, with surrounding whitespace trimmed, as a value read from
a file needs. A domain given with itshttps://, as identity providers'
consoles show it, no longer makes the hosthttps. -
A
unix:gRPC endpoint dialled TCP hostunix. It is now passed to
tonic as the Unix socket it names, and refused with TLS, which a socket
cannot carry. -
A base URL with a query or a fragment mangled every request.
…/ledger?tenant=asentGET /ledger?tenant=a/v2/version, and
…/ledger#xsent every request, submissions included, to/ledger.
JsonClientnow refuses such a base on the first request, and
RegistryClientandScanClientat construction. Whitespace around a
base URL and a trailing backslash are trimmed like a trailing slash.
Documentation
CantonClient::prepare_submission's# Errorssaid a max record time finer
than a microsecond is refused. It is rounded down to the microsecond, as
0.3.3's changelog andPrepare::with_max_record_timesay.