Skip to content

Commit

Permalink
fix(deps): update dependencies (non-major) (#1948)
Browse files Browse the repository at this point in the history
* fix(deps): update dependencies (non-major)

* Satisfy aws type constraints

* fix: replace unnecessary stackoverflow links failing CI

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Derek Croote <[email protected]>
  • Loading branch information
renovate[bot] and dcroote authored Feb 19, 2024
1 parent ea29aef commit ba31586
Show file tree
Hide file tree
Showing 9 changed files with 912 additions and 858 deletions.
5 changes: 5 additions & 0 deletions .changeset/six-eels-tell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@api3/airnode-deployer": minor
---

Satisfy aws type constraints
6 changes: 3 additions & 3 deletions packages/airnode-deployer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@
"@api3/airnode-utilities": "^0.14.0",
"@api3/airnode-validator": "^0.14.0",
"@api3/promise-utils": "^0.4.0",
"@aws-sdk/client-s3": "^3.418.0",
"@aws-sdk/signature-v4-crt": "^3.418.0",
"@aws-sdk/client-s3": "^3.511.0",
"@aws-sdk/signature-v4-crt": "^3.511.0",
"@google-cloud/storage": "^7.7.0",
"adm-zip": "^0.5.10",
"chalk": "^4.1.2",
"cli-table3": "^0.6.3",
"compare-versions": "^6.1.0",
"date-fns": "^2.30.0",
"date-fns-tz": "^2.0.0",
"dotenv": "^16.4.1",
"dotenv": "^16.4.2",
"ethers": "^5.7.2",
"lodash": "^4.17.21",
"ora": "^5.4.1",
Expand Down
13 changes: 10 additions & 3 deletions packages/airnode-deployer/src/infrastructure/aws.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import {
CopyObjectCommand,
DeleteObjectsCommand,
DeleteBucketCommand,
BucketLocationConstraint,
ServerSideEncryption,
} from '@aws-sdk/client-s3';
import { sdkStreamMixin } from '@aws-sdk/util-stream-node';
import {
Expand Down Expand Up @@ -71,7 +73,7 @@ describe('getAirnodeBucket', () => {
.on(ListBucketsCommand, mockListBucketsCommandInput)
.resolves({ Buckets: [{ Name: bucketName }] })
.on(GetBucketLocationCommand, mockGetBucketLocationCommandInput)
.resolves({ LocationConstraint: 'us-east-1' });
.resolves({ LocationConstraint: undefined }); // undefined means the default 'us-east-1' region

const fetchedBucket = await getAirnodeBucket();
expect(fetchedBucket).toEqual(bucket);
Expand Down Expand Up @@ -151,7 +153,12 @@ describe('createAirnodeBucket', () => {
const mockPutBucketEncryptionCommandInput = {
Bucket: bucketName,
ServerSideEncryptionConfiguration: {
Rules: [{ ApplyServerSideEncryptionByDefault: { SSEAlgorithm: 'AES256' }, BucketKeyEnabled: true }],
Rules: [
{
ApplyServerSideEncryptionByDefault: { SSEAlgorithm: 'AES256' as ServerSideEncryption },
BucketKeyEnabled: true,
},
],
},
};
const mockPutPublicAccessBlockCommandInput = {
Expand Down Expand Up @@ -187,7 +194,7 @@ describe('createAirnodeBucket', () => {
it(`creates S3 Airnode bucket with options for other than 'us-east-1' region`, async () => {
const mockCreateBucketCommandInputDifferentRegion = {
Bucket: bucketName,
CreateBucketConfiguration: { LocationConstraint: 'europe-central-1' },
CreateBucketConfiguration: { LocationConstraint: 'europe-central-1' as BucketLocationConstraint },
};
mockS3Client
.on(CreateBucketCommand, mockCreateBucketCommandInputDifferentRegion)
Expand Down
15 changes: 8 additions & 7 deletions packages/airnode-deployer/src/infrastructure/aws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
CopyObjectCommand,
DeleteObjectsCommand,
DeleteBucketCommand,
BucketLocationConstraint,
} from '@aws-sdk/client-s3';
import concat from 'lodash/concat';
import compact from 'lodash/compact';
Expand Down Expand Up @@ -63,17 +64,14 @@ export const getAirnodeBucket = async () => {
throw new Error(`Failed to get location for bucket '${bucketName}': ${goBucketLocation.error}`);
}

let region = goBucketLocation.data.LocationConstraint;
// The documentation says that for buckets in the `us-east-1` region the value of `LocationConstraint` is null but it is actually undefined
// https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLocation.html#API_GetBucketLocation_ResponseElements
const region = goBucketLocation.data.LocationConstraint ?? 'us-east-1';
// The `EU` option is listed as a possible one in the documentation
// https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLocation.html#API_GetBucketLocation_ResponseElements
if (region === 'EU') {
throw new Error(`Unknown bucket region '${region}'`);
}
// The documentation says that for buckets in the `us-east-1` region the value of `LocationConstraint` is null but it is actually undefined
// https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLocation.html#API_GetBucketLocation_ResponseElements
if (region === undefined) {
region = 'us-east-1';
}

return {
name: bucketName,
Expand All @@ -90,7 +88,10 @@ export const createAirnodeBucket = async (cloudProvider: AwsCloudProvider) => {
// If the region is `us-east-1` the configuration must be empty...
// https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html#API_CreateBucket_RequestBody
if (cloudProvider.region !== 'us-east-1') {
createParams = { ...createParams, CreateBucketConfiguration: { LocationConstraint: cloudProvider.region } };
createParams = {
...createParams,
CreateBucketConfiguration: { LocationConstraint: cloudProvider.region as BucketLocationConstraint },
};
}

logger.debug(`Creating S3 bucket '${bucketName}' in '${cloudProvider.region}'`);
Expand Down
9 changes: 4 additions & 5 deletions packages/airnode-examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ depending on how you would like to run the example - e.g. you don't need to star
intend to run the example with a public network.

If using a Linux distribution that enforces SELinux policies, make sure allow the Docker images access to the host
directory by
[creating an appropriate rule](https://stackoverflow.com/questions/24288616/permission-denied-on-accessing-host-directory-in-docker).
directory by [configuring the selinux label](https://docs.docker.com/storage/bind-mounts/#configure-the-selinux-label).

#### 1. Choose an example

Expand Down Expand Up @@ -185,9 +184,9 @@ yarn create-airnode-secrets

> If you are using Docker Desktop (on any platform) and you want to connect to your local hardhat network, you will need
> to modify the generated `secrets.env` file found in `integrations/<integration-name>/` by replacing the provider URL
> with the following: `PROVIDER_URL=http://host.docker.internal:8545`. This is a docker limitation. See:
> https://stackoverflow.com/a/24326540. A symptom of needing this change is the following error when attempting to
> connect to your local hardhat network: `could not detect network`.
> with the following: `PROVIDER_URL=http://host.docker.internal:8545`. This is a docker limitation. A symptom of needing
> this change is the following error when attempting to connect to your local hardhat network:
> `could not detect network`.
>
> The `create-airnode-secrets` script will handle this for you on Mac, Windows, and WSL.
Expand Down
6 changes: 3 additions & 3 deletions packages/airnode-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@
"@api3/commons": "^0.6.2",
"@api3/ois": "2.3.2",
"@api3/promise-utils": "^0.4.0",
"@aws-sdk/client-lambda": "^3.418.0",
"@aws-sdk/client-lambda": "^3.511.0",
"date-fns": "^2.30.0",
"dotenv": "^16.4.1",
"dotenv": "^16.4.2",
"ethers": "^5.7.2",
"express": "^4.18.2",
"google-auth-library": "^9.5.0",
"google-auth-library": "^9.6.3",
"lodash": "^4.17.21",
"yargs": "^17.7.2",
"zod": "^3.22.4"
Expand Down
2 changes: 1 addition & 1 deletion packages/airnode-protocol/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"typescript": "^5.3.3"
},
"dependencies": {
"@api3/airnode-protocol-v1": "^3.1.0",
"@api3/airnode-protocol-v1": "^3.2.0",
"@openzeppelin/contracts": "4.4.2",
"ethers": "^5.7.2"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/airnode-validator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@api3/airnode-protocol": "^0.14.0",
"@api3/ois": "2.3.2",
"@api3/promise-utils": "^0.4.0",
"dotenv": "^16.4.1",
"dotenv": "^16.4.2",
"ethers": "^5.7.2",
"lodash": "^4.17.21",
"ora": "^5.4.1",
Expand Down
Loading

0 comments on commit ba31586

Please sign in to comment.