mirror of
https://github.com/ultravioletrs/cocos.git
synced 2026-06-23 04:10:25 +00:00
d5badba547
CI / lint (push) Has been cancelled
CI / test (agent) (push) Has been cancelled
CI / test (cli) (push) Has been cancelled
CI / test (cmd) (push) Has been cancelled
CI / test (internal) (push) Has been cancelled
CI / test (manager, true) (push) Has been cancelled
CI / test (pkg) (push) Has been cancelled
CI / upload-coverage (push) Has been cancelled
* feat: Implement per-resource KBS configuration, allowing algorithms and datasets to specify individual KBS URLs. Signed-off-by: Sammy Oina <sammyoina@gmail.com> * refactor: Encapsulate CLI error handling and CVM certificate paths within the CLI struct, and add algorithm type to agent's algorithm structure. Signed-off-by: Sammy Oina <sammyoina@gmail.com> * style: Remove blank lines and fix indentation in CLI commands. Signed-off-by: Sammy Oina <sammyoina@gmail.com> * refactor: Update downloadAndDecryptGenericResource to accept KBS URL as a parameter and adjust related tests Signed-off-by: Sammy Oina <sammyoina@gmail.com> * refactor: group CLI configuration into structured types and simplify skopeo decryption key handling Signed-off-by: Sammy Oina <sammyoina@gmail.com> --------- Signed-off-by: Sammy Oina <sammyoina@gmail.com>
44 lines
1.1 KiB
Go
44 lines
1.1 KiB
Go
// Copyright (c) Ultraviolet
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package oci
|
|
|
|
// ResourceType defines the type of OCI resource.
|
|
type ResourceType string
|
|
|
|
const (
|
|
// ResourceTypeOCIImage represents a standard OCI image.
|
|
ResourceTypeOCIImage ResourceType = "oci-image"
|
|
)
|
|
|
|
// ResourceSource defines the source of an OCI resource.
|
|
type ResourceSource struct {
|
|
// Type of resource (oci-image)
|
|
Type ResourceType `json:"type"`
|
|
|
|
// URI is the OCI image reference (e.g., "docker://registry/repo:tag")
|
|
URI string `json:"uri"`
|
|
|
|
// Encrypted indicates if the image is encrypted
|
|
Encrypted bool `json:"encrypted"`
|
|
|
|
// KBSResourcePath is the KBS resource path for the decryption key
|
|
// (e.g., "default/key/algo-key")
|
|
KBSResourcePath string `json:"kbs_resource_path,omitempty"`
|
|
|
|
// KBSURL is the KBS endpoint URL for this specific resource
|
|
KBSURL string `json:"kbs_url,omitempty"`
|
|
}
|
|
|
|
// ImageManifest represents basic OCI image manifest information.
|
|
type ImageManifest struct {
|
|
// Reference is the original image reference
|
|
Reference string
|
|
|
|
// Digest is the image digest
|
|
Digest string
|
|
|
|
// Layers are the layer digests
|
|
Layers []string
|
|
}
|