Summary
DAOAuth does not silently refresh expired OAuth credentials before applying
header-based authorization to DAWeb requests.
Problem
DAOAuth.get_credentials() only re-authorized when credentials were missing or
marked invalid. Expired-but-refreshable credentials could be returned
unchanged, and DAOAuth.authorize() would then apply the stale bearer token to
request headers.
In addition, RedisCredStorage.locked_get() reconstructs credentials from JSON
without restoring their storage reference. That means refreshed tokens cannot be
persisted automatically after a Redis round-trip.
Expected behavior
Stored OAuth credentials should:
- reload with their storage attached
- refresh silently when expired and refreshable
- persist refreshed tokens back to Redis
- report expired or un-refreshable credentials as unauthorized instead of sending
stale bearer tokens
Actual behavior
Expired credentials could still be treated as authorized and sent as-is on the
header-based DAWeb path.
Fix
- Reattach storage when Redis-backed credentials are reloaded.
- Refresh expired credentials in
DAOAuth.get_credentials() before they are
returned.
- Treat expired credentials as unauthorized in
get_credentials() and
is_authorized() when refresh is unavailable or fails.
Summary
DAOAuthdoes not silently refresh expired OAuth credentials before applyingheader-based authorization to
DAWebrequests.Problem
DAOAuth.get_credentials()only re-authorized when credentials were missing ormarked
invalid. Expired-but-refreshable credentials could be returnedunchanged, and
DAOAuth.authorize()would then apply the stale bearer token torequest headers.
In addition,
RedisCredStorage.locked_get()reconstructs credentials from JSONwithout restoring their storage reference. That means refreshed tokens cannot be
persisted automatically after a Redis round-trip.
Expected behavior
Stored OAuth credentials should:
stale bearer tokens
Actual behavior
Expired credentials could still be treated as authorized and sent as-is on the
header-based
DAWebpath.Fix
DAOAuth.get_credentials()before they arereturned.
get_credentials()andis_authorized()when refresh is unavailable or fails.