Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Refactor of the publish path and HttpTransport (#162)
To improve the testability of publishing a package, `PyOci.publish_package()` is split into multiple methods. Tests for the refactored parts were moved/restructured so it is no longer needed to go through the entire request flow for every test (including mockito). A new Trait `Transport` is introduced and `PyOci` is generic over `Transport`. This allows swapping the `HttpTransport` in unittests in the future, removing the need to mockito in a lot of cases. Annotations have been structured a bit more. - ImageIndex annotations will only include it's creation timestamp - ImageIndex.manifests[] annotations will include package metadata we might need when listing/searching packages - ImageManifest annotations will contain user-defined labels through `PyOci :: Label :: ` classifiers. The `com.pyoci.sha256_digest` annotation is added containing the SHA256 digest of the package blob. This is a first step to make #160 work in an effective manner. The SHA256 digest of the provided content is checked against the provided `sha256_digest` in the request.
- Loading branch information