@aws-crypto/cache-material
Advanced tools
Comparing version 0.1.0-preview.3 to 0.1.0-preview.4
@@ -19,3 +19,2 @@ "use strict"; | ||
const serialize_1 = require("@aws-crypto/serialize"); | ||
const clone_cryptographic_material_1 = require("./clone_cryptographic_material"); | ||
function decorateProperties(obj, input) { | ||
@@ -30,5 +29,5 @@ const { cache, backingMaterialsManager, maxAge, maxBytesEncrypted, maxMessagesEncrypted, partition } = input; | ||
/* 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_KEY >= 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_KEY >= 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. */ | ||
@@ -39,4 +38,4 @@ material_management_1.needs(partition && typeof partition === 'string', 'partition must be a string.'); | ||
material_management_1.readOnlyProperty(obj, '_maxAge', maxAge); | ||
material_management_1.readOnlyProperty(obj, '_maxBytesEncrypted', maxBytesEncrypted || serialize_1.Maximum.BYTES_PER_KEY); | ||
material_management_1.readOnlyProperty(obj, '_maxMessagesEncrypted', maxMessagesEncrypted || serialize_1.Maximum.MESSAGES_PER_KEY); | ||
material_management_1.readOnlyProperty(obj, '_maxBytesEncrypted', maxBytesEncrypted || serialize_1.Maximum.BYTES_PER_CACHED_KEY_LIMIT); | ||
material_management_1.readOnlyProperty(obj, '_maxMessagesEncrypted', maxMessagesEncrypted || serialize_1.Maximum.MESSAGES_PER_CACHED_KEY_LIMIT); | ||
material_management_1.readOnlyProperty(obj, '_partition', partition); | ||
@@ -85,4 +84,12 @@ } | ||
this._cache.putEncryptionMaterial(cacheKey, material, plaintextLength, this._maxAge); | ||
return cloneResponse(material); | ||
} | ||
return cloneResponse(material); | ||
else { | ||
/* Postcondition: If the material has exceeded limits it MUST NOT be cloned. | ||
* If it is cloned, and the clone is returned, | ||
* then there exist a copy of the unencrypted data key. | ||
* It is true that this data would be caught by GC, it is better to just not rely on that. | ||
*/ | ||
return material; | ||
} | ||
}; | ||
@@ -135,4 +142,4 @@ } | ||
function cloneResponse(material) { | ||
return clone_cryptographic_material_1.cloneMaterial(material); | ||
return material_management_1.cloneMaterial(material); | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FjaGluZ19jcnlwdG9ncmFwaGljX21hdGVyaWFsc19kZWNvcmF0b3JzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2NhY2hpbmdfY3J5cHRvZ3JhcGhpY19tYXRlcmlhbHNfZGVjb3JhdG9ycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUE7Ozs7Ozs7Ozs7Ozs7R0FhRzs7QUFFSCx5RUFZd0M7QUFDeEMscURBQStDO0FBUS9DLGlGQUE4RDtBQUU5RCxTQUFnQixrQkFBa0IsQ0FDaEMsR0FBK0IsRUFDL0IsS0FBOEM7SUFFOUMsTUFBTSxFQUFFLEtBQUssRUFBRSx1QkFBdUIsRUFBRSxNQUFNLEVBQUUsaUJBQWlCLEVBQUUsb0JBQW9CLEVBQUUsU0FBUyxFQUFFLEdBQUcsS0FBSyxDQUFBO0lBRTVHLDZEQUE2RDtJQUM3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0gsQ0FBQztBQVZELGtFQVVDO0FBRUQ7Ozs7Ozs7R0FPRztBQUNILFNBQVMsYUFBYSxDQUNwQixRQUFXO0lBRVgsT0FBTyxtQ0FBYSxDQUFDLFFBQVEsQ0FBQyxDQUFBO0FBQ2hDLENBQUMifQ== |
import { // eslint-disable-line no-unused-vars | ||
SupportedAlgorithmSuites } from '@aws-crypto/material-management'; | ||
import { CryptographicMaterialsCache } from './cryptographic_materials_cache'; | ||
export declare function getLocalCryptographicMaterialsCache<S extends SupportedAlgorithmSuites>(maxSize: number, proactiveFrequency?: number): CryptographicMaterialsCache<S>; | ||
export declare function getLocalCryptographicMaterialsCache<S extends SupportedAlgorithmSuites>(capacity: number, proactiveFrequency?: number): CryptographicMaterialsCache<S>; | ||
//# sourceMappingURL=get_local_cryptographic_materials_cache.d.ts.map |
@@ -22,5 +22,5 @@ "use strict"; | ||
const material_management_1 = require("@aws-crypto/material-management"); | ||
function getLocalCryptographicMaterialsCache(maxSize, proactiveFrequency = 1000 * 60) { | ||
function getLocalCryptographicMaterialsCache(capacity, proactiveFrequency = 1000 * 60) { | ||
const cache = new lru_cache_1.default({ | ||
max: maxSize, | ||
max: capacity, | ||
dispose(_key, value) { | ||
@@ -115,2 +115,2 @@ /* Zero out the unencrypted dataKey, when the material is removed from the cache. */ | ||
exports.getLocalCryptographicMaterialsCache = getLocalCryptographicMaterialsCache; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0X2xvY2FsX2NyeXB0b2dyYXBoaWNfbWF0ZXJpYWxzX2NhY2hlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2dldF9sb2NhbF9jcnlwdG9ncmFwaGljX21hdGVyaWFsc19jYWNoZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUE7Ozs7Ozs7Ozs7Ozs7R0FhRzs7Ozs7QUFFSCwwREFBMkI7QUFDM0IseUV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BQyxRQUFRLENBQUMsRUFBRSxxQkFBcUIsQ0FBQyxDQUFBO1lBRWxFLE9BQW1DLEtBQUssQ0FBQTtRQUMxQyxDQUFDO1FBQ0QsR0FBRyxDQUFFLEdBQVc7WUFDZCxLQUFLLENBQUMsR0FBRyxDQUFDLEdBQUcsQ0FBQyxDQUFBO1FBQ2hCLENBQUM7S0FDRixDQUFBO0lBRUQsU0FBUyxZQUFZO1FBQ25CLGFBQWE7UUFDYixNQUFNLEVBQUUsSUFBSSxFQUFFLEdBQUcsS0FBSyxDQUFDLE9BQU8sRUFBRSxDQUFBO1FBQ2hDLG9HQUFvRztRQUNwRyxJQUFJLENBQUMsSUFBSTtZQUFFLE9BQU07UUFDakI7O1dBRUc7UUFDSCxNQUFNLEVBQUUsR0FBRyxFQUFFLEdBQUcsSUFBSSxDQUFDLEtBQUssQ0FBQTtRQUMxQix1RUFBdUU7UUFDdkUsS0FBSyxDQUFDLElBQUksQ0FBQyxHQUFHLENBQUMsQ0FBQTtJQUNqQixDQUFDO0FBQ0gsQ0FBQztBQXhIRCxrRkF3SEMifQ== |
export * from './cryptographic_materials_cache'; | ||
export * from './caching_cryptographic_materials_decorators'; | ||
export * from './build_cryptographic_materials_cache_key_helpers'; | ||
export * from './clone_cryptographic_material'; | ||
export * from './get_local_cryptographic_materials_cache'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -22,4 +22,3 @@ "use strict"; | ||
__export(require("./build_cryptographic_materials_cache_key_helpers")); | ||
__export(require("./clone_cryptographic_material")); | ||
__export(require("./get_local_cryptographic_materials_cache")); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBOzs7Ozs7Ozs7Ozs7O0dBYUc7Ozs7O0FBR0gsa0VBQTREO0FBQzVELHVFQUFpRTtBQUNqRSxvREFBOEM7QUFDOUMsK0RBQXlEIn0= | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBOzs7Ozs7Ozs7Ozs7O0dBYUc7Ozs7O0FBR0gsa0VBQTREO0FBQzVELHVFQUFpRTtBQUNqRSwrREFBeUQifQ== |
@@ -16,5 +16,5 @@ /* | ||
import { // eslint-disable-line no-unused-vars | ||
needs, readOnlyProperty } from '@aws-crypto/material-management'; | ||
needs, readOnlyProperty, // eslint-disable-line no-unused-vars | ||
cloneMaterial } from '@aws-crypto/material-management'; | ||
import { Maximum } from '@aws-crypto/serialize'; | ||
import { cloneMaterial } from './clone_cryptographic_material'; | ||
export function decorateProperties(obj, input) { | ||
@@ -29,5 +29,5 @@ const { cache, backingMaterialsManager, maxAge, maxBytesEncrypted, maxMessagesEncrypted, partition } = input; | ||
/* Precondition: maxBytesEncrypted must be inside bounds. i.e. positive and not more than the maximum. */ | ||
needs(!maxBytesEncrypted || (maxBytesEncrypted > 0 && Maximum.BYTES_PER_KEY >= 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_KEY >= 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. */ | ||
@@ -38,4 +38,4 @@ needs(partition && typeof partition === 'string', 'partition must be a string.'); | ||
readOnlyProperty(obj, '_maxAge', maxAge); | ||
readOnlyProperty(obj, '_maxBytesEncrypted', maxBytesEncrypted || Maximum.BYTES_PER_KEY); | ||
readOnlyProperty(obj, '_maxMessagesEncrypted', maxMessagesEncrypted || Maximum.MESSAGES_PER_KEY); | ||
readOnlyProperty(obj, '_maxBytesEncrypted', maxBytesEncrypted || Maximum.BYTES_PER_CACHED_KEY_LIMIT); | ||
readOnlyProperty(obj, '_maxMessagesEncrypted', maxMessagesEncrypted || Maximum.MESSAGES_PER_CACHED_KEY_LIMIT); | ||
readOnlyProperty(obj, '_partition', partition); | ||
@@ -83,4 +83,12 @@ } | ||
this._cache.putEncryptionMaterial(cacheKey, material, plaintextLength, this._maxAge); | ||
return cloneResponse(material); | ||
} | ||
return cloneResponse(material); | ||
else { | ||
/* Postcondition: If the material has exceeded limits it MUST NOT be cloned. | ||
* If it is cloned, and the clone is returned, | ||
* then there exist a copy of the unencrypted data key. | ||
* It is true that this data would be caught by GC, it is better to just not rely on that. | ||
*/ | ||
return material; | ||
} | ||
}; | ||
@@ -132,2 +140,2 @@ } | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FjaGluZ19jcnlwdG9ncmFwaGljX21hdGVyaWFsc19kZWNvcmF0b3JzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2NhY2hpbmdfY3J5cHRvZ3JhcGhpY19tYXRlcmlhbHNfZGVjb3JhdG9ycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7Ozs7Ozs7OztHQWFHO0FBRUgsT0FBTyxFQVFjLHFDQUFxQztBQUN4RCxLQUFLLEVBQ0wsZ0JBQWdCLEVBRWpCLE1BQU0saUNBQWlDLENBQUE7QUFDeEMsT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NILENBQUM7QUFFRCxNQUFNLFVBQVUsMkJBQTJCO0lBQ3pDLE9BQU8sU0FBUywyQkFBMkIsQ0FFekMsRUFBRSxHQUFHLEVBQUUsaUJBQWlCLEVBQUUsY0FBYyxFQUFZO1FBRXBELE1BQU0sR0FBRyxHQUFHLElBQUksQ0FBQyxHQUFHLEVBQUUsR0FBRyxHQUFHLENBQUE7UUFDNUIsT0FBTyxHQUFHLEdBQUcsSUFBSSxDQUFDLE9BQU87WUFDdkIsaUJBQWlCLEdBQUcsSUFBSSxDQUFDLHFCQUFxQjtZQUM5QyxjQUFjLEdBQUcsSUFBSSxDQUFDLGtCQUFrQixDQUFBO0lBQzVDLENBQUMsQ0FBQTtBQUNILENBQUM7QUFFRDs7Ozs7OztHQU9HO0FBQ0gsU0FBUyxhQUFhLENBQ3BCLFFBQVc7SUFFWCxPQUFPLGFBQWEsQ0FBQyxRQUFRLENBQUMsQ0FBQTtBQUNoQyxDQUFDIn0= |
import { // eslint-disable-line no-unused-vars | ||
SupportedAlgorithmSuites } from '@aws-crypto/material-management'; | ||
import { CryptographicMaterialsCache } from './cryptographic_materials_cache'; | ||
export declare function getLocalCryptographicMaterialsCache<S extends SupportedAlgorithmSuites>(maxSize: number, proactiveFrequency?: number): CryptographicMaterialsCache<S>; | ||
export declare function getLocalCryptographicMaterialsCache<S extends SupportedAlgorithmSuites>(capacity: number, proactiveFrequency?: number): CryptographicMaterialsCache<S>; | ||
//# sourceMappingURL=get_local_cryptographic_materials_cache.d.ts.map |
@@ -18,5 +18,5 @@ /* | ||
needs, isEncryptionMaterial, isDecryptionMaterial } from '@aws-crypto/material-management'; | ||
export function getLocalCryptographicMaterialsCache(maxSize, proactiveFrequency = 1000 * 60) { | ||
export function getLocalCryptographicMaterialsCache(capacity, proactiveFrequency = 1000 * 60) { | ||
const cache = new LRU({ | ||
max: maxSize, | ||
max: capacity, | ||
dispose(_key, value) { | ||
@@ -110,2 +110,2 @@ /* Zero out the unencrypted dataKey, when the material is removed from the c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QUNqQixDQUFDO0FBQ0gsQ0FBQyJ9 |
export * from './cryptographic_materials_cache'; | ||
export * from './caching_cryptographic_materials_decorators'; | ||
export * from './build_cryptographic_materials_cache_key_helpers'; | ||
export * from './clone_cryptographic_material'; | ||
export * from './get_local_cryptographic_materials_cache'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -17,4 +17,3 @@ /* | ||
export * from './build_cryptographic_materials_cache_key_helpers'; | ||
export * from './clone_cryptographic_material'; | ||
export * from './get_local_cryptographic_materials_cache'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7Ozs7Ozs7Ozs7R0FhRztBQUdILGNBQWMsOENBQThDLENBQUE7QUFDNUQsY0FBYyxtREFBbUQsQ0FBQTtBQUNqRSxjQUFjLGdDQUFnQyxDQUFBO0FBQzlDLGNBQWMsMkNBQTJDLENBQUEifQ== | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7Ozs7Ozs7Ozs7R0FhRztBQUdILGNBQWMsOENBQThDLENBQUE7QUFDNUQsY0FBYyxtREFBbUQsQ0FBQTtBQUNqRSxjQUFjLDJDQUEyQyxDQUFBIn0= |
@@ -6,2 +6,21 @@ # Change Log | ||
# [0.1.0-preview.4](/compare/@aws-crypto/cache-material@0.1.0-preview.3...@aws-crypto/cache-material@0.1.0-preview.4) (2019-09-20) | ||
### Bug Fixes | ||
* Add cacheing CMM examples (#187) b74716b, closes #187 #23 | ||
* BYTES_PER_KEY value (#193) d3118d7, closes #193 | ||
* cloned material that exceeds limits (#195) cd002d5, closes #195 | ||
* KeyringTraceFlag requirements and data key caching (#210) 7dfa1ae, closes #210 | ||
### Features | ||
* Suport Node.js crypto KeyObjects (#200) 77ad031, closes #200 #74 | ||
# [0.1.0-preview.3](/compare/@aws-crypto/cache-material@0.1.0-preview.2...@aws-crypto/cache-material@0.1.0-preview.3) (2019-08-08) | ||
@@ -8,0 +27,0 @@ |
{ | ||
"name": "@aws-crypto/cache-material", | ||
"version": "0.1.0-preview.3", | ||
"version": "0.1.0-preview.4", | ||
"scripts": { | ||
@@ -19,4 +19,4 @@ "prepublishOnly": "npm run build", | ||
"dependencies": { | ||
"@aws-crypto/material-management": "^0.2.0-preview.3", | ||
"@aws-crypto/serialize": "^0.1.0-preview.3", | ||
"@aws-crypto/material-management": "^0.2.0-preview.4", | ||
"@aws-crypto/serialize": "^0.1.0-preview.4", | ||
"@types/lru-cache": "^5.1.0", | ||
@@ -54,3 +54,3 @@ "lru-cache": "^5.1.1", | ||
}, | ||
"gitHead": "698180f30c85ef77a5739ebadd676d4b41ad441f" | ||
"gitHead": "b3e278777e164258f0f40f5ec5d260f1c0d21a9b" | ||
} |
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
419125
43
908