0.5.0 • Published 2 months ago

@sigstore/oci v0.5.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 months ago

@sigstore/oci · npm version CI Status Smoke Test Status

Attach artifacts to images in OCI registries.

Prerequisites

  • Node.js version >= 18.17.0

Installation

npm install @sigstore/oci

Usage

const { attachArtifactToImage } = require('@sigstore/oci');
import { attachArtifactToImage } from '@sigstore/oci';

attachArtifactToImage(options)

Uploads the provided artifact to the registry and associates it with an OCI image.

  • options Object

    • artifact Buffer: Bytes of the artifact to upload.
    • mediaType string: Content type to assign to the artifact.
    • imageName string: Fully-qualified name of the image to which the artifact should be associated.
    • imageDigest string: Digest of the image to which the artifact should be associated. Should be of the form <alg>:<digest>.
    • credentials Object
      • username string: Username to use when authenticating with the registry.
      • password string: Password to use when authenticating with the registry.
    • annotations Record<string, string>: Arbitrary name/value pairs to be associated with artifact.

getRegistryCredentials(imageName)

Reads the local $HOME/.docker/config.json file and returns the credentials associated with the image's registry.

  • imageName string: Fully-qualified name of the image from which to extract the registry hostname.

Returns a Credentials object with the following keys:

  • username string
  • password string

Throws if the Docker config cannot be located or if there are no credentials for the specified registry.

0.5.0

2 months ago

0.4.0

9 months ago

0.3.6

1 year ago

0.3.5

1 year ago

0.3.7

1 year ago

0.3.4

1 year ago

0.3.3

1 year ago

0.3.2

1 year ago

0.3.1

1 year ago

0.3.0

1 year ago

0.2.0

1 year ago

0.1.0

1 year ago