Skip to content

Commit

Permalink
feat(branch-keystore): model AWS KMS configuration
Browse files Browse the repository at this point in the history
* feat(keystore): create class to model AWS KMS configuration for branch keystore

* updated spec submodule to latest master

* Update spec submodule to track master branch

* feat(keystore): complete and test AWS KMS configuration class

* chore: remove version file from branch-keystore-node module

* chore: updated gitignore to ignore auto-generated version files in branch-keystore-node module

* chore: removed changelog from branch-keystore-node module so that git can autogenerate it

* added additional test for 100% coverage

fix(CI): bump up lerna from 7.3.0 to 8.1.6 (#615)

* bump up lerna

* Revert "bump up lerna"

This reverts commit 6b3853ea7e184f485c30d45c50c18ba2d1c7e1d9.

* Revert "feat(branch-keystore): model AWS KMS configuration"

This reverts commit fa8eabcb46290fdd1dbc99baf8ee1a3d2facdc25.

* Reapply "feat(branch-keystore): model AWS KMS configuration"

This reverts commit 96e8b3085530a67fa46fab653e173eb1db01a7e9.

* bump lerna up from 7.3.0 to 8.1.6

* add dependencies to ensure proper build

* npm audit fix

* fix test compliance issues

fix(branch-keystore): modify AWS KMS configuration to only support single region key compatibility for now (#608)

* feat(branch-keystore): model AWS KMS configuration

* feat(keystore): create class to model AWS KMS configuration for branch keystore

* updated spec submodule to latest master

* Update spec submodule to track master branch

* feat(keystore): complete and test AWS KMS configuration class

* chore: remove version file from branch-keystore-node module

* chore: updated gitignore to ignore auto-generated version files in branch-keystore-node module

* chore: removed changelog from branch-keystore-node module so that git can autogenerate it

* added additional test for 100% coverage

* made the fix and tested

* remove duplicate compliance citations

* specified compliance tests

* fix compliance tests

* fix duvet

* remove duvet test annotations

* add compliance tests for duvet

* fix compliance tests for duvet

* fix compliance tests for duvet

* change lerna version

* removed getParsedArn

* separate kms config helpers from types

* specified what's a 'bad arn' in tests

* better error msg

* no longer supressing errors from parseAwsKmsKeyArn

* changed tests to assert for specific error messages

* add a notice

* sync lock file with package.json

* consolidate helpers

* compliance test citation

* add additional flag methods to tell us config state

* divide helper function tests and class method tests

* add notice

* Revert "change lerna version"

This reverts commit a9ba112605c76295fb23cfda651f37eff9332e7b.

* Update package-lock.json

feat(cryptographic-materials-cache): add support for branch key materials (#596)

* support branch key materials

support branch key materials

reinstall uuidv4

* reinstall uuidv4 within specific modules

* install util package

* uninstall uuidv4 package from code that may run in browser runtimes

* generate uuid v4's using uuid package instead of uuidv4

* manually validate uuid v4's

* install uuid package

* remove uuidv4 regex validation

* remove version lowercasing

* add tests for v3 & v5

feat(hierarchical-keyring): Uuidv4 byte compression (#626)

* wrote code and added tests from MPL

* explain the ranges

add plain interface (#595)

feat(hierarchical-keyring): add branch keystore (#620)

* chore: update package-lock.json (#1425)

run `npm audit fix`

* feat(branch-keystore): model AWS KMS configuration

* feat(keystore): create class to model AWS KMS configuration for branch keystore

* updated spec submodule to latest master

* Update spec submodule to track master branch

* feat(keystore): complete and test AWS KMS configuration class

* chore: remove version file from branch-keystore-node module

* chore: updated gitignore to ignore auto-generated version files in branch-keystore-node module

* chore: removed changelog from branch-keystore-node module so that git can autogenerate it

* added additional test for 100% coverage

* fix(CI): bump up lerna from 7.3.0 to 8.1.6 (#615)

* bump up lerna

* Revert "bump up lerna"

This reverts commit 6b3853ea7e184f485c30d45c50c18ba2d1c7e1d9.

* Revert "feat(branch-keystore): model AWS KMS configuration"

This reverts commit fa8eabcb46290fdd1dbc99baf8ee1a3d2facdc25.

* Reapply "feat(branch-keystore): model AWS KMS configuration"

This reverts commit 96e8b3085530a67fa46fab653e173eb1db01a7e9.

* bump lerna up from 7.3.0 to 8.1.6

* add dependencies to ensure proper build

* npm audit fix

* fix test compliance issues

* fix(branch-keystore): modify AWS KMS configuration to only support single region key compatibility for now (#608)

* feat(branch-keystore): model AWS KMS configuration

* feat(keystore): create class to model AWS KMS configuration for branch keystore

* updated spec submodule to latest master

* Update spec submodule to track master branch

* feat(keystore): complete and test AWS KMS configuration class

* chore: remove version file from branch-keystore-node module

* chore: updated gitignore to ignore auto-generated version files in branch-keystore-node module

* chore: removed changelog from branch-keystore-node module so that git can autogenerate it

* added additional test for 100% coverage

* made the fix and tested

* remove duplicate compliance citations

* specified compliance tests

* fix compliance tests

* fix duvet

* remove duvet test annotations

* add compliance tests for duvet

* fix compliance tests for duvet

* fix compliance tests for duvet

* change lerna version

* removed getParsedArn

* separate kms config helpers from types

* specified what's a 'bad arn' in tests

* better error msg

* no longer supressing errors from parseAwsKmsKeyArn

* changed tests to assert for specific error messages

* add a notice

* sync lock file with package.json

* consolidate helpers

* compliance test citation

* add additional flag methods to tell us config state

* divide helper function tests and class method tests

* add notice

* Revert "change lerna version"

This reverts commit a9ba112605c76295fb23cfda651f37eff9332e7b.

* Update package-lock.json

* Noop commit

* wrote keystore

* modify tests

* modifying tests

* add constructor tests

* use material management module's branch key material class

* more testing

* create fixtures file to consolidate all test constants

* rename

* more tests and duvet

* add copyright notice

* fix test

* fix test

* change interface name

* change param type to interface

* change method signature

* change return types because this is a node package

* indicate integration tests

* add mock network calls todo

* better error message for getBranchKeyItem helper

* more concise

* leave grant tokens empty

* modify mock todo

* consolidate constants into one file

* add notice

* remove tests involving multi region keys

* moved non-resource info out of fixtures

* reinstall dependencies

* sync lockfile after rebase

* assume SRK

* changes

* rename keystore interface

---------

Co-authored-by: seebees <[email protected]>

feat(hierarchical-keyring): KDF in counter mode with pseudorandom function (#609)

* kdf

* sync lockfile

* nonce is required

* improve Uint32ToSeq function

* use pre-existing uint32 to big endian byte array

* rename kdf.ts to kdfctr.ts

* change macLengthBytes to h as in SP800-108

* change # iterations formula

* removed dead code

* made nonce optional and added a test

* simplify calculation

* remove repeated precondition

Since kdfCtrMode will be exported from this module, its preconditions are also rawDerive's preconditions

* better spacing

* match test file name with src file name

* optional nonce test

* explain why offset is not a param

* correct # iters

* modify preconditions

* chore: update package-lock.json (#1425)

run `npm audit fix`

* chore(CI): Add CodeBuild GHA Runner (#603)

* feat(branch-keystore): model AWS KMS configuration

* feat(keystore): create class to model AWS KMS configuration for branch keystore

* updated spec submodule to latest master

* Update spec submodule to track master branch

* feat(keystore): complete and test AWS KMS configuration class

* chore: remove version file from branch-keystore-node module

* chore: updated gitignore to ignore auto-generated version files in branch-keystore-node module

* chore: removed changelog from branch-keystore-node module so that git can autogenerate it

* added additional test for 100% coverage

* fix(CI): bump up lerna from 7.3.0 to 8.1.6 (#615)

* bump up lerna

* Revert "bump up lerna"

This reverts commit 6b3853ea7e184f485c30d45c50c18ba2d1c7e1d9.

* Revert "feat(branch-keystore): model AWS KMS configuration"

This reverts commit fa8eabcb46290fdd1dbc99baf8ee1a3d2facdc25.

* Reapply "feat(branch-keystore): model AWS KMS configuration"

This reverts commit 96e8b3085530a67fa46fab653e173eb1db01a7e9.

* bump lerna up from 7.3.0 to 8.1.6

* add dependencies to ensure proper build

* npm audit fix

* fix test compliance issues

* fix(branch-keystore): modify AWS KMS configuration to only support single region key compatibility for now (#608)

* feat(branch-keystore): model AWS KMS configuration

* feat(keystore): create class to model AWS KMS configuration for branch keystore

* updated spec submodule to latest master

* Update spec submodule to track master branch

* feat(keystore): complete and test AWS KMS configuration class

* chore: remove version file from branch-keystore-node module

* chore: updated gitignore to ignore auto-generated version files in branch-keystore-node module

* chore: removed changelog from branch-keystore-node module so that git can autogenerate it

* added additional test for 100% coverage

* made the fix and tested

* remove duplicate compliance citations

* specified compliance tests

* fix compliance tests

* fix duvet

* remove duvet test annotations

* add compliance tests for duvet

* fix compliance tests for duvet

* fix compliance tests for duvet

* change lerna version

* removed getParsedArn

* separate kms config helpers from types

* specified what's a 'bad arn' in tests

* better error msg

* no longer supressing errors from parseAwsKmsKeyArn

* changed tests to assert for specific error messages

* add a notice

* sync lock file with package.json

* consolidate helpers

* compliance test citation

* add additional flag methods to tell us config state

* divide helper function tests and class method tests

* add notice

* Revert "change lerna version"

This reverts commit a9ba112605c76295fb23cfda651f37eff9332e7b.

* Update package-lock.json

* feat(cryptographic-materials-cache): add support for branch key materials (#596)

* support branch key materials

support branch key materials

reinstall uuidv4

* reinstall uuidv4 within specific modules

* install util package

* uninstall uuidv4 package from code that may run in browser runtimes

* generate uuid v4's using uuid package instead of uuidv4

* manually validate uuid v4's

* install uuid package

* remove uuidv4 regex validation

* remove version lowercasing

* add tests for v3 & v5

* kdf

* sync lockfile

* nonce is required

* improve Uint32ToSeq function

* use pre-existing uint32 to big endian byte array

* rename kdf.ts to kdfctr.ts

* change macLengthBytes to h as in SP800-108

* change # iterations formula

* removed dead code

* made nonce optional and added a test

* simplify calculation

* remove repeated precondition

Since kdfCtrMode will be exported from this module, its preconditions are also rawDerive's preconditions

* better spacing

* match test file name with src file name

* optional nonce test

* explain why offset is not a param

* correct # iters

* modify preconditions

* sync lock file

* chore: update package-lock.json (#1425)

run `npm audit fix`

* feat(branch-keystore): model AWS KMS configuration

* feat(keystore): create class to model AWS KMS configuration for branch keystore

* updated spec submodule to latest master

* Update spec submodule to track master branch

* feat(keystore): complete and test AWS KMS configuration class

* chore: remove version file from branch-keystore-node module

* chore: updated gitignore to ignore auto-generated version files in branch-keystore-node module

* chore: removed changelog from branch-keystore-node module so that git can autogenerate it

* added additional test for 100% coverage

* fix(CI): bump up lerna from 7.3.0 to 8.1.6 (#615)

* bump up lerna

* Revert "bump up lerna"

This reverts commit 6b3853ea7e184f485c30d45c50c18ba2d1c7e1d9.

* Revert "feat(branch-keystore): model AWS KMS configuration"

This reverts commit fa8eabcb46290fdd1dbc99baf8ee1a3d2facdc25.

* Reapply "feat(branch-keystore): model AWS KMS configuration"

This reverts commit 96e8b3085530a67fa46fab653e173eb1db01a7e9.

* bump lerna up from 7.3.0 to 8.1.6

* add dependencies to ensure proper build

* npm audit fix

* fix test compliance issues

* fix(branch-keystore): modify AWS KMS configuration to only support single region key compatibility for now (#608)

* feat(branch-keystore): model AWS KMS configuration

* feat(keystore): create class to model AWS KMS configuration for branch keystore

* updated spec submodule to latest master

* Update spec submodule to track master branch

* feat(keystore): complete and test AWS KMS configuration class

* chore: remove version file from branch-keystore-node module

* chore: updated gitignore to ignore auto-generated version files in branch-keystore-node module

* chore: removed changelog from branch-keystore-node module so that git can autogenerate it

* added additional test for 100% coverage

* made the fix and tested

* remove duplicate compliance citations

* specified compliance tests

* fix compliance tests

* fix duvet

* remove duvet test annotations

* add compliance tests for duvet

* fix compliance tests for duvet

* fix compliance tests for duvet

* change lerna version

* removed getParsedArn

* separate kms config helpers from types

* specified what's a 'bad arn' in tests

* better error msg

* no longer supressing errors from parseAwsKmsKeyArn

* changed tests to assert for specific error messages

* add a notice

* sync lock file with package.json

* consolidate helpers

* compliance test citation

* add additional flag methods to tell us config state

* divide helper function tests and class method tests

* add notice

* Revert "change lerna version"

This reverts commit a9ba112605c76295fb23cfda651f37eff9332e7b.

* Update package-lock.json

* feat(cryptographic-materials-cache): add support for branch key materials (#596)

* support branch key materials

support branch key materials

reinstall uuidv4

* reinstall uuidv4 within specific modules

* install util package

* uninstall uuidv4 package from code that may run in browser runtimes

* generate uuid v4's using uuid package instead of uuidv4

* manually validate uuid v4's

* install uuid package

* remove uuidv4 regex validation

* remove version lowercasing

* add tests for v3 & v5

* kdf

* sync lockfile

* nonce is required

* improve Uint32ToSeq function

* use pre-existing uint32 to big endian byte array

* rename kdf.ts to kdfctr.ts

* change macLengthBytes to h as in SP800-108

* change # iterations formula

* removed dead code

* made nonce optional and added a test

* simplify calculation

* remove repeated precondition

Since kdfCtrMode will be exported from this module, its preconditions are also rawDerive's preconditions

* better spacing

* match test file name with src file name

* optional nonce test

* explain why offset is not a param

* correct # iters

* modify preconditions

* sync lock file

* kdf

* sync lockfile

* nonce is required

* improve Uint32ToSeq function

* use pre-existing uint32 to big endian byte array

* rename kdf.ts to kdfctr.ts

* made nonce optional and added a test

* remove repeated precondition

Since kdfCtrMode will be exported from this module, its preconditions are also rawDerive's preconditions

* match test file name with src file name

* sync lock file after rebase

* chain the calls

* chore: update package-lock.json (#1425)

run `npm audit fix`

* feat(branch-keystore): model AWS KMS configuration

* feat(keystore): create class to model AWS KMS configuration for branch keystore

* updated spec submodule to latest master

* Update spec submodule to track master branch

* feat(keystore): complete and test AWS KMS configuration class

* chore: remove version file from branch-keystore-node module

* chore: updated gitignore to ignore auto-generated version files in branch-keystore-node module

* chore: removed changelog from branch-keystore-node module so that git can autogenerate it

* added additional test for 100% coverage

* fix(CI): bump up lerna from 7.3.0 to 8.1.6 (#615)

* bump up lerna

* Revert "bump up lerna"

This reverts commit 6b3853ea7e184f485c30d45c50c18ba2d1c7e1d9.

* Revert "feat(branch-keystore): model AWS KMS configuration"

This reverts commit fa8eabcb46290fdd1dbc99baf8ee1a3d2facdc25.

* Reapply "feat(branch-keystore): model AWS KMS configuration"

This reverts commit 96e8b3085530a67fa46fab653e173eb1db01a7e9.

* bump lerna up from 7.3.0 to 8.1.6

* add dependencies to ensure proper build

* npm audit fix

* fix test compliance issues

* fix(branch-keystore): modify AWS KMS configuration to only support single region key compatibility for now (#608)

* feat(branch-keystore): model AWS KMS configuration

* feat(keystore): create class to model AWS KMS configuration for branch keystore

* updated spec submodule to latest master

* Update spec submodule to track master branch

* feat(keystore): complete and test AWS KMS configuration class

* chore: remove version file from branch-keystore-node module

* chore: updated gitignore to ignore auto-generated version files in branch-keystore-node module

* chore: removed changelog from branch-keystore-node module so that git can autogenerate it

* added additional test for 100% coverage

* made the fix and tested

* remove duplicate compliance citations

* specified compliance tests

* fix compliance tests

* fix duvet

* remove duvet test annotations

* add compliance tests for duvet

* fix compliance tests for duvet

* fix compliance tests for duvet

* change lerna version

* removed getParsedArn

* separate kms config helpers from types

* specified what's a 'bad arn' in tests

* better error msg

* no longer supressing errors from parseAwsKmsKeyArn

* changed tests to assert for specific error messages

* add a notice

* sync lock file with package.json

* consolidate helpers

* compliance test citation

* add additional flag methods to tell us config state

* divide helper function tests and class method tests

* add notice

* Revert "change lerna version"

This reverts commit a9ba112605c76295fb23cfda651f37eff9332e7b.

* Update package-lock.json

* feat(cryptographic-materials-cache): add support for branch key materials (#596)

* support branch key materials

support branch key materials

reinstall uuidv4

* reinstall uuidv4 within specific modules

* install util package

* uninstall uuidv4 package from code that may run in browser runtimes

* generate uuid v4's using uuid package instead of uuidv4

* manually validate uuid v4's

* install uuid package

* remove uuidv4 regex validation

* remove version lowercasing

* add tests for v3 & v5

* kdf

* sync lockfile

* nonce is required

* improve Uint32ToSeq function

* use pre-existing uint32 to big endian byte array

* rename kdf.ts to kdfctr.ts

* change macLengthBytes to h as in SP800-108

* change # iterations formula

* removed dead code

* made nonce optional and added a test

* simplify calculation

* remove repeated precondition

Since kdfCtrMode will be exported from this module, its preconditions are also rawDerive's preconditions

* better spacing

* match test file name with src file name

* optional nonce test

* explain why offset is not a param

* correct # iters

* modify preconditions

* sync lock file

* kdf

* sync lockfile

* nonce is required

* improve Uint32ToSeq function

* use pre-existing uint32 to big endian byte array

* rename kdf.ts to kdfctr.ts

* made nonce optional and added a test

* remove repeated precondition

Since kdfCtrMode will be exported from this module, its preconditions are also rawDerive's preconditions

* match test file name with src file name

* sync lock file after rebase

* chore: update package-lock.json (#1425)

run `npm audit fix`

* feat(branch-keystore): model AWS KMS configuration

* feat(keystore): create class to model AWS KMS configuration for branch keystore

* updated spec submodule to latest master

* Update spec submodule to track master branch

* feat(keystore): complete and test AWS KMS configuration class

* chore: remove version file from branch-keystore-node module

* chore: updated gitignore to ignore auto-generated version files in branch-keystore-node module

* chore: removed changelog from branch-keystore-node module so that git can autogenerate it

* added additional test for 100% coverage

* fix(CI): bump up lerna from 7.3.0 to 8.1.6 (#615)

* bump up lerna

* Revert "bump up lerna"

This reverts commit 6b3853ea7e184f485c30d45c50c18ba2d1c7e1d9.

* Revert "feat(branch-keystore): model AWS KMS configuration"

This reverts commit fa8eabcb46290fdd1dbc99baf8ee1a3d2facdc25.

* Reapply "feat(branch-keystore): model AWS KMS configuration"

This reverts commit 96e8b3085530a67fa46fab653e173eb1db01a7e9.

* bump lerna up from 7.3.0 to 8.1.6

* add dependencies to ensure proper build

* npm audit fix

* fix test compliance issues

* fix(branch-keystore): modify AWS KMS configuration to only support single region key compatibility for now (#608)

* feat(branch-keystore): model AWS KMS configuration

* feat(keystore): create class to model AWS KMS configuration for branch keystore

* updated spec submodule to latest master

* Update spec submodule to track master branch

* feat(keystore): complete and test AWS KMS configuration class

* chore: remove version file from branch-keystore-node module

* chore: updated gitignore to ignore auto-generated version files in branch-keystore-node module

* chore: removed changelog from branch-keystore-node module so that git can autogenerate it

* added additional test for 100% coverage

* made the fix and tested

* remove duplicate compliance citations

* specified compliance tests

* fix compliance tests

* fix duvet

* remove duvet test annotations

* add compliance tests for duvet

* fix compliance tests for duvet

* fix compliance tests for duvet

* change lerna version

* removed getParsedArn

* separate kms config helpers from types

* specified what's a 'bad arn' in tests

* better error msg

* no longer supressing errors from parseAwsKmsKeyArn

* changed tests to assert for specific error messages

* add a notice

* sync lock file with package.json

* consolidate helpers

* compliance test citation

* add additional flag methods to tell us config state

* divide helper function tests and class method tests

* add notice

* Revert "change lerna version"

This reverts commit a9ba112605c76295fb23cfda651f37eff9332e7b.

* Update package-lock.json

* feat(cryptographic-materials-cache): add support for branch key materials (#596)

* support branch key materials

support branch key materials

reinstall uuidv4

* reinstall uuidv4 within specific modules

* install util package

* uninstall uuidv4 package from code that may run in browser runtimes

* generate uuid v4's using uuid package instead of uuidv4

* manually validate uuid v4's

* install uuid package

* remove uuidv4 regex validation

* remove version lowercasing

* add tests for v3 & v5

* kdf

* sync lockfile

* nonce is required

* improve Uint32ToSeq function

* use pre-existing uint32 to big endian byte array

* rename kdf.ts to kdfctr.ts

* made nonce optional and added a test

* remove repeated precondition

Since kdfCtrMode will be exported from this module, its preconditions are also rawDerive's preconditions

* match test file name with src file name

* sync lock file

* kdf

* sync lockfile

* nonce is required

* improve Uint32ToSeq function

* use pre-existing uint32 to big endian byte array

* rename kdf.ts to kdfctr.ts

* made nonce optional and added a test

* remove repeated precondition

Since kdfCtrMode will be exported from this module, its preconditions are also rawDerive's preconditions

* match test file name with src file name

* chain the calls

* sync lockfile after rebase

---------

Co-authored-by: seebees <[email protected]>
Co-authored-by: José Corella <[email protected]>

fix(keystore): Fix kms config (#627)

* change kms config

remove flag methods

remove assertValidNotAliasArn function

* less arn parsing util exports needed

type checks to class constructors and methods (#637)

* type checks to class constructors and methods

* modify grant token initialization

feat(kms-keyring-node): add AWS KMS Hierarchical keyring (#632)

* hkr

* remove timeouts

* fix test timeout issues

* add an additional verification check

* set up mocking

* document mock mechanism

* hkr

* remove timeouts

* fix test timeout issues

* add an additional verification check

* set up mocking

* document mock mechanism

* added runtime type checks to constructor

* try fixing dep errors

* fixes

* add notice

* renaming and modified preconditions

Number attributes like TTL and max cache size can only be stored with precision if they are under JavaScript's Number.MAX_SAFE_INTEGER.

In the MPL, TTL can be a non-negative signed 64-bit integer. However, JavaScript numbers cannot safely store integers beyond Number.MAX_SAFE_INTEGER. Thus, we will cap TTL in seconds such that TTL in ms is <= Number.MAX_SAFE_INTEGER. TTL could be a JS BigInt type but this would require casting back to a number in order to configure the CMC (which only deals with number types not BigInt), which leads to a lossy conversion. This same reasoning is applied to max cache size. Preconditions and tests for these preconditions are updated.

* change in wrapping AAD logic

* Update modules/kms-keyring-node/src/constants.ts

add comment about encrypted key length in the ciphertext

Co-authored-by: Rishav karanjit <[email protected]>

* update constants

change name of the kdf digest algorithm constant to specify sha256. Increases readability

* update constants

change provider id constant name to specify hierarchy

---------

Co-authored-by: Rishav karanjit <[email protected]>

hkr

remove timeouts

fix test timeout issues

add an additional verification check

set up mocking

document mock mechanism

added runtime type checks to constructor

hkr

remove timeouts

fix test timeout issues

add an additional verification check

set up mocking

document mock mechanism

fixes

add notice

renaming and modified preconditions

Number attributes like TTL and max cache size can only be stored with precision if they are under JavaScript's Number.MAX_SAFE_INTEGER.

In the MPL, TTL can be a non-negative signed 64-bit integer. However, JavaScript numbers cannot safely store integers beyond Number.MAX_SAFE_INTEGER. Thus, we will cap TTL in seconds such that TTL in ms is <= Number.MAX_SAFE_INTEGER. TTL could be a JS BigInt type but this would require casting back to a number in order to configure the CMC (which only deals with number types not BigInt), which leads to a lossy conversion. This same reasoning is applied to max cache size. Preconditions and tests for these preconditions are updated.

change in wrapping AAD logic

update constants

change name of the kdf digest algorithm constant to specify sha256. Increases readability

update constants

change provider id constant name to specify hierarchy

create example file

wrote code

add notice and sync lockfile

fix lint issue

document the example

more examples

change class name

add a comment about example branch key id supplier impl

demo code and readme

comment the demo code

update duvet anotations

first cut add storage

Updates to H-Keyring

Update tests

all tests pass and all features “work”

adding duvet anotations

More duvet updates

update the anotations

Add discovery

More citations

Add expiration

Update the spec version

Updates

add uuid to serialize

update package lock

update this one
  • Loading branch information
seebees committed Dec 13, 2024
1 parent 88b919c commit 235c28b
Show file tree
Hide file tree
Showing 82 changed files with 10,625 additions and 30 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,4 @@ package.json.decrypt
# they track the package.json version
/modules/kms-keyring-browser/src/version.ts
/modules/kms-keyring-node/src/version.ts
/modules/branch-keystore-node/src/version.ts
1 change: 1 addition & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
[submodule "aws-encryption-sdk-specification"]
path = aws-encryption-sdk-specification
url = https://github.com/awslabs/aws-encryption-sdk-specification.git
branch = master
2 changes: 1 addition & 1 deletion aws-encryption-sdk-specification
12 changes: 12 additions & 0 deletions modules/branch-keystore-node/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

module.exports = {
parserOptions: {
// There is an issue with @typescript-eslint/parser performance.
// It scales with the number of projects
// see https://github.com/typescript-eslint/typescript-eslint/issues/1192#issuecomment-596741806
project: '../../tsconfig.lint.json',
tsconfigRootDir: __dirname,
}
}
3 changes: 3 additions & 0 deletions modules/branch-keystore-node/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/node_modules/
/build/
/.nyc_output
202 changes: 202 additions & 0 deletions modules/branch-keystore-node/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@

Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1. Definitions.

"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.

"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.

"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.

"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.

"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.

"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.

"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).

"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.

"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."

"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.

2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.

3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.

4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:

(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and

(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and

(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and

(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.

You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.

5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.

6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.

7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.

8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.

9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS

APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2019 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.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License 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.
2 changes: 2 additions & 0 deletions modules/branch-keystore-node/NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
AWS Encryption SDK for Javascript
Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
31 changes: 31 additions & 0 deletions modules/branch-keystore-node/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# aws-encryption-sdk-javascript

The AWS Encryption SDK for JavaScript is a client-side encryption library
designed to make it easy for everyone to encrypt
and decrypt data using industry standards and best practices.
It uses a data format compatible with the AWS Encryption SDKs in other languages.
For more information on the AWS Encryption SDKs in all languages,
see the [Developer Guide](https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/introduction.html).

This package should only be used as part of the AWS Encryption SDK for Javascript.
For more information about the packages in this project
and how they can be used together,
see the [main node package readme](https://github.com/aws/aws-encryption-sdk-javascript/blob/master/modules/client-node/Readme.md)

## Installing

```sh
npm install @aws-crypto/branch-keystore-node
```

## Testing

```sh
npm test
```

## License

This SDK is distributed under the
[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0),
see LICENSE.txt and NOTICE.txt for more information.
34 changes: 34 additions & 0 deletions modules/branch-keystore-node/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "@aws-crypto/branch-keystore-node",
"version": "4.0.0",
"scripts": {
"prepublishOnly": "npm run generate-version.ts; npm run build",
"generate-version.ts": "npx genversion --es6 src/version.ts",
"build": "tsc -b tsconfig.json && tsc -b tsconfig.module.json",
"lint": "run-s lint-*",
"lint-eslint": "eslint src/*.ts test/**/*.ts",
"lint-prettier": "prettier -c src/*.ts test/**/*.ts",
"mocha": "mocha --require ts-node/register test/**/*test.ts",
"test": "npm run lint && npm run coverage",
"coverage": "nyc -e .ts npm run mocha"
},
"author": {
"name": "AWS Crypto Tools Team",
"email": "[email protected]",
"url": "https://github.com/aws/aws-encryption-sdk-javascript"
},
"license": "Apache-2.0",
"dependencies": {
"@aws-crypto/kms-keyring": "file:../kms-keyring",
"@aws-sdk/client-dynamodb": "^3.616.0",
"@aws-sdk/util-dynamodb": "^3.616.0",
"tslib": "^2.2.0"
},
"sideEffects": false,
"main": "./build/main/src/index.js",
"module": "./build/module/src/index.js",
"types": "./build/main/src/index.d.ts",
"files": [
"build/**/src/*"
]
}
Loading

0 comments on commit 235c28b

Please sign in to comment.