Commit Graph

8 Commits

Author SHA1 Message Date
Miloslav Trmač bdb2613fe6 Add private.UnparsedImage, use it for signature handling
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-07-07 18:38:27 +02:00
Miloslav Trmač 7d9cde7252 Update to major version v5
> gomove github.com/containers/image/v4 github.com/containers/image/v5
+ a manual edit of go.mod

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2019-10-25 22:27:45 +02:00
Miloslav Trmač e568c94ef3 Correctly use a c/image/v4 module namespace
... so that major-version-aware Go module import
(as opposed to vX.Y.Z+incompatible, which does not allow different
packages to use different versions) works right.

Also requires adding some more GO111MODULE=on options to Makefile.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2019-10-03 22:54:27 +02:00
Mike Lundy 369c44212b Put context.Context arguments on almost everything
- Network IO paths should react to cancels now.
- File IO paths generally still won't.
- `SystemContext` objects have been renamed to `sys` to leave `ctx`
  available for the stdlib context objects.

Signed-off-by: Mike Lundy <mike@fluffypenguin.org>
2018-04-07 04:34:51 -07:00
Miloslav Trmač b8751d89dc Add types.UnparsedImage
Currently we use a types.Image, which supports lots of parsing, for
verification processing in in signature.PolicyContext.

In the future, we will want that types.Image to do significantly more
processing at initialization time (e.g. determine manifest type and
fully parse it), which is undesirable for signature verification
— there we would _really_ prefer to first find a signature which
cryptographically verifies, before even _downloading_ the manifest,
let alone processing it in any way.

So, split the minimum functionality desired for processing unsigned
images (manifest and signature caching) into a separate UnparsedImage
type.

Right now, this does not affect any Image or UnparsedImage
implementation (apart from dropping a few panic()ing mock functions).

(Note that for some more advanced processing, signature/* may create a
types.Image out of the given types.UnparsedImage in the future — but
that would be an intentional action after the signature code determines
that there is enough presumed trust to even start parsing anything.)

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2016-10-11 13:00:27 +02:00
Miloslav Trmač 365c318161 Use transports.ImageName in error messages
This requires some new and expanded mocks instead of cheating and
passing nil objects.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2016-07-16 05:09:39 +02:00
Antonio Murdaca e68e0e1110 move the project to a library
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-06-25 11:25:48 +02:00
Miloslav Trmač fd9c615d88 Add PolicyRequirement implementations
Also move the declaration of the type from the mostly-public
policy_types.go to policy_eval.go.
2016-06-02 16:12:10 +02:00