storeapi: decouple auth and API
Metadata
Current evaluation
Merged as commit 95fe818f8: storeapi auth decoupled from API logic via new Authorization component, centralized token discharge/refresh, simpler StoreClient login; account-info caching dropped pending candid client.
Resolution: closed resolved
Reason: PR snapcore/snapcraft#3452 was approved by two reviewers and merged to master as commit 95fe818f8, splitting storeapi into an Authorization component plus per-API request wrappers.
Evaluated by: mr-cal-bot
No scores available.
Issue body
This changes includes:
- a new Authorization component to generate requests.
- Auth and token discharge logic tied to Authorization class.
- Refresh logic centralized to the request of the Authorization class
(as it is backend specific).
- Core login primitives simplified in StoreClient and relevant
delegations to the Authorization class.
- A general simple inheritable requests wrapper for each .*API class
with an abstractmethod to implement the request logic.
There is one big change in behavior, internally mostly, is that now
all requests to get_account_information are not stored anymore. This
affects a fast whoami call. This will be added back after the new
candid client is introduced.
Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com>
- [ ] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)?
- [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [ ] Have you successfully run `./runtests.sh static`?
- [ ] Have you successfully run `./runtests.sh tests/unit`?
-----
This is how it looks like now:

Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged as commit 95fe818f8: storeapi auth decoupled from API logic via new Authorization component, centralized token discharge/refresh, simpler StoreClient login; account-info caching dropped pending candid client. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged as 95fe818f8: storeapi auth refactored into a new Authorization class, decoupling token/refresh/discharge logic from the API wrapper, with an inheritable request wrapper per .*API class. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged as 95fe818f8, separating store API authentication from API logic, centralizing token discharge and refresh, and simplifying login; account-information caching was temporarily removed. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #3452 as commit 95fe818f8, decoupling Store API authentication from API logic through a centralized Authorization component and reusable request wrapper. | |
| qwen/qwen3.6-35b-a3b | — | — | Merged changes decoupling authentication from API logic. Introduces a centralized Authorization component for token handling and request wrapping, simplifies login primitives, and refactors 24 files. Approved by reviewers, passed CI, and integrated into master. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged into master. Decouples auth and API logic in storeapi via a centralized Authorization component, centralizing token refresh and adding a base requests wrapper. Removes internal caching of get_account_information requests pending future updates. |
Update history
No update history recorded yet.
Related work
-
Related To:
snapcraft#3472
(confidence 88%)
Follow-up merge c32d76480 moved http client and auth into the http_clients package, building on this refactor
-
Related To:
snapcraft#3473
(confidence 80%)
Candid bakery support (eea2cca4f) delivered the candid client whose introduction was deferred by this PR's account-information caching removal
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #3592 storeapi: auth client for api.snapcraft.io | snapcraft | closed | Merged #3592 at commit 9674a2c, adding the Store API authentication client for api.snapcraft.io. |