@aws-crypto/cache-material
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -1,7 +0,3 @@ | ||
import { SupportedAlgorithmSuites, // eslint-disable-line no-unused-vars | ||
DecryptionRequest, // eslint-disable-line no-unused-vars | ||
EncryptionRequest, // eslint-disable-line no-unused-vars | ||
EncryptedDataKey, // eslint-disable-line no-unused-vars | ||
EncryptionContext } from '@aws-crypto/material-management'; | ||
export declare function buildCryptographicMaterialsCacheKeyHelpers<S extends SupportedAlgorithmSuites>(fromUtf8: (input: string) => Uint8Array, toUtf8: (input: Uint8Array) => string, sha512: (...data: ((Uint8Array | string))[]) => Promise<Uint8Array>): CryptographicMaterialsCacheKeyHelpersInterface<S>; | ||
import { SupportedAlgorithmSuites, DecryptionRequest, EncryptionRequest, EncryptedDataKey, EncryptionContext } from '@aws-crypto/material-management'; | ||
export declare function buildCryptographicMaterialsCacheKeyHelpers<S extends SupportedAlgorithmSuites>(fromUtf8: (input: string) => Uint8Array, toUtf8: (input: Uint8Array) => string, sha512: (...data: (Uint8Array | string)[]) => Promise<Uint8Array>): CryptographicMaterialsCacheKeyHelpersInterface<S>; | ||
export interface CryptographicMaterialsCacheKeyHelpersInterface<S extends SupportedAlgorithmSuites> { | ||
@@ -8,0 +4,0 @@ buildEncryptionMaterialCacheKey(partition: string, { suite, encryptionContext }: EncryptionRequest<S>): Promise<string>; |
"use strict"; | ||
/* | ||
* 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. 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 | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -22,3 +10,3 @@ const serialize_1 = require("@aws-crypto/serialize"); | ||
function buildCryptographicMaterialsCacheKeyHelpers(fromUtf8, toUtf8, sha512) { | ||
const { serializeEncryptionContext, serializeEncryptedDataKey } = serialize_1.serializeFactory(fromUtf8); | ||
const { serializeEncryptionContext, serializeEncryptedDataKey, } = serialize_1.serializeFactory(fromUtf8); | ||
return { | ||
@@ -28,3 +16,3 @@ buildEncryptionMaterialCacheKey, | ||
encryptedDataKeysHash, | ||
encryptionContextHash | ||
encryptionContextHash, | ||
}; | ||
@@ -46,6 +34,6 @@ async function buildEncryptionMaterialCacheKey(partition, { suite, encryptionContext }) { | ||
.map(serializeEncryptedDataKey) | ||
.map(edk => sha512(edk))); | ||
.map(async (edk) => sha512(edk))); | ||
return hashes.sort(portable_compare_1.compare); | ||
} | ||
function encryptionContextHash(context) { | ||
async function encryptionContextHash(context) { | ||
/* The AAD section is uInt16BE(length) + AAD | ||
@@ -61,2 +49,2 @@ * see: https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/message-format.html#header-aad | ||
exports.buildCryptographicMaterialsCacheKeyHelpers = buildCryptographicMaterialsCacheKeyHelpers; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVpbGRfY3J5cHRvZ3JhcGhpY19tYXRlcmlhbHNfY2FjaGVfa2V5X2hlbHBlcnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvYnVpbGRfY3J5cHRvZ3JhcGhpY19tYXRlcmlhbHNfY2FjaGVfa2V5X2hlbHBlcnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBOzs7Ozs7Ozs7Ozs7O0dBYUc7O0FBU0gscURBQWtFO0FBQ2xFLHlEQUE0QztBQUU1Qyx5RkFBeUY7QUFDekYsTUFBTSxXQUFXLEdBQUcsTUFBTSxDQU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EI7UUFDN0Q7Ozs7V0FJRztRQUNILE1BQU0saUJBQWlCLEdBQUcsMEJBQTBCLENBQUMsT0FBTyxDQUFDLENBQUMsS0FBSyxDQUFDLENBQUMsQ0FBQyxDQUFBO1FBQ3RFLE9BQU8sTUFBTSxDQUFDLGlCQUFpQixDQUFDLENBQUE7SUFDbEMsQ0FBQztBQUNILENBQUM7QUF2RUQsZ0dBdUVDIn0= |
@@ -1,11 +0,7 @@ | ||
import { GetEncryptionMaterials, // eslint-disable-line no-unused-vars | ||
GetDecryptMaterials, // eslint-disable-line no-unused-vars | ||
SupportedAlgorithmSuites, // eslint-disable-line no-unused-vars | ||
MaterialsManager, Keyring } from '@aws-crypto/material-management'; | ||
import { CryptographicMaterialsCache, // eslint-disable-line no-unused-vars | ||
Entry } from './cryptographic_materials_cache'; | ||
import { GetEncryptionMaterials, GetDecryptMaterials, SupportedAlgorithmSuites, MaterialsManager, Keyring } from '@aws-crypto/material-management'; | ||
import { CryptographicMaterialsCache, Entry } from './cryptographic_materials_cache'; | ||
import { CryptographicMaterialsCacheKeyHelpersInterface } from './build_cryptographic_materials_cache_key_helpers'; | ||
export declare function decorateProperties<S extends SupportedAlgorithmSuites>(obj: CachingMaterialsManager<S>, input: CachingMaterialsManagerDecorateInput<S>): void; | ||
export declare function getEncryptionMaterials<S extends SupportedAlgorithmSuites>({ buildEncryptionMaterialCacheKey }: CryptographicMaterialsCacheKeyHelpersInterface<S>): GetEncryptionMaterials<S>; | ||
export declare function decryptMaterials<S extends SupportedAlgorithmSuites>({ buildDecryptionMaterialCacheKey }: CryptographicMaterialsCacheKeyHelpersInterface<S>): GetDecryptMaterials<S>; | ||
export declare function getEncryptionMaterials<S extends SupportedAlgorithmSuites>({ buildEncryptionMaterialCacheKey, }: CryptographicMaterialsCacheKeyHelpersInterface<S>): GetEncryptionMaterials<S>; | ||
export declare function decryptMaterials<S extends SupportedAlgorithmSuites>({ buildDecryptionMaterialCacheKey, }: CryptographicMaterialsCacheKeyHelpersInterface<S>): GetDecryptMaterials<S>; | ||
export declare function cacheEntryHasExceededLimits<S extends SupportedAlgorithmSuites>(): CacheEntryHasExceededLimits<S>; | ||
@@ -12,0 +8,0 @@ export interface CachingMaterialsManagerInput<S extends SupportedAlgorithmSuites> extends Readonly<{ |
"use strict"; | ||
/* | ||
* 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. 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 | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -20,3 +8,3 @@ const material_management_1 = require("@aws-crypto/material-management"); | ||
function decorateProperties(obj, input) { | ||
const { cache, backingMaterialsManager, maxAge, maxBytesEncrypted, maxMessagesEncrypted, partition } = input; | ||
const { cache, backingMaterialsManager, maxAge, maxBytesEncrypted, maxMessagesEncrypted, partition, } = input; | ||
/* Precondition: A caching material manager needs a cache. */ | ||
@@ -29,5 +17,9 @@ material_management_1.needs(cache, 'You must provide a cache.'); | ||
/* Precondition: maxBytesEncrypted must be inside bounds. i.e. positive and not more than the maximum. */ | ||
material_management_1.needs(!maxBytesEncrypted || (maxBytesEncrypted > 0 && serialize_1.Maximum.BYTES_PER_CACHED_KEY_LIMIT >= maxBytesEncrypted), 'maxBytesEncrypted is outside of bounds.'); | ||
material_management_1.needs(!maxBytesEncrypted || | ||
(maxBytesEncrypted > 0 && | ||
serialize_1.Maximum.BYTES_PER_CACHED_KEY_LIMIT >= maxBytesEncrypted), 'maxBytesEncrypted is outside of bounds.'); | ||
/* Precondition: maxMessagesEncrypted must be inside bounds. i.e. positive and not more than the maximum. */ | ||
material_management_1.needs(!maxMessagesEncrypted || (maxMessagesEncrypted > 0 && serialize_1.Maximum.MESSAGES_PER_CACHED_KEY_LIMIT >= maxMessagesEncrypted), 'maxMessagesEncrypted is outside of bounds.'); | ||
material_management_1.needs(!maxMessagesEncrypted || | ||
(maxMessagesEncrypted > 0 && | ||
serialize_1.Maximum.MESSAGES_PER_CACHED_KEY_LIMIT >= maxMessagesEncrypted), 'maxMessagesEncrypted is outside of bounds.'); | ||
/* Precondition: partition must be a string. */ | ||
@@ -43,12 +35,15 @@ material_management_1.needs(partition && typeof partition === 'string', 'partition must be a string.'); | ||
exports.decorateProperties = decorateProperties; | ||
function getEncryptionMaterials({ buildEncryptionMaterialCacheKey }) { | ||
function getEncryptionMaterials({ buildEncryptionMaterialCacheKey, }) { | ||
return async function getEncryptionMaterials(request) { | ||
const { suite, encryptionContext, plaintextLength } = request; | ||
/* Check for early return (Postcondition): If I can not cache the EncryptionMaterial, do not even look. */ | ||
if ((suite && !suite.cacheSafe) || typeof plaintextLength !== 'number' || plaintextLength < 0) { | ||
return this | ||
._backingMaterialsManager | ||
.getEncryptionMaterials(request); | ||
if ((suite && !suite.cacheSafe) || | ||
typeof plaintextLength !== 'number' || | ||
plaintextLength < 0) { | ||
return this._backingMaterialsManager.getEncryptionMaterials(request); | ||
} | ||
const cacheKey = await buildEncryptionMaterialCacheKey(this._partition, { suite, encryptionContext }); | ||
const cacheKey = await buildEncryptionMaterialCacheKey(this._partition, { | ||
suite, | ||
encryptionContext, | ||
}); | ||
const entry = this._cache.getEncryptionMaterial(cacheKey, plaintextLength); | ||
@@ -62,4 +57,3 @@ /* Check for early return (Postcondition): If I have a valid EncryptionMaterial, return it. */ | ||
} | ||
const material = await this | ||
._backingMaterialsManager | ||
const material = await this._backingMaterialsManager | ||
/* Strip any information about the plaintext from the backing request, | ||
@@ -81,3 +75,3 @@ * because the resulting response may be used to encrypt multiple plaintexts. | ||
messagesEncrypted: 1, | ||
bytesEncrypted: plaintextLength | ||
bytesEncrypted: plaintextLength, | ||
}; | ||
@@ -99,3 +93,3 @@ if (!this._cacheEntryHasExceededLimits(testEntry)) { | ||
exports.getEncryptionMaterials = getEncryptionMaterials; | ||
function decryptMaterials({ buildDecryptionMaterialCacheKey }) { | ||
function decryptMaterials({ buildDecryptionMaterialCacheKey, }) { | ||
return async function decryptMaterials(request) { | ||
@@ -105,5 +99,3 @@ const { suite } = request; | ||
if (!suite.cacheSafe) { | ||
return this | ||
._backingMaterialsManager | ||
.decryptMaterials(request); | ||
return this._backingMaterialsManager.decryptMaterials(request); | ||
} | ||
@@ -119,5 +111,3 @@ const cacheKey = await buildDecryptionMaterialCacheKey(this._partition, request); | ||
} | ||
const material = await this | ||
._backingMaterialsManager | ||
.decryptMaterials(request); | ||
const material = await this._backingMaterialsManager.decryptMaterials(request); | ||
this._cache.putDecryptionMaterial(cacheKey, material, this._maxAge); | ||
@@ -131,5 +121,5 @@ return cloneResponse(material); | ||
const age = Date.now() - now; | ||
return age > this._maxAge || | ||
return (age > this._maxAge || | ||
messagesEncrypted > this._maxMessagesEncrypted || | ||
bytesEncrypted > this._maxBytesEncrypted; | ||
bytesEncrypted > this._maxBytesEncrypted); | ||
}; | ||
@@ -149,2 +139,2 @@ } | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FjaGluZ19jcnlwdG9ncmFwaGljX21hdGVyaWFsc19kZWNvcmF0b3JzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2NhY2hpbmdfY3J5cHRvZ3JhcGhpY19tYXRlcmlhbHNfZGVjb3JhdG9ycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUE7Ozs7Ozs7Ozs7Ozs7R0FhRzs7QUFFSCx5RUFhd0M7QUFDeEMscURBQStDO0FBUy9DLFNBQWdCLGtCQUFrQixDQUNoQ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QixFQUFFLGNBQWMsRUFBWTtRQUVwRCxNQUFNLEdBQUcsR0FBRyxJQUFJLENBQUMsR0FBRyxFQUFFLEdBQUcsR0FBRyxDQUFBO1FBQzVCLE9BQU8sQ0FDTCxHQUFHLEdBQUcsSUFBSSxDQUFDLE9BQU87WUFDbEIsaUJBQWlCLEdBQUcsSUFBSSxDQUFDLHFCQUFxQjtZQUM5QyxjQUFjLEdBQUcsSUFBSSxDQUFDLGtCQUFrQixDQUN6QyxDQUFBO0lBQ0gsQ0FBQyxDQUFBO0FBQ0gsQ0FBQztBQWRELGtFQWNDO0FBRUQ7Ozs7Ozs7R0FPRztBQUNILFNBQVMsYUFBYSxDQUdwQixRQUFXO0lBQ1gsT0FBTyxtQ0FBYSxDQUFDLFFBQVEsQ0FBQyxDQUFBO0FBQ2hDLENBQUMifQ== |
@@ -1,4 +0,2 @@ | ||
import { EncryptionMaterial, // eslint-disable-line no-unused-vars | ||
DecryptionMaterial, // eslint-disable-line no-unused-vars | ||
SupportedAlgorithmSuites } from '@aws-crypto/material-management'; | ||
import { EncryptionMaterial, DecryptionMaterial, SupportedAlgorithmSuites } from '@aws-crypto/material-management'; | ||
export interface CryptographicMaterialsCache<S extends SupportedAlgorithmSuites> { | ||
@@ -5,0 +3,0 @@ putEncryptionMaterial(key: string, response: EncryptionMaterial<S>, plaintextLength: number, maxAge?: number): void; |
"use strict"; | ||
/* | ||
* 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. 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 | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY3J5cHRvZ3JhcGhpY19tYXRlcmlhbHNfY2FjaGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY3J5cHRvZ3JhcGhpY19tYXRlcmlhbHNfY2FjaGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBOzs7Ozs7Ozs7Ozs7O0dBYUcifQ== | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY3J5cHRvZ3JhcGhpY19tYXRlcmlhbHNfY2FjaGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY3J5cHRvZ3JhcGhpY19tYXRlcmlhbHNfY2FjaGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLG9FQUFvRTtBQUNwRSxzQ0FBc0MifQ== |
@@ -1,5 +0,4 @@ | ||
import { // eslint-disable-line no-unused-vars | ||
SupportedAlgorithmSuites } from '@aws-crypto/material-management'; | ||
import { SupportedAlgorithmSuites } from '@aws-crypto/material-management'; | ||
import { CryptographicMaterialsCache } from './cryptographic_materials_cache'; | ||
export declare function getLocalCryptographicMaterialsCache<S extends SupportedAlgorithmSuites>(capacity: number, proactiveFrequency?: number): CryptographicMaterialsCache<S>; | ||
//# sourceMappingURL=get_local_cryptographic_materials_cache.d.ts.map |
"use strict"; | ||
/* | ||
* 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. 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 | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -28,3 +16,3 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
value.response.zeroUnencryptedDataKey(); | ||
} | ||
}, | ||
}); | ||
@@ -57,3 +45,3 @@ (function proactivelyTryAndEvictTail() { | ||
messagesEncrypted: 1, | ||
now: Date.now() | ||
now: Date.now(), | ||
}); | ||
@@ -71,3 +59,3 @@ cache.set(key, entry, maxAge); | ||
messagesEncrypted: 0, | ||
now: Date.now() | ||
now: Date.now(), | ||
}); | ||
@@ -100,3 +88,3 @@ cache.set(key, entry, maxAge); | ||
cache.del(key); | ||
} | ||
}, | ||
}; | ||
@@ -118,2 +106,2 @@ function mayEvictTail() { | ||
exports.getLocalCryptographicMaterialsCache = getLocalCryptographicMaterialsCache; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0X2xvY2FsX2NyeXB0b2dyYXBoaWNfbWF0ZXJpYWxzX2NhY2hlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2dldF9sb2NhbF9jcnlwdG9ncmFwaGljX21hdGVyaWFsc19jYWNoZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUE7Ozs7Ozs7Ozs7Ozs7R0FhRzs7Ozs7QUFFSCwwREFBMkI7QUFDM0IseUVBT3dDO0FBU3hDLFNBQWdCLG1DQUFtQyxDQUNqRCxRQUFnQixFQUNoQixxQkFBNkIsSUFBSSxHQUFHLEVBQUU7SUFFdEMsTUFBTSxLQUFLLEdBQUcsSUFBSSxtQkFBRyxDQUFtQjtRQUN0QyxHQUFHLEVBQUUsUUFBUTtRQUNiLE9BQU8sQ0FBRSxJQ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DO0tBQ0YsQ0FBQTtJQUVELFNBQVMsWUFBWTtRQUNuQixhQUFhO1FBQ2IsTUFBTSxFQUFFLElBQUksRUFBRSxHQUFHLEtBQUssQ0FBQyxPQUFPLEVBQUUsQ0FBQTtRQUNoQyxvR0FBb0c7UUFDcEcsSUFBSSxDQUFDLElBQUk7WUFBRSxPQUFNO1FBQ2pCOztXQUVHO1FBQ0gsTUFBTSxFQUFFLEdBQUcsRUFBRSxHQUFHLElBQUksQ0FBQyxLQUFLLENBQUE7UUFDMUIsdUVBQXVFO1FBQ3ZFLEtBQUssQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLENBQUE7SUFDakIsQ0FBQztBQUNILENBQUM7QUExSEQsa0ZBMEhDIn0= |
"use strict"; | ||
/* | ||
* 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. 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 | ||
function __export(m) { | ||
@@ -23,2 +11,2 @@ for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
__export(require("./get_local_cryptographic_materials_cache")); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBOzs7Ozs7Ozs7Ozs7O0dBYUc7Ozs7O0FBR0gsa0VBQTREO0FBQzVELHVFQUFpRTtBQUNqRSwrREFBeUQifQ== | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLG9FQUFvRTtBQUNwRSxzQ0FBc0M7Ozs7O0FBR3RDLGtFQUE0RDtBQUM1RCx1RUFBaUU7QUFDakUsK0RBQXlEIn0= |
"use strict"; | ||
/* | ||
* 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. 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 | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -23,5 +11,3 @@ /* Node has Buffer.compare, | ||
function compare(a, b) { | ||
const length = a.byteLength > b.byteLength | ||
? b.byteLength | ||
: a.byteLength; | ||
const length = a.byteLength > b.byteLength ? b.byteLength : a.byteLength; | ||
for (let i = 0; length > i; i += 1) { | ||
@@ -40,2 +26,2 @@ if (a[i] > b[i]) | ||
exports.compare = compare; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicG9ydGFibGVfY29tcGFyZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wb3J0YWJsZV9jb21wYXJlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTs7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V0Qzs7OztHQUlHO0FBQ0gsU0FBZ0IsT0FBTyxDQUFDLENBQWEsRUFBRSxDQUFhO0lBQ2xELE1BQU0sTUFBTSxHQUFHLENBQUMsQ0FBQyxVQUFVLEdBQUcsQ0FBQyxDQUFDLFVBQVUsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLFVBQVUsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLFVBQVUsQ0FBQTtJQUV4RSxLQUFLLElBQUksQ0FBQyxHQUFHLENBQUMsRUFBRSxNQUFNLEdBQUcsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLEVBQUU7UUFDbEMsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQztZQUFFLE9BQU8sQ0FBQyxDQUFBO1FBQ3pCLElBQUksQ0FBQyxDQUFDLENBQUMsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUM7WUFBRSxPQUFPLENBQUMsQ0FBQyxDQUFBO0tBQzNCO0lBRUQsSUFBSSxDQUFDLENBQUMsVUFBVSxHQUFHLENBQUMsQ0FBQyxVQUFVO1FBQUUsT0FBTyxDQUFDLENBQUE7SUFDekMsSUFBSSxDQUFDLENBQUMsVUFBVSxHQUFHLENBQUMsQ0FBQyxVQUFVO1FBQUUsT0FBTyxDQUFDLENBQUMsQ0FBQTtJQUUxQyxPQUFPLENBQUMsQ0FBQTtBQUNWLENBQUM7QUFaRCwwQkFZQyJ9 |
@@ -1,7 +0,3 @@ | ||
import { SupportedAlgorithmSuites, // eslint-disable-line no-unused-vars | ||
DecryptionRequest, // eslint-disable-line no-unused-vars | ||
EncryptionRequest, // eslint-disable-line no-unused-vars | ||
EncryptedDataKey, // eslint-disable-line no-unused-vars | ||
EncryptionContext } from '@aws-crypto/material-management'; | ||
export declare function buildCryptographicMaterialsCacheKeyHelpers<S extends SupportedAlgorithmSuites>(fromUtf8: (input: string) => Uint8Array, toUtf8: (input: Uint8Array) => string, sha512: (...data: ((Uint8Array | string))[]) => Promise<Uint8Array>): CryptographicMaterialsCacheKeyHelpersInterface<S>; | ||
import { SupportedAlgorithmSuites, DecryptionRequest, EncryptionRequest, EncryptedDataKey, EncryptionContext } from '@aws-crypto/material-management'; | ||
export declare function buildCryptographicMaterialsCacheKeyHelpers<S extends SupportedAlgorithmSuites>(fromUtf8: (input: string) => Uint8Array, toUtf8: (input: Uint8Array) => string, sha512: (...data: (Uint8Array | string)[]) => Promise<Uint8Array>): CryptographicMaterialsCacheKeyHelpersInterface<S>; | ||
export interface CryptographicMaterialsCacheKeyHelpersInterface<S extends SupportedAlgorithmSuites> { | ||
@@ -8,0 +4,0 @@ buildEncryptionMaterialCacheKey(partition: string, { suite, encryptionContext }: EncryptionRequest<S>): Promise<string>; |
@@ -1,15 +0,3 @@ | ||
/* | ||
* 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. 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 | ||
import { serializeFactory, uInt16BE } from '@aws-crypto/serialize'; | ||
@@ -20,3 +8,3 @@ import { compare } from './portable_compare'; | ||
export function buildCryptographicMaterialsCacheKeyHelpers(fromUtf8, toUtf8, sha512) { | ||
const { serializeEncryptionContext, serializeEncryptedDataKey } = serializeFactory(fromUtf8); | ||
const { serializeEncryptionContext, serializeEncryptedDataKey, } = serializeFactory(fromUtf8); | ||
return { | ||
@@ -26,3 +14,3 @@ buildEncryptionMaterialCacheKey, | ||
encryptedDataKeysHash, | ||
encryptionContextHash | ||
encryptionContextHash, | ||
}; | ||
@@ -44,6 +32,6 @@ async function buildEncryptionMaterialCacheKey(partition, { suite, encryptionContext }) { | ||
.map(serializeEncryptedDataKey) | ||
.map(edk => sha512(edk))); | ||
.map(async (edk) => sha512(edk))); | ||
return hashes.sort(compare); | ||
} | ||
function encryptionContextHash(context) { | ||
async function encryptionContextHash(context) { | ||
/* The AAD section is uInt16BE(length) + AAD | ||
@@ -58,2 +46,2 @@ * see: https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/message-format.html#header-aad | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVpbGRfY3J5cHRvZ3JhcGhpY19tYXRlcmlhbHNfY2FjaGVfa2V5X2hlbHBlcnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvYnVpbGRfY3J5cHRvZ3JhcGhpY19tYXRlcmlhbHNfY2FjaGVfa2V5X2hlbHBlcnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7Ozs7Ozs7Ozs7R0FhRztBQVNILE9BQU8sRUFBRSxnQkFBZ0IsRUFBRSxRQUFRLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQTtBQUNsRSxPQUFPLEVBQUUsT0FBTyxFQUFFLE1BQU0sb0JBQW9CLENBQUE7QUFFNUMseUZBQXlGO0FBQ3pGLE1BQU0sV0FBVyxHQUFHLE1BQU0sQ0FBQyxLQUFLLENBQUMsRUFBRSxDQUFDLENBQUE7QUFFcEMsTUFBTSxVQUFVLDBDQUEwQyxDQUN4RCxRQUF1QyxFQUN2QyxNQUFxQyxFQUNyQyxNQUFpRTtJQUVqRSxNQUFNLEVBQ0osMEJBQTBCLEVBQzFCLHlCQUF5QixFQUMxQixHQUFHLGdCQUFnQixDQUFDLFFBQVEsQ0FBQyxDQUFBO0lBRTlCLE9BQU87UUFDTCwrQkFBK0I7UUF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xDQUFDO0FBQ0gsQ0FBQyJ9 |
@@ -1,11 +0,7 @@ | ||
import { GetEncryptionMaterials, // eslint-disable-line no-unused-vars | ||
GetDecryptMaterials, // eslint-disable-line no-unused-vars | ||
SupportedAlgorithmSuites, // eslint-disable-line no-unused-vars | ||
MaterialsManager, Keyring } from '@aws-crypto/material-management'; | ||
import { CryptographicMaterialsCache, // eslint-disable-line no-unused-vars | ||
Entry } from './cryptographic_materials_cache'; | ||
import { GetEncryptionMaterials, GetDecryptMaterials, SupportedAlgorithmSuites, MaterialsManager, Keyring } from '@aws-crypto/material-management'; | ||
import { CryptographicMaterialsCache, Entry } from './cryptographic_materials_cache'; | ||
import { CryptographicMaterialsCacheKeyHelpersInterface } from './build_cryptographic_materials_cache_key_helpers'; | ||
export declare function decorateProperties<S extends SupportedAlgorithmSuites>(obj: CachingMaterialsManager<S>, input: CachingMaterialsManagerDecorateInput<S>): void; | ||
export declare function getEncryptionMaterials<S extends SupportedAlgorithmSuites>({ buildEncryptionMaterialCacheKey }: CryptographicMaterialsCacheKeyHelpersInterface<S>): GetEncryptionMaterials<S>; | ||
export declare function decryptMaterials<S extends SupportedAlgorithmSuites>({ buildDecryptionMaterialCacheKey }: CryptographicMaterialsCacheKeyHelpersInterface<S>): GetDecryptMaterials<S>; | ||
export declare function getEncryptionMaterials<S extends SupportedAlgorithmSuites>({ buildEncryptionMaterialCacheKey, }: CryptographicMaterialsCacheKeyHelpersInterface<S>): GetEncryptionMaterials<S>; | ||
export declare function decryptMaterials<S extends SupportedAlgorithmSuites>({ buildDecryptionMaterialCacheKey, }: CryptographicMaterialsCacheKeyHelpersInterface<S>): GetDecryptMaterials<S>; | ||
export declare function cacheEntryHasExceededLimits<S extends SupportedAlgorithmSuites>(): CacheEntryHasExceededLimits<S>; | ||
@@ -12,0 +8,0 @@ export interface CachingMaterialsManagerInput<S extends SupportedAlgorithmSuites> extends Readonly<{ |
@@ -1,21 +0,7 @@ | ||
/* | ||
* 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. 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. | ||
*/ | ||
import { // eslint-disable-line no-unused-vars | ||
needs, readOnlyProperty, // eslint-disable-line no-unused-vars | ||
cloneMaterial } from '@aws-crypto/material-management'; | ||
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import { needs, readOnlyProperty, cloneMaterial, } from '@aws-crypto/material-management'; | ||
import { Maximum } from '@aws-crypto/serialize'; | ||
export function decorateProperties(obj, input) { | ||
const { cache, backingMaterialsManager, maxAge, maxBytesEncrypted, maxMessagesEncrypted, partition } = input; | ||
const { cache, backingMaterialsManager, maxAge, maxBytesEncrypted, maxMessagesEncrypted, partition, } = input; | ||
/* Precondition: A caching material manager needs a cache. */ | ||
@@ -28,5 +14,9 @@ needs(cache, 'You must provide a cache.'); | ||
/* Precondition: maxBytesEncrypted must be inside bounds. i.e. positive and not more than the maximum. */ | ||
needs(!maxBytesEncrypted || (maxBytesEncrypted > 0 && Maximum.BYTES_PER_CACHED_KEY_LIMIT >= maxBytesEncrypted), 'maxBytesEncrypted is outside of bounds.'); | ||
needs(!maxBytesEncrypted || | ||
(maxBytesEncrypted > 0 && | ||
Maximum.BYTES_PER_CACHED_KEY_LIMIT >= maxBytesEncrypted), 'maxBytesEncrypted is outside of bounds.'); | ||
/* Precondition: maxMessagesEncrypted must be inside bounds. i.e. positive and not more than the maximum. */ | ||
needs(!maxMessagesEncrypted || (maxMessagesEncrypted > 0 && Maximum.MESSAGES_PER_CACHED_KEY_LIMIT >= maxMessagesEncrypted), 'maxMessagesEncrypted is outside of bounds.'); | ||
needs(!maxMessagesEncrypted || | ||
(maxMessagesEncrypted > 0 && | ||
Maximum.MESSAGES_PER_CACHED_KEY_LIMIT >= maxMessagesEncrypted), 'maxMessagesEncrypted is outside of bounds.'); | ||
/* Precondition: partition must be a string. */ | ||
@@ -41,12 +31,15 @@ needs(partition && typeof partition === 'string', 'partition must be a string.'); | ||
} | ||
export function getEncryptionMaterials({ buildEncryptionMaterialCacheKey }) { | ||
export function getEncryptionMaterials({ buildEncryptionMaterialCacheKey, }) { | ||
return async function getEncryptionMaterials(request) { | ||
const { suite, encryptionContext, plaintextLength } = request; | ||
/* Check for early return (Postcondition): If I can not cache the EncryptionMaterial, do not even look. */ | ||
if ((suite && !suite.cacheSafe) || typeof plaintextLength !== 'number' || plaintextLength < 0) { | ||
return this | ||
._backingMaterialsManager | ||
.getEncryptionMaterials(request); | ||
if ((suite && !suite.cacheSafe) || | ||
typeof plaintextLength !== 'number' || | ||
plaintextLength < 0) { | ||
return this._backingMaterialsManager.getEncryptionMaterials(request); | ||
} | ||
const cacheKey = await buildEncryptionMaterialCacheKey(this._partition, { suite, encryptionContext }); | ||
const cacheKey = await buildEncryptionMaterialCacheKey(this._partition, { | ||
suite, | ||
encryptionContext, | ||
}); | ||
const entry = this._cache.getEncryptionMaterial(cacheKey, plaintextLength); | ||
@@ -60,4 +53,3 @@ /* Check for early return (Postcondition): If I have a valid EncryptionMaterial, return it. */ | ||
} | ||
const material = await this | ||
._backingMaterialsManager | ||
const material = await this._backingMaterialsManager | ||
/* Strip any information about the plaintext from the backing request, | ||
@@ -79,3 +71,3 @@ * because the resulting response may be used to encrypt multiple plaintexts. | ||
messagesEncrypted: 1, | ||
bytesEncrypted: plaintextLength | ||
bytesEncrypted: plaintextLength, | ||
}; | ||
@@ -96,3 +88,3 @@ if (!this._cacheEntryHasExceededLimits(testEntry)) { | ||
} | ||
export function decryptMaterials({ buildDecryptionMaterialCacheKey }) { | ||
export function decryptMaterials({ buildDecryptionMaterialCacheKey, }) { | ||
return async function decryptMaterials(request) { | ||
@@ -102,5 +94,3 @@ const { suite } = request; | ||
if (!suite.cacheSafe) { | ||
return this | ||
._backingMaterialsManager | ||
.decryptMaterials(request); | ||
return this._backingMaterialsManager.decryptMaterials(request); | ||
} | ||
@@ -116,5 +106,3 @@ const cacheKey = await buildDecryptionMaterialCacheKey(this._partition, request); | ||
} | ||
const material = await this | ||
._backingMaterialsManager | ||
.decryptMaterials(request); | ||
const material = await this._backingMaterialsManager.decryptMaterials(request); | ||
this._cache.putDecryptionMaterial(cacheKey, material, this._maxAge); | ||
@@ -127,5 +115,5 @@ return cloneResponse(material); | ||
const age = Date.now() - now; | ||
return age > this._maxAge || | ||
return (age > this._maxAge || | ||
messagesEncrypted > this._maxMessagesEncrypted || | ||
bytesEncrypted > this._maxBytesEncrypted; | ||
bytesEncrypted > this._maxBytesEncrypted); | ||
}; | ||
@@ -144,2 +132,2 @@ } | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FjaGluZ19jcnlwdG9ncmFwaGljX21hdGVyaWFsc19kZWNvcmF0b3JzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2NhY2hpbmdfY3J5cHRvZ3JhcGhpY19tYXRlcmlhbHNfZGVjb3JhdG9ycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7Ozs7Ozs7OztHQWFHO0FBRUgsT0FBTyxFQVFjLHFDQUFxQztBQUN4RCxLQUFLLEVBQ0wsZ0JBQWdCLEVBQ1AscUNBQXFDO0FBQzlDLGFBQWEsRUFDZCxNQUFNLGlDQUFpQyxDQUFBO0FBQ3hDLE9BQU8sRUFBRSxPQUFPLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQTtBQVMvQyxNQUFNLFVBQVUsa0JBQWtCLENBQ2hDLEdBQStCLEVBQy9CLEtBQThDO0lBRTlDLE1BQU0sRUFBR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tRQUVwRCxNQUFNLEdBQUcsR0FBRyxJQUFJLENBQUMsR0FBRyxFQUFFLEdBQUcsR0FBRyxDQUFBO1FBQzVCLE9BQU8sQ0FDTCxHQUFHLEdBQUcsSUFBSSxDQUFDLE9BQU87WUFDbEIsaUJBQWlCLEdBQUcsSUFBSSxDQUFDLHFCQUFxQjtZQUM5QyxjQUFjLEdBQUcsSUFBSSxDQUFDLGtCQUFrQixDQUN6QyxDQUFBO0lBQ0gsQ0FBQyxDQUFBO0FBQ0gsQ0FBQztBQUVEOzs7Ozs7O0dBT0c7QUFDSCxTQUFTLGFBQWEsQ0FHcEIsUUFBVztJQUNYLE9BQU8sYUFBYSxDQUFDLFFBQVEsQ0FBQyxDQUFBO0FBQ2hDLENBQUMifQ== |
@@ -1,4 +0,2 @@ | ||
import { EncryptionMaterial, // eslint-disable-line no-unused-vars | ||
DecryptionMaterial, // eslint-disable-line no-unused-vars | ||
SupportedAlgorithmSuites } from '@aws-crypto/material-management'; | ||
import { EncryptionMaterial, DecryptionMaterial, SupportedAlgorithmSuites } from '@aws-crypto/material-management'; | ||
export interface CryptographicMaterialsCache<S extends SupportedAlgorithmSuites> { | ||
@@ -5,0 +3,0 @@ putEncryptionMaterial(key: string, response: EncryptionMaterial<S>, plaintextLength: number, maxAge?: number): void; |
@@ -1,15 +0,3 @@ | ||
/* | ||
* 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. 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. | ||
*/ | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY3J5cHRvZ3JhcGhpY19tYXRlcmlhbHNfY2FjaGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY3J5cHRvZ3JhcGhpY19tYXRlcmlhbHNfY2FjaGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7Ozs7Ozs7Ozs7R0FhRyJ9 | ||
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY3J5cHRvZ3JhcGhpY19tYXRlcmlhbHNfY2FjaGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY3J5cHRvZ3JhcGhpY19tYXRlcmlhbHNfY2FjaGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsb0VBQW9FO0FBQ3BFLHNDQUFzQyJ9 |
@@ -1,5 +0,4 @@ | ||
import { // eslint-disable-line no-unused-vars | ||
SupportedAlgorithmSuites } from '@aws-crypto/material-management'; | ||
import { SupportedAlgorithmSuites } from '@aws-crypto/material-management'; | ||
import { CryptographicMaterialsCache } from './cryptographic_materials_cache'; | ||
export declare function getLocalCryptographicMaterialsCache<S extends SupportedAlgorithmSuites>(capacity: number, proactiveFrequency?: number): CryptographicMaterialsCache<S>; | ||
//# sourceMappingURL=get_local_cryptographic_materials_cache.d.ts.map |
@@ -1,18 +0,5 @@ | ||
/* | ||
* 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. 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 | ||
import LRU from 'lru-cache'; | ||
import { // eslint-disable-line no-unused-vars | ||
needs, isEncryptionMaterial, isDecryptionMaterial } from '@aws-crypto/material-management'; | ||
import { needs, isEncryptionMaterial, isDecryptionMaterial, } from '@aws-crypto/material-management'; | ||
export function getLocalCryptographicMaterialsCache(capacity, proactiveFrequency = 1000 * 60) { | ||
@@ -24,3 +11,3 @@ const cache = new LRU({ | ||
value.response.zeroUnencryptedDataKey(); | ||
} | ||
}, | ||
}); | ||
@@ -53,3 +40,3 @@ (function proactivelyTryAndEvictTail() { | ||
messagesEncrypted: 1, | ||
now: Date.now() | ||
now: Date.now(), | ||
}); | ||
@@ -67,3 +54,3 @@ cache.set(key, entry, maxAge); | ||
messagesEncrypted: 0, | ||
now: Date.now() | ||
now: Date.now(), | ||
}); | ||
@@ -96,3 +83,3 @@ cache.set(key, entry, maxAge); | ||
cache.del(key); | ||
} | ||
}, | ||
}; | ||
@@ -113,2 +100,2 @@ function mayEvictTail() { | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0X2xvY2FsX2NyeXB0b2dyYXBoaWNfbWF0ZXJpYWxzX2NhY2hlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2dldF9sb2NhbF9jcnlwdG9ncmFwaGljX21hdGVyaWFsc19jYWNoZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7Ozs7Ozs7OztHQWFHO0FBRUgsT0FBTyxHQUFHLE1BQU0sV0FBVyxDQUFBO0FBQzNCLE9BQU8sRUFHcUIscUNBQXFDO0FBQy9ELEtBQUssRUFDTCxvQkFBb0IsRUFDcEIsb0JBQW9CLEVBQ3JCLE1BQU0saUNBQWlDLENBQUE7QUFTeEMsTUFBTSxVQUFVLG1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ZQUNwRCxLQUFLLENBQUMsb0JBQW9CLENBQUMsS0FBSyxDQUFDLFFBQVEsQ0FBQyxFQUFFLHFCQUFxQixDQUFDLENBQUE7WUFFbEUsT0FBTyxLQUFtQyxDQUFBO1FBQzVDLENBQUM7UUFDRCxHQUFHLENBQUMsR0FBVztZQUNiLEtBQUssQ0FBQyxHQUFHLENBQUMsR0FBRyxDQUFDLENBQUE7UUFDaEIsQ0FBQztLQUNGLENBQUE7SUFFRCxTQUFTLFlBQVk7UUFDbkIsYUFBYTtRQUNiLE1BQU0sRUFBRSxJQUFJLEVBQUUsR0FBRyxLQUFLLENBQUMsT0FBTyxFQUFFLENBQUE7UUFDaEMsb0dBQW9HO1FBQ3BHLElBQUksQ0FBQyxJQUFJO1lBQUUsT0FBTTtRQUNqQjs7V0FFRztRQUNILE1BQU0sRUFBRSxHQUFHLEVBQUUsR0FBRyxJQUFJLENBQUMsS0FBSyxDQUFBO1FBQzFCLHVFQUF1RTtRQUN2RSxLQUFLLENBQUMsSUFBSSxDQUFDLEdBQUcsQ0FBQyxDQUFBO0lBQ2pCLENBQUM7QUFDSCxDQUFDIn0= |
@@ -1,18 +0,6 @@ | ||
/* | ||
* 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. 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 | ||
export * from './caching_cryptographic_materials_decorators'; | ||
export * from './build_cryptographic_materials_cache_key_helpers'; | ||
export * from './get_local_cryptographic_materials_cache'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7Ozs7Ozs7Ozs7R0FhRztBQUdILGNBQWMsOENBQThDLENBQUE7QUFDNUQsY0FBYyxtREFBbUQsQ0FBQTtBQUNqRSxjQUFjLDJDQUEyQyxDQUFBIn0= | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsb0VBQW9FO0FBQ3BFLHNDQUFzQztBQUd0QyxjQUFjLDhDQUE4QyxDQUFBO0FBQzVELGNBQWMsbURBQW1ELENBQUE7QUFDakUsY0FBYywyQ0FBMkMsQ0FBQSJ9 |
@@ -1,15 +0,3 @@ | ||
/* | ||
* 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. 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 | ||
/* Node has Buffer.compare, | ||
@@ -21,5 +9,3 @@ * but browsers have nothing. | ||
export function compare(a, b) { | ||
const length = a.byteLength > b.byteLength | ||
? b.byteLength | ||
: a.byteLength; | ||
const length = a.byteLength > b.byteLength ? b.byteLength : a.byteLength; | ||
for (let i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@ -6,2 +6,10 @@ # Change Log | ||
## [1.0.4](https://github.com/aws/aws-encryption-sdk-javascript/compare/@aws-crypto/cache-material@1.0.3...@aws-crypto/cache-material@1.0.4) (2020-05-26) | ||
**Note:** Version bump only for package @aws-crypto/cache-material | ||
## [1.0.3](https://github.com/aws/aws-encryption-sdk-javascript/compare/@aws-crypto/cache-material@1.0.2...@aws-crypto/cache-material@1.0.3) (2020-04-02) | ||
@@ -8,0 +16,0 @@ |
{ | ||
"name": "@aws-crypto/cache-material", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"scripts": { | ||
"prepublishOnly": "npm run build", | ||
"build": "tsc -b tsconfig.json && tsc -b tsconfig.module.json", | ||
"lint": "standard src/*.ts test/**/*.ts", | ||
"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", | ||
@@ -19,4 +21,4 @@ "test": "npm run lint && npm run coverage", | ||
"dependencies": { | ||
"@aws-crypto/material-management": "^1.0.3", | ||
"@aws-crypto/serialize": "^1.0.3", | ||
"@aws-crypto/material-management": "^1.0.4", | ||
"@aws-crypto/serialize": "^1.0.4", | ||
"@types/lru-cache": "^5.1.0", | ||
@@ -33,9 +35,3 @@ "lru-cache": "^5.1.1", | ||
], | ||
"standard": { | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": [ | ||
"@typescript-eslint" | ||
] | ||
}, | ||
"gitHead": "6fdb7e50f91cff05999eeaf79fbd6ad1720024a2" | ||
"gitHead": "4b60e0607e83d1ea2da98fd593e681f98f0d0082" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
373566
739