Back to Aws Sdk Js V3

@aws-sdk/client-signer

clients/client-signer/README.md

3.1043.015.8 KB
Original Source
<!-- generated file, do not edit directly -->

@aws-sdk/client-signer

Description

AWS SDK for JavaScript Signer Client for Node.js, Browser and React Native.

<p>AWS Signer is a fully managed code-signing service to help you ensure the trust and integrity of your code. </p> <p>Signer supports the following applications:</p> <p>With code signing for AWS Lambda, you can sign <a href="http://docs.aws.amazon.com/lambda/latest/dg/">AWS Lambda</a> deployment packages. Integrated support is provided for <a href="http://docs.aws.amazon.com/AmazonS3/latest/gsg/">Amazon S3</a>, <a href="http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/">Amazon CloudWatch</a>, and <a href="http://docs.aws.amazon.com/awscloudtrail/latest/userguide/">AWS CloudTrail</a>. In order to sign code, you create a signing profile and then use Signer to sign Lambda zip files in S3. </p> <p>With code signing for IoT, you can sign code for any IoT device that is supported by AWS. IoT code signing is available for <a href="http://docs.aws.amazon.com/freertos/latest/userguide/">Amazon FreeRTOS</a> and <a href="http://docs.aws.amazon.com/iot/latest/developerguide/">AWS IoT Device Management</a>, and is integrated with <a href="http://docs.aws.amazon.com/acm/latest/userguide/">AWS Certificate Manager (ACM)</a>. In order to sign code, you import a third-party code-signing certificate using ACM, and use that to sign updates in Amazon FreeRTOS and AWS IoT Device Management. </p> <p>With Signer and the Notation CLI from the <a href="https://notaryproject.dev/">Notary
 Project</a>, you can sign container images stored in a container registry such as Amazon Elastic Container Registry (ECR). The signatures are stored in the registry alongside the images, where they are available for verifying image authenticity and integrity.</p> <p>For more information about Signer, see the <a href="http://docs.aws.amazon.com/signer/latest/developerguide/Welcome.html">AWS Signer Developer Guide</a>.</p>

Installing

To install this package, use the CLI of your favorite package manager:

  • npm install @aws-sdk/client-signer
  • yarn add @aws-sdk/client-signer
  • pnpm add @aws-sdk/client-signer

Getting Started

Import

The AWS SDK is modulized by clients and commands. To send a request, you only need to import the SignerClient and the commands you need, for example ListSigningJobsCommand:

js
// ES5 example
const { SignerClient, ListSigningJobsCommand } = require("@aws-sdk/client-signer");
ts
// ES6+ example
import { SignerClient, ListSigningJobsCommand } from "@aws-sdk/client-signer";

Usage

To send a request:

  • Instantiate a client with configuration (e.g. credentials, region).
  • Instantiate a command with input parameters.
  • Call the send operation on the client, providing the command object as input.
js
const client = new SignerClient({ region: "REGION" });

const params = { /** input parameters */ };
const command = new ListSigningJobsCommand(params);

Async/await

We recommend using the await operator to wait for the promise returned by send operation as follows:

js
// async/await.
try {
  const data = await client.send(command);
  // process data.
} catch (error) {
  // error handling.
} finally {
  // finally.
}

Promises

You can also use Promise chaining.

js
client
  .send(command)
  .then((data) => {
    // process data.
  })
  .catch((error) => {
    // error handling.
  })
  .finally(() => {
    // finally.
  });

Aggregated client

The aggregated client class is exported from the same package, but without the "Client" suffix.

Signer extends SignerClient and additionally supports all operations, waiters, and paginators as methods. This style may be familiar to you from the AWS SDK for JavaScript v2.

If you are bundling the AWS SDK, we recommend using only the bare-bones client (SignerClient). More details are in the blog post on modular packages in AWS SDK for JavaScript.

ts
import { Signer } from "@aws-sdk/client-signer";

const client = new Signer({ region: "REGION" });

// async/await.
try {
  const data = await client.listSigningJobs(params);
  // process data.
} catch (error) {
  // error handling.
}

// Promises.
client
  .listSigningJobs(params)
  .then((data) => {
    // process data.
  })
  .catch((error) => {
    // error handling.
  });

// callbacks (not recommended).
client.listSigningJobs(params, (err, data) => {
  // process err and data.
});

Troubleshooting

When the service returns an exception, the error will include the exception information, as well as response metadata (e.g. request id).

js
try {
  const data = await client.send(command);
  // process data.
} catch (error) {
  const { requestId, cfId, extendedRequestId } = error.$metadata;
  console.log({ requestId, cfId, extendedRequestId });
  /**
   * The keys within exceptions are also parsed.
   * You can access them by specifying exception names:
   * if (error.name === 'SomeServiceException') {
   *     const value = error.specialKeyInException;
   * }
   */
}

See also docs/ERROR_HANDLING.

Getting Help

Please use these community resources for getting help. We use GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them.

To test your universal JavaScript code in Node.js, browser and react-native environments, visit our code samples repo.

Contributing

This client code is generated automatically. Any modifications will be overwritten the next time the @aws-sdk/client-signer package is updated. To contribute to client you can check our generate clients scripts.

License

This SDK is distributed under the Apache License, Version 2.0, see LICENSE for more information.

Client Commands (Operations List)

<details> <summary> AddProfilePermission </summary>

Command API Reference / Input / Output

</details> <details> <summary> CancelSigningProfile </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeSigningJob </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetRevocationStatus </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetSigningPlatform </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetSigningProfile </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListProfilePermissions </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListSigningJobs </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListSigningPlatforms </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListSigningProfiles </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListTagsForResource </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutSigningProfile </summary>

Command API Reference / Input / Output

</details> <details> <summary> RemoveProfilePermission </summary>

Command API Reference / Input / Output

</details> <details> <summary> RevokeSignature </summary>

Command API Reference / Input / Output

</details> <details> <summary> RevokeSigningProfile </summary>

Command API Reference / Input / Output

</details> <details> <summary> SignPayload </summary>

Command API Reference / Input / Output

</details> <details> <summary> StartSigningJob </summary>

Command API Reference / Input / Output

</details> <details> <summary> TagResource </summary>

Command API Reference / Input / Output

</details> <details> <summary> UntagResource </summary>

Command API Reference / Input / Output

</details>