@pushprotocol/restapi
Advanced tools
Comparing version 0.0.1-beta.0 to 0.0.1-beta.1
@@ -5,2 +5,26 @@ # Changelog | ||
## [0.0.1-beta.1](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-1.2.10...restapi-0.0.1-beta.1) (2023-05-04) | ||
## [1.2.10](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.0.1-beta.0...restapi-1.2.10) (2023-05-02) | ||
### Bug Fixes | ||
* add password validation ([#345](https://github.com/ethereum-push-notification-service/push-sdk/issues/345)) ([863f48f](https://github.com/ethereum-push-notification-service/push-sdk/commit/863f48f9cbb3022e01f8715005cc8cd0fa96d0a8)) | ||
* Merge branch 'main' into deployment ([a3cf078](https://github.com/ethereum-push-notification-service/push-sdk/commit/a3cf078f37d31859ae83129d2b704639bbaab62b)) | ||
## [1.2.10](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.0.1-beta.0...restapi-1.2.10) (2023-05-02) | ||
### Bug Fixes | ||
* add password validation ([#345](https://github.com/ethereum-push-notification-service/push-sdk/issues/345)) ([863f48f](https://github.com/ethereum-push-notification-service/push-sdk/commit/863f48f9cbb3022e01f8715005cc8cd0fa96d0a8)) | ||
* Merge branch 'main' into deployment ([a3cf078](https://github.com/ethereum-push-notification-service/push-sdk/commit/a3cf078f37d31859ae83129d2b704639bbaab62b)) | ||
## [0.0.1-beta.0](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-1.2.9...restapi-0.0.1-beta.0) (2023-05-02) | ||
@@ -7,0 +31,0 @@ |
{ | ||
"name": "@pushprotocol/restapi", | ||
"version": "0.0.1-beta.0", | ||
"version": "0.0.1-beta.1", | ||
"type": "commonjs", | ||
@@ -5,0 +5,0 @@ "publishConfig": { |
@@ -51,2 +51,3 @@ import * as metamaskSigUtil from '@metamask/eth-sig-util'; | ||
export declare const verifyPGPPublicKey: (encryptionType: string, publicKey: string, did: string, nftOwner: string) => string; | ||
export declare const validatePssword: (password: string) => void; | ||
export {}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.verifyPGPPublicKey = exports.preparePGPPublicKey = exports.encryptPGPKey = exports.decryptV2 = exports.encryptV2 = exports.stringToHex = exports.hexToBytes = exports.generateHash = exports.decryptAndVerifySignature = exports.decryptMessage = exports.decryptPGPKey = exports.decryptWithWalletRPCMethod = exports.encryptV1 = exports.getPublicKey = void 0; | ||
exports.validatePssword = exports.verifyPGPPublicKey = exports.preparePGPPublicKey = exports.encryptPGPKey = exports.decryptV2 = exports.encryptV2 = exports.stringToHex = exports.hexToBytes = exports.generateHash = exports.decryptAndVerifySignature = exports.decryptMessage = exports.decryptPGPKey = exports.decryptWithWalletRPCMethod = exports.encryptV1 = exports.getPublicKey = void 0; | ||
const tslib_1 = require("tslib"); | ||
@@ -414,2 +414,20 @@ const metamaskSigUtil = require("@metamask/eth-sig-util"); | ||
exports.verifyPGPPublicKey = verifyPGPPublicKey; | ||
const validatePssword = (password) => { | ||
if (password.length < 8) { | ||
throw new Error('Password must be at least 8 characters long!'); | ||
} | ||
if (!/[A-Z]/.test(password)) { | ||
throw new Error('Password must contain at least one uppercase letter!'); | ||
} | ||
if (!/[a-z]/.test(password)) { | ||
throw new Error('Password must contain at least one lowercase letter!'); | ||
} | ||
if (!/\d/.test(password)) { | ||
throw new Error('Password must contain at least one digit!'); | ||
} | ||
if (!/[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?]/.test(password)) { | ||
throw new Error('Password must contain at least one special character!'); | ||
} | ||
}; | ||
exports.validatePssword = validatePssword; | ||
//# sourceMappingURL=crypto.js.map |
@@ -19,2 +19,5 @@ "use strict"; | ||
} | ||
if (additionalMeta && additionalMeta.password) { | ||
(0, helpers_2.validatePssword)(additionalMeta.password); | ||
} | ||
const caip10 = (0, helpers_2.walletToPCAIP10)(address); | ||
@@ -21,0 +24,0 @@ let encryptionType = version; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
499369
4918