cli: add expiration option to export-login
Metadata
Current evaluation
Merged. Adds --expires to snapcraft export-login, enforcing strict ISO 8601 datetime formats. Removes dateutil dependency, refactors store error handling to surface validation failures, and adds a manual expiration test.
Suggested action: —
No scores available.
Issue body
- [x] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)?
- [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [x] If this is a bugfix. Have you checked that there is a bug report open for the issue you are trying to fix on [bug reports](https://bugs.launchpad.net/snapcraft)?
- [x] If this is a new feature. Have you discussed the design on the [forum](https://forum.snapcraft.io)?
- [x] Have you successfully run `./runtests.sh static`?
- [x] Have you successfully run `./runtests.sh unit`?
-----
With this PR one can e.g. call `snapcraft export-login --expires=2018-01-01T00:00:00` and export a login that is only valid until the first of the year.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged. Adds --expires to snapcraft export-login, enforcing strict ISO 8601 datetime formats. Removes dateutil dependency, refactors store error handling to surface validation failures, and adds a manual expiration test. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged. Adds --expires option to snapcraft export-login CLI. Uses strict ISO 8601 format, removes dateutil dependency, and refactors store error handling to surface validation errors. Includes manual expiration test. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged. Added an --expires option to the snapcraft export-login CLI command. Enforces strict ISO 8601 dates, removes the dateutil dependency, refactors store error handling to surface validation errors, and includes a manual test. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1928756 export-login --expires silently ignores dates given in ISO 8601 format | snapcraft (launchpad) | open | export-login --expires silently drops date-only ISO 8601 strings (e.g. 2022-01-01), producing a macaroon with expires: None. Requires full datetime to work. 5+ years old, zero comments, labelled craft-215, no maintainer response. | |
| #4226 snapcraft export-login ignores expires parameter | snapcraft | closed | Closed as stale. Maintainers clarified the short expiration is expected due to store-side macaroon refresh logic, not a snapcraft bug. No code changes were made. |