From 32bfbb6389b53be14ff67147b77dc9a78769fc55 Mon Sep 17 00:00:00 2001 From: mattsb42-aws Date: Tue, 19 May 2020 14:33:08 -0700 Subject: [PATCH 1/2] chore: add workflow to check for copyright notices --- .github/not-grep.toml | 19 +++++++++++++++++++ .github/workflows/ci_static-analysis.yaml | 12 ++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 .github/not-grep.toml create mode 100644 .github/workflows/ci_static-analysis.yaml diff --git a/.github/not-grep.toml b/.github/not-grep.toml new file mode 100644 index 000000000..0b78e9bc1 --- /dev/null +++ b/.github/not-grep.toml @@ -0,0 +1,19 @@ +[include] +# Use "include" rather than "prefix" because +# some CLI entry point files have shebang lines +# that need to come first. +"**/*.ts" = """ +// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +""" +"**/package.json" = "\"license\": \"Apache-2.0\"" +"**/*.sh" = """ +# Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 +""" +[prefix] +# Exclude the copies of msrcrypto included in examples packages. +"**/[!msrcrypto]*.js" = """ +// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +""" diff --git a/.github/workflows/ci_static-analysis.yaml b/.github/workflows/ci_static-analysis.yaml new file mode 100644 index 000000000..139c158cb --- /dev/null +++ b/.github/workflows/ci_static-analysis.yaml @@ -0,0 +1,12 @@ +# This workflow performs static analysis checks. +name: static analysis + +on: ["pull_request", "push"] + +jobs: + not-grep: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: not-grep + uses: mattsb42-meta/not-grep@1.0.0 From 3b37ebe3e296ef64bbd826b988fe564ab25b606a Mon Sep 17 00:00:00 2001 From: mattsb42-aws Date: Tue, 19 May 2020 14:33:31 -0700 Subject: [PATCH 2/2] chore: add missing copyright notices --- karma.conf.js | 3 +++ .../karma.conf.js | 3 +++ modules/decrypt-browser/karma.conf.js | 3 +++ modules/encrypt-browser/karma.conf.js | 3 +++ modules/encrypt-node/src/encrypt.ts | 3 +++ modules/example-browser/karma.conf.js | 3 +++ .../webpack_configs/aes.webpack.config.js | 3 +++ .../caching_cmm.webpack.config.js | 3 +++ .../webpack_configs/fallback.webpack.config.js | 3 +++ .../webpack_configs/kms.webpack.config.js | 3 +++ .../multi_keyring.webpack.config.js | 3 +++ .../webpack_configs/rsa.webpack.config.js | 3 +++ modules/integration-browser/karma.conf.js | 3 +++ modules/integration-browser/webpack.config.js | 3 +++ modules/kms-keyring-browser/karma.conf.js | 3 +++ .../material-management-browser/karma.conf.js | 3 +++ modules/raw-aes-keyring-browser/karma.conf.js | 3 +++ modules/raw-rsa-keyring-browser/karma.conf.js | 3 +++ .../src/oaep_hash_supported.ts | 16 ++-------------- modules/web-crypto-backend/karma.conf.js | 3 +++ package.json | 2 +- wallaby.conf.js | 2 ++ 22 files changed, 62 insertions(+), 15 deletions(-) diff --git a/karma.conf.js b/karma.conf.js index 4a3967c77..c190cb66c 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -1,3 +1,6 @@ +// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + // Karma configuration module.exports = function (config) { diff --git a/modules/caching-materials-manager-browser/karma.conf.js b/modules/caching-materials-manager-browser/karma.conf.js index b148a0730..e4d3f1ff6 100644 --- a/modules/caching-materials-manager-browser/karma.conf.js +++ b/modules/caching-materials-manager-browser/karma.conf.js @@ -1,3 +1,6 @@ +// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + // Karma configuration module.exports = function (config) { diff --git a/modules/decrypt-browser/karma.conf.js b/modules/decrypt-browser/karma.conf.js index b148a0730..e4d3f1ff6 100644 --- a/modules/decrypt-browser/karma.conf.js +++ b/modules/decrypt-browser/karma.conf.js @@ -1,3 +1,6 @@ +// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + // Karma configuration module.exports = function (config) { diff --git a/modules/encrypt-browser/karma.conf.js b/modules/encrypt-browser/karma.conf.js index b148a0730..e4d3f1ff6 100644 --- a/modules/encrypt-browser/karma.conf.js +++ b/modules/encrypt-browser/karma.conf.js @@ -1,3 +1,6 @@ +// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + // Karma configuration module.exports = function (config) { diff --git a/modules/encrypt-node/src/encrypt.ts b/modules/encrypt-node/src/encrypt.ts index 35e050516..8cd2841c7 100644 --- a/modules/encrypt-node/src/encrypt.ts +++ b/modules/encrypt-node/src/encrypt.ts @@ -1,3 +1,6 @@ +// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + import { KeyringNode, NodeMaterialsManager, diff --git a/modules/example-browser/karma.conf.js b/modules/example-browser/karma.conf.js index 08106657a..ab3e9bb61 100644 --- a/modules/example-browser/karma.conf.js +++ b/modules/example-browser/karma.conf.js @@ -1,3 +1,6 @@ +// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + const webpack = require('webpack') const {defaultProvider} = require('@aws-sdk/credential-provider-node') diff --git a/modules/example-browser/webpack_configs/aes.webpack.config.js b/modules/example-browser/webpack_configs/aes.webpack.config.js index 7a305a620..ba36a0d25 100644 --- a/modules/example-browser/webpack_configs/aes.webpack.config.js +++ b/modules/example-browser/webpack_configs/aes.webpack.config.js @@ -1,3 +1,6 @@ +// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + const path = require('path') module.exports = { diff --git a/modules/example-browser/webpack_configs/caching_cmm.webpack.config.js b/modules/example-browser/webpack_configs/caching_cmm.webpack.config.js index da6de99ac..7a82804fe 100644 --- a/modules/example-browser/webpack_configs/caching_cmm.webpack.config.js +++ b/modules/example-browser/webpack_configs/caching_cmm.webpack.config.js @@ -1,3 +1,6 @@ +// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + const webpack = require('webpack') const path = require('path') const {defaultProvider} = require('@aws-sdk/credential-provider-node') diff --git a/modules/example-browser/webpack_configs/fallback.webpack.config.js b/modules/example-browser/webpack_configs/fallback.webpack.config.js index 6f5101115..09494b5c3 100644 --- a/modules/example-browser/webpack_configs/fallback.webpack.config.js +++ b/modules/example-browser/webpack_configs/fallback.webpack.config.js @@ -1,3 +1,6 @@ +// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + const path = require('path') module.exports = { diff --git a/modules/example-browser/webpack_configs/kms.webpack.config.js b/modules/example-browser/webpack_configs/kms.webpack.config.js index b94eab418..3fd95f984 100644 --- a/modules/example-browser/webpack_configs/kms.webpack.config.js +++ b/modules/example-browser/webpack_configs/kms.webpack.config.js @@ -1,3 +1,6 @@ +// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + const webpack = require('webpack') const path = require('path') const {defaultProvider} = require('@aws-sdk/credential-provider-node') diff --git a/modules/example-browser/webpack_configs/multi_keyring.webpack.config.js b/modules/example-browser/webpack_configs/multi_keyring.webpack.config.js index 0a745bf64..90525b6a5 100644 --- a/modules/example-browser/webpack_configs/multi_keyring.webpack.config.js +++ b/modules/example-browser/webpack_configs/multi_keyring.webpack.config.js @@ -1,3 +1,6 @@ +// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + const webpack = require('webpack') const path = require('path') const {defaultProvider} = require('@aws-sdk/credential-provider-node') diff --git a/modules/example-browser/webpack_configs/rsa.webpack.config.js b/modules/example-browser/webpack_configs/rsa.webpack.config.js index bf96f2c98..d8519f431 100644 --- a/modules/example-browser/webpack_configs/rsa.webpack.config.js +++ b/modules/example-browser/webpack_configs/rsa.webpack.config.js @@ -1,3 +1,6 @@ +// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + const path = require('path') module.exports = { diff --git a/modules/integration-browser/karma.conf.js b/modules/integration-browser/karma.conf.js index 4838750e6..aa3701c62 100644 --- a/modules/integration-browser/karma.conf.js +++ b/modules/integration-browser/karma.conf.js @@ -1,3 +1,6 @@ +// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + // Karma configuration const { readFileSync } = require('fs') diff --git a/modules/integration-browser/webpack.config.js b/modules/integration-browser/webpack.config.js index 627ebed64..06f41b14e 100644 --- a/modules/integration-browser/webpack.config.js +++ b/modules/integration-browser/webpack.config.js @@ -1,3 +1,6 @@ +// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + const path = require('path') module.exports = { diff --git a/modules/kms-keyring-browser/karma.conf.js b/modules/kms-keyring-browser/karma.conf.js index b148a0730..e4d3f1ff6 100644 --- a/modules/kms-keyring-browser/karma.conf.js +++ b/modules/kms-keyring-browser/karma.conf.js @@ -1,3 +1,6 @@ +// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + // Karma configuration module.exports = function (config) { diff --git a/modules/material-management-browser/karma.conf.js b/modules/material-management-browser/karma.conf.js index b148a0730..e4d3f1ff6 100644 --- a/modules/material-management-browser/karma.conf.js +++ b/modules/material-management-browser/karma.conf.js @@ -1,3 +1,6 @@ +// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + // Karma configuration module.exports = function (config) { diff --git a/modules/raw-aes-keyring-browser/karma.conf.js b/modules/raw-aes-keyring-browser/karma.conf.js index b148a0730..e4d3f1ff6 100644 --- a/modules/raw-aes-keyring-browser/karma.conf.js +++ b/modules/raw-aes-keyring-browser/karma.conf.js @@ -1,3 +1,6 @@ +// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + // Karma configuration module.exports = function (config) { diff --git a/modules/raw-rsa-keyring-browser/karma.conf.js b/modules/raw-rsa-keyring-browser/karma.conf.js index b148a0730..e4d3f1ff6 100644 --- a/modules/raw-rsa-keyring-browser/karma.conf.js +++ b/modules/raw-rsa-keyring-browser/karma.conf.js @@ -1,3 +1,6 @@ +// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + // Karma configuration module.exports = function (config) { diff --git a/modules/raw-rsa-keyring-node/src/oaep_hash_supported.ts b/modules/raw-rsa-keyring-node/src/oaep_hash_supported.ts index a4bfd1514..a48d603e3 100644 --- a/modules/raw-rsa-keyring-node/src/oaep_hash_supported.ts +++ b/modules/raw-rsa-keyring-node/src/oaep_hash_supported.ts @@ -1,17 +1,5 @@ -/* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use - * this file except in compliance with the License. A copy of the License is - * located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - * implied. See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 /* oaepHash support was added in Node.js v12.9.1 (https://github.com/nodejs/node/pull/28335) * However, the integration tests need to be able to verify functionality on other versions. diff --git a/modules/web-crypto-backend/karma.conf.js b/modules/web-crypto-backend/karma.conf.js index b148a0730..e4d3f1ff6 100644 --- a/modules/web-crypto-backend/karma.conf.js +++ b/modules/web-crypto-backend/karma.conf.js @@ -1,3 +1,6 @@ +// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + // Karma configuration module.exports = function (config) { diff --git a/package.json b/package.json index 939f37ead..ec4c4ce03 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "url": "git@github.com:awslabs/aws-encryption-sdk-javascript.git" }, "author": "aws-crypto-tools-team@amazon.com", - "license": "UNLICENSED", + "license": "Apache-2.0", "dependencies": { "@aws-crypto/cache-material": "file:modules/cache-material", "@aws-crypto/caching-materials-manager-browser": "file:modules/caching-materials-manager-browser", diff --git a/wallaby.conf.js b/wallaby.conf.js index 0a2ac799a..1e694d9b2 100644 --- a/wallaby.conf.js +++ b/wallaby.conf.js @@ -1,3 +1,5 @@ +// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 const compilerOptions = Object.assign({ 'esModuleInterop': true,