@stacksjs/security 0.58.72 → 0.59.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/crypt.d.ts +3 -0
- package/dist/hash.d.ts +9 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +14 -16
- package/dist/key.d.ts +1 -0
- package/package.json +2 -2
package/dist/crypt.d.ts
ADDED
package/dist/hash.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare function make(password: string, algorithm?: string): Promise<string>;
|
|
2
|
+
type Algorithm = 'bcrypt' | 'base64';
|
|
3
|
+
declare function verify(password: string, hash: string, algorithm?: Algorithm): Promise<boolean>;
|
|
4
|
+
declare function bcryptEncode(password: string): Promise<string>;
|
|
5
|
+
declare function bcryptVerify(password: string, hash: string): Promise<boolean>;
|
|
6
|
+
declare function base64Encode(password: string): string;
|
|
7
|
+
declare function base64Verify(password: string, hash: string): boolean;
|
|
8
|
+
declare function md5Encode(password: string): CryptoJS.lib.WordArray;
|
|
9
|
+
export { make as makeHash, verify as verifyHash, base64Encode, base64Verify, bcryptEncode, bcryptVerify, md5Encode };
|
package/dist/index.d.ts
ADDED
package/dist/index.js
CHANGED
|
@@ -17,7 +17,7 @@ var __toESM = (mod, isNodeMode, target) => {
|
|
|
17
17
|
};
|
|
18
18
|
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
19
19
|
|
|
20
|
-
//
|
|
20
|
+
// ../../../../node_modules/crypto-js/core.js
|
|
21
21
|
var require_core = __commonJS((exports, module) => {
|
|
22
22
|
(function(root, factory) {
|
|
23
23
|
if (typeof exports === "object") {
|
|
@@ -307,7 +307,7 @@ var require_core = __commonJS((exports, module) => {
|
|
|
307
307
|
});
|
|
308
308
|
});
|
|
309
309
|
|
|
310
|
-
//
|
|
310
|
+
// ../../../../node_modules/crypto-js/enc-utf8.js
|
|
311
311
|
var require_enc_utf8 = __commonJS((exports, module) => {
|
|
312
312
|
(function(root, factory) {
|
|
313
313
|
if (typeof exports === "object") {
|
|
@@ -322,7 +322,7 @@ var require_enc_utf8 = __commonJS((exports, module) => {
|
|
|
322
322
|
});
|
|
323
323
|
});
|
|
324
324
|
|
|
325
|
-
//
|
|
325
|
+
// ../../../../node_modules/crypto-js/enc-base64.js
|
|
326
326
|
var require_enc_base64 = __commonJS((exports, module) => {
|
|
327
327
|
(function(root, factory) {
|
|
328
328
|
if (typeof exports === "object") {
|
|
@@ -402,7 +402,7 @@ var require_enc_base64 = __commonJS((exports, module) => {
|
|
|
402
402
|
});
|
|
403
403
|
});
|
|
404
404
|
|
|
405
|
-
//
|
|
405
|
+
// ../../../../node_modules/crypto-js/md5.js
|
|
406
406
|
var require_md5 = __commonJS((exports, module) => {
|
|
407
407
|
(function(root, factory) {
|
|
408
408
|
if (typeof exports === "object") {
|
|
@@ -579,7 +579,7 @@ var require_md5 = __commonJS((exports, module) => {
|
|
|
579
579
|
});
|
|
580
580
|
});
|
|
581
581
|
|
|
582
|
-
//
|
|
582
|
+
// ../../../../node_modules/crypto-js/sha1.js
|
|
583
583
|
var require_sha1 = __commonJS((exports, module) => {
|
|
584
584
|
(function(root, factory) {
|
|
585
585
|
if (typeof exports === "object") {
|
|
@@ -668,7 +668,7 @@ var require_sha1 = __commonJS((exports, module) => {
|
|
|
668
668
|
});
|
|
669
669
|
});
|
|
670
670
|
|
|
671
|
-
//
|
|
671
|
+
// ../../../../node_modules/crypto-js/hmac.js
|
|
672
672
|
var require_hmac = __commonJS((exports, module) => {
|
|
673
673
|
(function(root, factory) {
|
|
674
674
|
if (typeof exports === "object") {
|
|
@@ -730,7 +730,7 @@ var require_hmac = __commonJS((exports, module) => {
|
|
|
730
730
|
});
|
|
731
731
|
});
|
|
732
732
|
|
|
733
|
-
//
|
|
733
|
+
// ../../../../node_modules/crypto-js/evpkdf.js
|
|
734
734
|
var require_evpkdf = __commonJS((exports, module) => {
|
|
735
735
|
(function(root, factory, undef) {
|
|
736
736
|
if (typeof exports === "object") {
|
|
@@ -789,7 +789,7 @@ var require_evpkdf = __commonJS((exports, module) => {
|
|
|
789
789
|
});
|
|
790
790
|
});
|
|
791
791
|
|
|
792
|
-
//
|
|
792
|
+
// ../../../../node_modules/crypto-js/cipher-core.js
|
|
793
793
|
var require_cipher_core = __commonJS((exports, module) => {
|
|
794
794
|
(function(root, factory, undef) {
|
|
795
795
|
if (typeof exports === "object") {
|
|
@@ -1087,7 +1087,7 @@ var require_cipher_core = __commonJS((exports, module) => {
|
|
|
1087
1087
|
});
|
|
1088
1088
|
});
|
|
1089
1089
|
|
|
1090
|
-
//
|
|
1090
|
+
// ../../../../node_modules/crypto-js/aes.js
|
|
1091
1091
|
var require_aes = __commonJS((exports, module) => {
|
|
1092
1092
|
(function(root, factory, undef) {
|
|
1093
1093
|
if (typeof exports === "object") {
|
|
@@ -1239,7 +1239,7 @@ var require_aes = __commonJS((exports, module) => {
|
|
|
1239
1239
|
});
|
|
1240
1240
|
});
|
|
1241
1241
|
|
|
1242
|
-
//
|
|
1242
|
+
// ../../../../node_modules/bcryptjs/dist/bcrypt.js
|
|
1243
1243
|
var require_bcrypt = __commonJS((exports, module) => {
|
|
1244
1244
|
(function(global2, factory) {
|
|
1245
1245
|
if (typeof define === "function" && define["amd"])
|
|
@@ -3078,11 +3078,9 @@ var decrypt = function(encrypted) {
|
|
|
3078
3078
|
// src/hash.ts
|
|
3079
3079
|
var import_bcryptjs = __toESM(require_bcrypt(), 1);
|
|
3080
3080
|
|
|
3081
|
-
//
|
|
3082
|
-
var version = "3.7.
|
|
3081
|
+
// ../../../../node_modules/js-base64/base64.mjs
|
|
3082
|
+
var version = "3.7.7";
|
|
3083
3083
|
var VERSION = version;
|
|
3084
|
-
var _hasatob = typeof atob === "function";
|
|
3085
|
-
var _hasbtoa = typeof btoa === "function";
|
|
3086
3084
|
var _hasBuffer = typeof Buffer === "function";
|
|
3087
3085
|
var _TD = typeof TextDecoder === "function" ? new TextDecoder : undefined;
|
|
3088
3086
|
var _TE = typeof TextEncoder === "function" ? new TextEncoder : undefined;
|
|
@@ -3109,7 +3107,7 @@ var btoaPolyfill = (bin) => {
|
|
|
3109
3107
|
}
|
|
3110
3108
|
return pad ? asc.slice(0, pad - 3) + "===".substring(pad) : asc;
|
|
3111
3109
|
};
|
|
3112
|
-
var _btoa =
|
|
3110
|
+
var _btoa = typeof btoa === "function" ? (bin) => btoa(bin) : _hasBuffer ? (bin) => Buffer.from(bin, "binary").toString("base64") : btoaPolyfill;
|
|
3113
3111
|
var _fromUint8Array = _hasBuffer ? (u8a) => Buffer.from(u8a).toString("base64") : (u8a) => {
|
|
3114
3112
|
const maxargs = 4096;
|
|
3115
3113
|
let strs = [];
|
|
@@ -3158,7 +3156,7 @@ var atobPolyfill = (asc) => {
|
|
|
3158
3156
|
}
|
|
3159
3157
|
return bin;
|
|
3160
3158
|
};
|
|
3161
|
-
var _atob =
|
|
3159
|
+
var _atob = typeof atob === "function" ? (asc) => atob(_tidyB64(asc)) : _hasBuffer ? (asc) => Buffer.from(asc, "base64").toString("binary") : atobPolyfill;
|
|
3162
3160
|
var _toUint8Array = _hasBuffer ? (a) => _U8Afrom(Buffer.from(a, "base64")) : (a) => _U8Afrom(_atob(a).split("").map((c) => c.charCodeAt(0)));
|
|
3163
3161
|
var toUint8Array = (a) => _toUint8Array(_unURI(a));
|
|
3164
3162
|
var _decode = _hasBuffer ? (a) => Buffer.from(a, "base64").toString("utf8") : _TD ? (a) => _TD.decode(_toUint8Array(a)) : (a) => btou(_atob(a));
|
package/dist/key.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function generateAppKey(): string;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/security",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.59.1",
|
|
5
5
|
"description": "The Stacks framework security.",
|
|
6
6
|
"author": "Chris Breuer",
|
|
7
7
|
"license": "MIT",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"@stacksjs/validation": "latest",
|
|
59
59
|
"bcryptjs": "^2.4.3",
|
|
60
60
|
"crypto-js": "^4.2.0",
|
|
61
|
-
"js-base64": "^3.7.
|
|
61
|
+
"js-base64": "^3.7.7"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@stacksjs/development": "latest"
|