Rather than passing them around separately everywhere, just unify them into a single struct that is primarily fetched via a raw.
Also stores raw data directly into the database so that signatures can be verified later rather than only at receive time.
Previously `verify_server_keys_response` would work with re-serialized
ServerSigningKeys, which drops any extra, non-standard fields from the
origin server response. The signature is made over the whole response
though, meaning that any response including extra fields will not pass
signature verification.
As per the MSC:
> This MSC recommends homeservers should wait a minimum of 24 hours
> and should wait no longer than 90 days, balancing the need to respect
> the server's intent to be offline whilst allowing for potential future
> changes in server operation or domain ownership.
And as per nex:
> Technically the MSC said it should be up to 90 days, but they'll never
> make me parse cache-control!
Non-successful media responses get the `application/json` treatment, and the content-type is lowercased for case-insensitive matching, per RFC something or other I forgot already
Because openidconnect vendors reqwest (??), we have to re-implement
the entire Resolve trait.
No I don't like it, but I can't think of a better solution.
Previously, only HTTP clients targeting matrix servers (and using the
resolution spec) would use the DNS servers configured in the c10y config.
This happened because reqwest requires any DNS resolvers passed in to
implement reqwest::dns::Resolve, which only the matrix resolver did,
and no other HTTP client had a proper DNS resolver (which used the
configured DNS servers) passed into it.
To fix this we make a custom resolution struct based on reqwest's
reqwest::dns::HickoryDnsResolver, which implements Request with no
other modifications to the DNS response. HickoryDnsResolver itself isn't
exported, which is why we re-created it instead of using it directly.
no im not an LLM i just wrote this to remember my own changes later on
Fixes: continuwuation/continuwuity#2441