Commit Graph

14 Commits

Author SHA1 Message Date
Anthony Oteri f55c72aa34 fix: resolve CI check failures
- Replace serde_yml with serde_norway (RUSTSEC-2025-0068: serde_yml is
  unsound and archived; serde_norway is the recommended maintained fork)
- Remove unused toml dependency (was resolving to v1.1.2 which requires
  edition2024/Rust 1.85, breaking the MSRV 1.80 check)
- Run cargo fmt to fix formatting diffs caught by lint job
- Fix cog commit check to use from_latest_tag so pre-conventional-commits
  history does not cause the check to fail
- Remove semver job: dredge is a binary-only crate with no lib target,
  cargo-semver-checks cannot check it
2026-05-13 14:51:42 -04:00
Anthony Oteri d2d51b3a2d refactor: simplify codebase and fix correctness issues
- api: extract check_api_version_header() helper, eliminating duplicated
  header-checking logic in parse_response_status()
- api: simplify parse_rfc5988() using split_once and let-else
- api: propagate JSON decode errors in fetch_paginated() instead of
  silently swallowing them
- api: add connect/request timeouts via a shared build_client() helper;
  all handlers now use a configured client instead of reqwest::get()
- api: fix stale log trace name get_manifest -> get_digest
- commands: promote inline response structs to module-level for clarity
- commands: fix etag stripping logic (was using wrong quote/apostrophe
  pattern; now correctly strips RFC 7232 double-quotes)
- commands: simplify iterator chains in catalog/tags handlers
- error: simplify ResponseHeaderParseError from Box<dyn Error> to String
- main: fix stale log trace name make_registry_url -> parse_registry_arg
- main: use as_deref().unwrap_or() instead of allocating via to_owned()
- cli: remove unused imports and #![allow(unused_imports)] attribute
2026-05-13 14:51:42 -04:00
Anthony Oteri 07746429bb Be consistent with use of http and reqwest libraries
The types may have similar names but are distinct types and should be used consistently.  This changes
the code to use the header and status code information directly from the `reqwests` library instead of
mixing the two.

Signed-off-by: Anthony Oteri <anthony.oteri@gmail.com>
2023-11-16 10:30:03 -05:00
Anthony Oteri 0e4219b405 Change License
This changes the effective license from a simple Apache-2.0 license to a
dual license consisting of both Apache-2.0 and the MIT license to be more
compatible for use in GPL Code.

The MIT license requires reproducing countless copies of the same copyright
header with diffferent names in the copyright field, for every MIT library
in use.  The Apache license does not have this drawback.  However, this is not
the primary motivation for creating these issues.  The Apache license also has
protections from patent trolls and explicit contribuition licensing clause.
However the Apache license is incompatible with GPLv2.  This is why Rust is
dual-licensed as MIT/Apache (the "primary" license being Apache, MIT only for
GPLv2 compat), and doing so would be wise for this project.  This also makes
this crate suitable for inclusion and unrestricted sharing in the Rust
standard distribution and other projects using dual MIT/Apache.
2023-10-03 09:36:43 -04:00
Anthony Oteri 42f8f46bd3 Replace async_std::test with tokio::test 2023-10-02 13:10:55 -04:00
Anthony Oteri fbe43f03f1 Support deleting an image tag
If the Docker Registry API allows for images to be deleted, issuing the
command `delete <image> <tag>` will result in the tag being removed from
the server.

A limitation of this change is that it will cause any unreferenced tags
to become orphaned, requiring the garbage collector within the docker
registry server to clean these up.  This is because there is no way to
efficiently determine if each of the layers are reused by other tags or
images on the server.

Implement delete logic

Fix broken unit tests
2023-09-29 18:04:08 -04:00
Anthony Oteri 2e10f9b5f7 Automated code cleanup 2023-09-26 23:01:58 -04:00
Anthony Oteri 444ed28d4d Add some unit test coverage for the RFC5988 parsing 2023-09-26 23:01:58 -04:00
Anthony Oteri 79aabc1dac More miscellaneous code cleanup 2023-09-21 16:17:51 -04:00
Anthony Oteri 535e08e9bb Support for specifying the URL on the command line 2023-09-21 15:34:19 -04:00
Anthony Oteri 3156a9f99e Fix clippy security errors 2023-09-21 14:28:15 -04:00
Anthony Oteri 3768401faf Refactoring for Show/Delete handlers
Refactor the existing code architecture to be a little flatter to support adding the show and delete handlers.  Currently these two handlers are just stubbed functions, but the CLI looks about right.
2023-09-20 16:38:24 -04:00
Anthony Oteri 6199848e23 Add Required Copyright header to source files 2023-09-18 14:16:09 -04:00
Anthony Oteri b9d34e7614 Add support for listing image tags 2023-09-18 14:01:21 -04:00