Repository navigation
Immutable
release. Only release title and notes can be modified.
Changed
- Breaking:
Yama()raisesValueErrorfor a plainhttp://base URL (argument orYAMA_API_BASE_URL) unless the host islocalhost,127.0.0.1or[::1], and then ignores proxies set in the environment, so your API key isn't sent unencrypted over a network. Usehttps://for any other host. If you pass your ownhttp_client, its proxy settings still apply. - The
ValueErrorfor a bad API key or base URL now says where the value came from: the argument (api_key,base_url) or the environment variable (YAMA_API_KEY,YAMA_API_BASE_URL).
Fixed
- A 429 with a malformed
Retry-Afterheader raisesRateLimitErroror retries as usual, instead of a bareValueError. - With your own
httpx.Clientwhose response hook callsraise_for_status(), an error status raises the matching error, such asNotFoundError, instead ofAPIConnectionError. - The fake API in
yama.testinganswers 400, instead of crashing, when a code'sunitisn't a string. - Passing your own
httpx.Clientthat hasauthset no longer replaces your API key, so requests no longer fail with 401. - A base URL with whitespace around it, such as a trailing space or newline from a
.envfile, now works instead of failing every request. - A base URL with a query or fragment raises
ValueErrorinstead of sending requests to the wrong path. - A
base_urlthat isn't a string raisesTypeError. - A pagination
nextlink or base URL with a malformed internationalised host name (such asxn--a-) raisesYamaErrororValueErroras other bad URLs do, instead of an error from theidnapackage.
Security
- An error for a response the client can't read no longer carries the response's values, so they can't reach logs or error trackers; it names the fields that failed instead.
- A base URL with a username or password (
https://user:pw@host) raisesValueError. Before, they were sent as Basic auth in place of your API key, andrepr()of the client showed them.