@eggjs/security 5.0.0-beta.17 → 5.0.0-beta.18
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/config/config.default.d.ts +11 -11
- package/package.json +5 -5
|
@@ -545,8 +545,6 @@ declare const SecurityConfig: z.ZodObject<{
|
|
|
545
545
|
ignore: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>, z.ZodFunction<z.ZodTuple<[z.ZodType<Context, z.ZodTypeDef, Context>], z.ZodUnknown>, z.ZodBoolean>]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>, z.ZodFunction<z.ZodTuple<[z.ZodType<Context, z.ZodTypeDef, Context>], z.ZodUnknown>, z.ZodBoolean>]>, "many">]>>;
|
|
546
546
|
__protocolWhiteListSet: z.ZodReadonly<z.ZodOptional<z.ZodSet<z.ZodString>>>;
|
|
547
547
|
}, "strip", z.ZodTypeAny, {
|
|
548
|
-
domainWhiteList: string[];
|
|
549
|
-
protocolWhiteList: string[];
|
|
550
548
|
csrf: {
|
|
551
549
|
type: "ctoken" | "referer" | "all" | "any";
|
|
552
550
|
enable: boolean;
|
|
@@ -619,6 +617,8 @@ declare const SecurityConfig: z.ZodObject<{
|
|
|
619
617
|
match?: string | RegExp | ((args_0: Context, ...args: unknown[]) => boolean) | (string | RegExp | ((args_0: Context, ...args: unknown[]) => boolean))[] | undefined;
|
|
620
618
|
ignore?: string | RegExp | ((args_0: Context, ...args: unknown[]) => boolean) | (string | RegExp | ((args_0: Context, ...args: unknown[]) => boolean))[] | undefined;
|
|
621
619
|
};
|
|
620
|
+
domainWhiteList: string[];
|
|
621
|
+
protocolWhiteList: string[];
|
|
622
622
|
defaultMiddleware: string | ("csrf" | "hsts" | "methodnoallow" | "noopen" | "nosniff" | "csp" | "xssProtection" | "xframe" | "dta")[];
|
|
623
623
|
referrerPolicy: {
|
|
624
624
|
value: string;
|
|
@@ -642,8 +642,6 @@ declare const SecurityConfig: z.ZodObject<{
|
|
|
642
642
|
ignore?: string | RegExp | ((args_0: Context, ...args: unknown[]) => boolean) | (string | RegExp | ((args_0: Context, ...args: unknown[]) => boolean))[] | undefined;
|
|
643
643
|
__protocolWhiteListSet?: ReadonlySet<string> | undefined;
|
|
644
644
|
}, {
|
|
645
|
-
domainWhiteList?: string[] | undefined;
|
|
646
|
-
protocolWhiteList?: string[] | undefined;
|
|
647
645
|
csrf?: unknown;
|
|
648
646
|
hsts?: {
|
|
649
647
|
match?: string | RegExp | ((args_0: Context, ...args: unknown[]) => boolean) | (string | RegExp | ((args_0: Context, ...args: unknown[]) => boolean))[] | undefined;
|
|
@@ -692,6 +690,8 @@ declare const SecurityConfig: z.ZodObject<{
|
|
|
692
690
|
ignore?: string | RegExp | ((args_0: Context, ...args: unknown[]) => boolean) | (string | RegExp | ((args_0: Context, ...args: unknown[]) => boolean))[] | undefined;
|
|
693
691
|
enable?: boolean | undefined;
|
|
694
692
|
} | undefined;
|
|
693
|
+
domainWhiteList?: string[] | undefined;
|
|
694
|
+
protocolWhiteList?: string[] | undefined;
|
|
695
695
|
defaultMiddleware?: string | ("csrf" | "hsts" | "methodnoallow" | "noopen" | "nosniff" | "csp" | "xssProtection" | "xframe" | "dta")[] | undefined;
|
|
696
696
|
match?: string | RegExp | ((args_0: Context, ...args: unknown[]) => boolean) | (string | RegExp | ((args_0: Context, ...args: unknown[]) => boolean))[] | undefined;
|
|
697
697
|
ignore?: string | RegExp | ((args_0: Context, ...args: unknown[]) => boolean) | (string | RegExp | ((args_0: Context, ...args: unknown[]) => boolean))[] | undefined;
|
|
@@ -737,32 +737,30 @@ declare const SecurityHelperConfig: z.ZodObject<{
|
|
|
737
737
|
*/
|
|
738
738
|
onTagAttr: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodString, z.ZodString, z.ZodBoolean], z.ZodUnknown>, z.ZodUnion<[z.ZodString, z.ZodVoid]>>>;
|
|
739
739
|
}, "strip", z.ZodTypeAny, {
|
|
740
|
-
whiteList?: Record<string, string[]> | undefined;
|
|
741
740
|
domainWhiteList?: string[] | undefined;
|
|
741
|
+
whiteList?: Record<string, string[]> | undefined;
|
|
742
742
|
onTagAttr?: ((args_0: string, args_1: string, args_2: string, args_3: boolean, ...args: unknown[]) => string | void) | undefined;
|
|
743
743
|
}, {
|
|
744
|
-
whiteList?: Record<string, string[]> | undefined;
|
|
745
744
|
domainWhiteList?: string[] | undefined;
|
|
745
|
+
whiteList?: Record<string, string[]> | undefined;
|
|
746
746
|
onTagAttr?: ((args_0: string, args_1: string, args_2: string, args_3: boolean, ...args: unknown[]) => string | void) | undefined;
|
|
747
747
|
}>>;
|
|
748
748
|
}, "strip", z.ZodTypeAny, {
|
|
749
749
|
shtml: {
|
|
750
|
-
whiteList?: Record<string, string[]> | undefined;
|
|
751
750
|
domainWhiteList?: string[] | undefined;
|
|
751
|
+
whiteList?: Record<string, string[]> | undefined;
|
|
752
752
|
onTagAttr?: ((args_0: string, args_1: string, args_2: string, args_3: boolean, ...args: unknown[]) => string | void) | undefined;
|
|
753
753
|
};
|
|
754
754
|
}, {
|
|
755
755
|
shtml?: {
|
|
756
|
-
whiteList?: Record<string, string[]> | undefined;
|
|
757
756
|
domainWhiteList?: string[] | undefined;
|
|
757
|
+
whiteList?: Record<string, string[]> | undefined;
|
|
758
758
|
onTagAttr?: ((args_0: string, args_1: string, args_2: string, args_3: boolean, ...args: unknown[]) => string | void) | undefined;
|
|
759
759
|
} | undefined;
|
|
760
760
|
}>;
|
|
761
761
|
type SecurityHelperConfig = z.infer<typeof SecurityHelperConfig>;
|
|
762
762
|
declare const _default: {
|
|
763
763
|
security: {
|
|
764
|
-
domainWhiteList: string[];
|
|
765
|
-
protocolWhiteList: string[];
|
|
766
764
|
csrf: {
|
|
767
765
|
type: "ctoken" | "referer" | "all" | "any";
|
|
768
766
|
enable: boolean;
|
|
@@ -835,6 +833,8 @@ declare const _default: {
|
|
|
835
833
|
match?: string | RegExp | ((args_0: Context, ...args: unknown[]) => boolean) | (string | RegExp | ((args_0: Context, ...args: unknown[]) => boolean))[] | undefined;
|
|
836
834
|
ignore?: string | RegExp | ((args_0: Context, ...args: unknown[]) => boolean) | (string | RegExp | ((args_0: Context, ...args: unknown[]) => boolean))[] | undefined;
|
|
837
835
|
};
|
|
836
|
+
domainWhiteList: string[];
|
|
837
|
+
protocolWhiteList: string[];
|
|
838
838
|
defaultMiddleware: string | ("csrf" | "hsts" | "methodnoallow" | "noopen" | "nosniff" | "csp" | "xssProtection" | "xframe" | "dta")[];
|
|
839
839
|
referrerPolicy: {
|
|
840
840
|
value: string;
|
|
@@ -860,8 +860,8 @@ declare const _default: {
|
|
|
860
860
|
};
|
|
861
861
|
helper: {
|
|
862
862
|
shtml: {
|
|
863
|
-
whiteList?: Record<string, string[]> | undefined;
|
|
864
863
|
domainWhiteList?: string[] | undefined;
|
|
864
|
+
whiteList?: Record<string, string[]> | undefined;
|
|
865
865
|
onTagAttr?: ((args_0: string, args_1: string, args_2: string, args_3: boolean, ...args: unknown[]) => string | void) | undefined;
|
|
866
866
|
};
|
|
867
867
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eggjs/security",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.18",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"zod": "^3.24.1"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
|
-
"egg": "4.1.0-beta.
|
|
87
|
+
"egg": "4.1.0-beta.18"
|
|
88
88
|
},
|
|
89
89
|
"devDependencies": {
|
|
90
90
|
"@types/escape-html": "^1.0.4",
|
|
@@ -100,9 +100,9 @@
|
|
|
100
100
|
"tsdown": "^0.15.4",
|
|
101
101
|
"typescript": "5.9.2",
|
|
102
102
|
"vitest": "4.0.0-beta.13",
|
|
103
|
-
"@eggjs/
|
|
104
|
-
"@eggjs/
|
|
105
|
-
"@eggjs/tsconfig": "3.1.0-beta.
|
|
103
|
+
"@eggjs/mock": "7.0.0-beta.18",
|
|
104
|
+
"@eggjs/supertest": "9.0.0-beta.18",
|
|
105
|
+
"@eggjs/tsconfig": "3.1.0-beta.18"
|
|
106
106
|
},
|
|
107
107
|
"files": [
|
|
108
108
|
"dist"
|