mirror of
https://github.com/elisiariocouto/leggen.git
synced 2025-12-29 09:49:17 +00:00
Compare commits
3 Commits
473f126d3e
...
2025.9.25
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d3954f079b | ||
|
|
0b68038739 | ||
|
|
d36568da54 |
20
CHANGELOG.md
20
CHANGELOG.md
@@ -1,4 +1,24 @@
|
||||
|
||||
## 2025.9.25 (2025/09/30)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **api:** Fix S3 backup path-style configuration and improve UX. ([22ec0e36](https://github.com/elisiariocouto/leggen/commit/22ec0e36b11e5b017075bee51de0423a53ec4648))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
- **api:** Add S3 backup functionality to backend ([7f2a4634](https://github.com/elisiariocouto/leggen/commit/7f2a4634c51814b6785433a25ce42d20aea0558c))
|
||||
- **frontend:** Add S3 backup UI and complete backup functionality ([01229130](https://github.com/elisiariocouto/leggen/commit/0122913052793bcbf011cb557ef182be21c5de93))
|
||||
- **frontend:** Add ability to list backups and create a backup on demand. ([473f126d](https://github.com/elisiariocouto/leggen/commit/473f126d3e699521172539f2ca0bff0579ccee51))
|
||||
|
||||
|
||||
### Miscellaneous Tasks
|
||||
|
||||
- Log more rate limit headers. ([d36568da](https://github.com/elisiariocouto/leggen/commit/d36568da540d4fb4ae1fa10b322a3fa77dcc5360))
|
||||
|
||||
|
||||
|
||||
## 2025.9.24 (2025/09/25)
|
||||
|
||||
### Features
|
||||
|
||||
@@ -9,16 +9,20 @@ from leggen.utils.config import config
|
||||
from leggen.utils.paths import path_manager
|
||||
|
||||
|
||||
def _log_rate_limits(response):
|
||||
def _log_rate_limits(response, method, url):
|
||||
"""Log GoCardless API rate limit headers"""
|
||||
limit = response.headers.get("http_x_ratelimit_limit")
|
||||
remaining = response.headers.get("http_x_ratelimit_remaining")
|
||||
reset = response.headers.get("http_x_ratelimit_reset")
|
||||
|
||||
if limit or remaining or reset:
|
||||
logger.info(
|
||||
f"GoCardless rate limits - Limit: {limit}, Remaining: {remaining}, Reset: {reset}s"
|
||||
)
|
||||
limit = response.headers.get("http_x_ratelimit_limit") or response.headers.get(
|
||||
"http_x_ratelimit_account_success_limit"
|
||||
)
|
||||
remaining = response.headers.get(
|
||||
"http_x_ratelimit_remaining"
|
||||
) or response.headers.get("http_x_ratelimit_account_success_remaining")
|
||||
reset = response.headers.get("http_x_ratelimit_reset") or response.headers.get(
|
||||
"http_x_ratelimit_account_success_reset"
|
||||
)
|
||||
logger.debug(
|
||||
f"{method} {url} - Limit: {limit}, Remaining: {remaining}, Reset: {reset}s"
|
||||
)
|
||||
|
||||
|
||||
class GoCardlessService:
|
||||
@@ -37,7 +41,7 @@ class GoCardlessService:
|
||||
|
||||
async with httpx.AsyncClient() as client:
|
||||
response = await client.request(method, url, headers=headers, **kwargs)
|
||||
_log_rate_limits(response)
|
||||
_log_rate_limits(response, method, url)
|
||||
|
||||
# If we get 401, clear token cache and retry once
|
||||
if response.status_code == 401:
|
||||
@@ -45,7 +49,7 @@ class GoCardlessService:
|
||||
self._token = None
|
||||
headers = await self._get_auth_headers()
|
||||
response = await client.request(method, url, headers=headers, **kwargs)
|
||||
_log_rate_limits(response)
|
||||
_log_rate_limits(response, method, url)
|
||||
|
||||
response.raise_for_status()
|
||||
return response.json()
|
||||
@@ -76,7 +80,9 @@ class GoCardlessService:
|
||||
f"{self.base_url}/token/refresh/",
|
||||
json={"refresh": auth["refresh"]},
|
||||
)
|
||||
_log_rate_limits(response)
|
||||
_log_rate_limits(
|
||||
response, "POST", f"{self.base_url}/token/refresh/"
|
||||
)
|
||||
response.raise_for_status()
|
||||
auth.update(response.json())
|
||||
self._save_auth(auth)
|
||||
@@ -104,7 +110,7 @@ class GoCardlessService:
|
||||
"secret_key": self.config["secret"],
|
||||
},
|
||||
)
|
||||
_log_rate_limits(response)
|
||||
_log_rate_limits(response, "POST", f"{self.base_url}/token/new/")
|
||||
response.raise_for_status()
|
||||
auth = response.json()
|
||||
self._save_auth(auth)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "leggen"
|
||||
version = "2025.9.24"
|
||||
version = "2025.9.25"
|
||||
description = "An Open Banking CLI"
|
||||
authors = [{ name = "Elisiário Couto", email = "elisiario@couto.io" }]
|
||||
requires-python = "~=3.13.0"
|
||||
|
||||
@@ -42,6 +42,9 @@ echo " > Version bumped to $NEXT_VERSION"
|
||||
echo "Updating CHANGELOG.md"
|
||||
git-cliff --unreleased --tag "$NEXT_VERSION" --prepend CHANGELOG.md > /dev/null
|
||||
|
||||
echo "Locking dependencies"
|
||||
uv lock
|
||||
|
||||
echo " > Commiting changes and adding git tag"
|
||||
git add pyproject.toml CHANGELOG.md uv.lock
|
||||
git commit -m "chore(ci): Bump version to $NEXT_VERSION"
|
||||
|
||||
Reference in New Issue
Block a user