Skip to content

Commit

Permalink
chore: Repair copyright headers (#30)
Browse files Browse the repository at this point in the history
* chore: update license/copyright headers
* chore: a quick script to add source headers
  • Loading branch information
archieco authored Feb 21, 2023
1 parent c54aa2d commit dff7d76
Show file tree
Hide file tree
Showing 40 changed files with 138 additions and 1 deletion.
26 changes: 26 additions & 0 deletions .tools/add-license-headers.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

function find_files_with_missing {
files=$(find . -name "*.$1" | grep -v node_modules | grep -v cdk.out )
egrep -l 'Copyright 202[0-3] Amazon' $files | sort > .c1
echo $files | tr ' ' '\n' | sort > .c2
comm -3 .c1 .c2
rm .c1 .c2
}


find_files_with_missing "py" | while read fn ; do
cat py.copy $fn > tmp
mv tmp $fn
done

find_files_with_missing "ts" | while read fn ; do
cat ts.copy $fn > tmp
mv tmp $fn
done

find_files_with_missing "tsx" | while read fn ; do
cat ts.copy $fn > tmp
mv tmp $fn
done
2 changes: 2 additions & 0 deletions .tools/py.copy
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
5 changes: 5 additions & 0 deletions .tools/ts.copy
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/*
* Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

3 changes: 3 additions & 0 deletions backend/backend/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
# Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

__version__ = '0.1.0'
2 changes: 2 additions & 0 deletions backend/backend/common/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
2 changes: 2 additions & 0 deletions backend/backend/functions/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

import os
from typing import Any, Dict
from aws_lambda_powertools.utilities.typing import LambdaContext
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

import json
from backend.logging.logger import safeLogger
from backend.models.assets import (
Expand Down
2 changes: 2 additions & 0 deletions backend/backend/handlers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
2 changes: 2 additions & 0 deletions backend/backend/handlers/assets/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
3 changes: 3 additions & 0 deletions backend/backend/handlers/config/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

2 changes: 2 additions & 0 deletions backend/backend/handlers/databases/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
5 changes: 4 additions & 1 deletion backend/backend/handlers/metadata/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0


import boto3
import json
Expand Down Expand Up @@ -114,4 +117,4 @@ def validate_body(event):
if not isinstance(v, str):
raise ValidationError(400, {"error": "metadata version 1 requires string keys and values"})

return body
return body
3 changes: 3 additions & 0 deletions backend/backend/handlers/metadata/create.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

import json
import traceback

Expand Down
3 changes: 3 additions & 0 deletions backend/backend/handlers/metadata/delete.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

import os
import sys
import json
Expand Down
3 changes: 3 additions & 0 deletions backend/backend/handlers/metadata/read.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

import os
import sys
import json
Expand Down
3 changes: 3 additions & 0 deletions backend/backend/handlers/metadata/test_metadata.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

import os
import unittest
import urllib3
Expand Down
3 changes: 3 additions & 0 deletions backend/backend/handlers/metadata/update.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

from .create import lambda_handler

2 changes: 2 additions & 0 deletions backend/backend/handlers/pipelines/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
2 changes: 2 additions & 0 deletions backend/backend/handlers/workflows/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
3 changes: 3 additions & 0 deletions backend/backend/logging/logger.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

from aws_lambda_powertools import Logger
from aws_lambda_powertools.logging.formatter import LambdaPowertoolsFormatter

Expand Down
2 changes: 2 additions & 0 deletions backend/backend/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
3 changes: 3 additions & 0 deletions backend/backend/models/assets.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

import json
from typing import Dict, List, Optional
from pydantic import BaseModel, Json
Expand Down
3 changes: 3 additions & 0 deletions backend/backend/models/common.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

import json
from typing import Any, Dict, TypedDict

Expand Down
2 changes: 2 additions & 0 deletions backend/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
2 changes: 2 additions & 0 deletions backend/tests/functions/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
2 changes: 2 additions & 0 deletions backend/tests/functions/assets/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

import json
from unittest.mock import patch
from backend.functions.assets.upload_asset_workflow.request_handler import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

from backend.functions.assets.upload_asset_workflow.request_handler import (
UploadAssetWorkflowRequestHandler
)
Expand Down
2 changes: 2 additions & 0 deletions backend/tests/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
2 changes: 2 additions & 0 deletions backend/tests/models/assets/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
3 changes: 3 additions & 0 deletions backend/tests/models/assets/test_common.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

from backend.models.assets import (
AssetPreviewLocationModel,
ExecuteWorkflowModel,
Expand Down
3 changes: 3 additions & 0 deletions infra/lib/code_build/build_scripts/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

3 changes: 3 additions & 0 deletions infra/lib/data/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

5 changes: 5 additions & 0 deletions infra/lib/lambdaBuilder/metadataFunctions.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

import * as lambda from "aws-cdk-lib/aws-lambda";
import * as cdk from "aws-cdk-lib";
import * as path from "path";
Expand Down
5 changes: 5 additions & 0 deletions infra/lib/security.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

import * as iam from "aws-cdk-lib/aws-iam";
import * as s3 from "aws-cdk-lib/aws-s3";

Expand Down
5 changes: 5 additions & 0 deletions infra/lib/uploadAssetWorkflowBuilder.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

import { Construct } from "constructs";
import * as lambda from "aws-cdk-lib/aws-lambda";
import * as sfn from "aws-cdk-lib/aws-stepfunctions";
Expand Down
5 changes: 5 additions & 0 deletions web/src/components/single/Metadata.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

import React, { useEffect, useState } from "react";
import { API } from "aws-amplify";
import { Box, Button, Header, Table, Input } from "@cloudscape-design/components";
Expand Down

0 comments on commit dff7d76

Please sign in to comment.