cabloy 5.1.185 → 5.1.187
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/.cabloy-version +1 -1
- package/CHANGELOG.md +12 -0
- package/package.json +1 -1
- package/vona/env/.env +5 -0
- package/vona/packages-cli/cli/package.json +1 -1
- package/vona/packages-cli/cli-set-api/package.json +1 -1
- package/vona/packages-vona/vona/package.json +1 -1
- package/vona/packages-vona/vona-core/package.json +1 -1
- package/vona/packages-vona/vona-core/src/lib/core/context.ts +6 -5
- package/vona/packages-vona/vona-core/src/types/context/contextBase.ts +6 -0
- package/vona/packages-vona/vona-core/src/types/context/index.ts +1 -0
- package/vona/packages-vona/vona-mock/package.json +1 -1
- package/vona/pnpm-lock.yaml +1 -1
- package/vona/src/suite/a-demo/modules/demo-demonstration/src/bean/guard.demonstration.ts +1 -0
- package/vona/src/suite-vendor/a-auth/modules/a-auth/package.json +1 -1
- package/vona/src/suite-vendor/a-auth/modules/a-auth/src/bean/bean.auth.ts +1 -1
- package/vona/src/suite-vendor/a-auth/modules/auth-oauth/package.json +1 -1
- package/vona/src/suite-vendor/a-auth/modules/auth-oauth/src/bean/authProvider.oauth.ts +2 -2
- package/vona/src/suite-vendor/a-auth/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-core/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/package.json +1 -1
package/.cabloy-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
5.1.
|
|
1
|
+
5.1.187
|
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
package/vona/env/.env
CHANGED
|
@@ -124,3 +124,8 @@ MAIL_SYSTEM_TRANSPORT_SECURE = false
|
|
|
124
124
|
MAIL_SYSTEM_TRANSPORT_AUTH_USER =
|
|
125
125
|
MAIL_SYSTEM_TRANSPORT_AUTH_PASS =
|
|
126
126
|
MAIL_SYSTEM_DEFAULTS_FROM = no.reply@cabloy.com
|
|
127
|
+
|
|
128
|
+
# demonstration
|
|
129
|
+
|
|
130
|
+
DEMONSTRATION_ENABLED = false
|
|
131
|
+
DEMONSTRATION_USERNAME_WHITELIST =
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vona",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.98",
|
|
4
4
|
"gitHead": "a79189b882c17af5911573896a781bbb0046d37d",
|
|
5
5
|
"description": "Vona is an intuitive, elegant and powerful Node.js framework for rapidly developing enterprise applications of any size",
|
|
6
6
|
"keywords": [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IInstanceRecord } from '../../types/config/instance.ts';
|
|
2
|
-
import type { ContextBase } from '../../types/context/contextBase.ts';
|
|
2
|
+
import type { ContextBase, IContextRedirectOptions } from '../../types/context/contextBase.ts';
|
|
3
3
|
import type { VonaContext } from '../../types/context/index.ts';
|
|
4
4
|
import type { MetadataKey } from './metadata.ts';
|
|
5
5
|
|
|
@@ -121,15 +121,16 @@ export const contextBase: ContextBase = {
|
|
|
121
121
|
return false;
|
|
122
122
|
},
|
|
123
123
|
|
|
124
|
-
redirect(url: string,
|
|
124
|
+
redirect(url: string, statusOrOptions?: (301 | 302) | IContextRedirectOptions): void {
|
|
125
125
|
const self = cast<VonaContext>(this);
|
|
126
|
+
const options =
|
|
127
|
+
typeof statusOrOptions === 'number' ? { status: statusOrOptions } : (statusOrOptions ?? {});
|
|
126
128
|
// checkOrigin
|
|
127
|
-
if (!url.startsWith('/')) {
|
|
129
|
+
if (!url.startsWith('/') && !options.trustedExternal) {
|
|
128
130
|
const origin = cast(self.app.bean).security.checkOrigin(url, self.host);
|
|
129
131
|
if (!origin) self.app.throw(403);
|
|
130
132
|
}
|
|
131
133
|
// throw
|
|
132
|
-
status
|
|
133
|
-
self.app.throw(status, url);
|
|
134
|
+
self.app.throw(options.status ?? 302, url);
|
|
134
135
|
},
|
|
135
136
|
};
|
|
@@ -3,6 +3,11 @@ import type { VonaConfig } from '../config/config.ts';
|
|
|
3
3
|
import type { IInstanceRecord } from '../config/instance.ts';
|
|
4
4
|
import type { VonaContext } from './index.ts';
|
|
5
5
|
|
|
6
|
+
export interface IContextRedirectOptions {
|
|
7
|
+
status?: 301 | 302;
|
|
8
|
+
trustedExternal?: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
6
11
|
export interface ContextBase {
|
|
7
12
|
get bean(): BeanContainer;
|
|
8
13
|
get locale(): keyof ILocaleRecord;
|
|
@@ -26,4 +31,5 @@ export interface ContextBase {
|
|
|
26
31
|
set onionsDynamic(value: any | undefined);
|
|
27
32
|
get acceptJSON(): boolean;
|
|
28
33
|
redirect(url: string, status?: 301 | 302): void;
|
|
34
|
+
redirect(url: string, options?: IContextRedirectOptions): void;
|
|
29
35
|
}
|
|
@@ -5,6 +5,7 @@ import type { ContextBase } from './contextBase.ts';
|
|
|
5
5
|
import type { ContextOthers } from './contextOthers.ts';
|
|
6
6
|
import type { ContextState } from './contextState.ts';
|
|
7
7
|
|
|
8
|
+
export type { IContextRedirectOptions } from './contextBase.ts';
|
|
8
9
|
export * from './contextState.ts';
|
|
9
10
|
|
|
10
11
|
// @ts-ignore ignore the throw type check of 'throw'/'meta'
|
package/vona/pnpm-lock.yaml
CHANGED
|
@@ -1595,7 +1595,7 @@ importers:
|
|
|
1595
1595
|
specifier: workspace:^
|
|
1596
1596
|
version: link:modules/a-auth
|
|
1597
1597
|
vona-module-auth-oauth:
|
|
1598
|
-
specifier: ^5.0.
|
|
1598
|
+
specifier: ^5.0.12
|
|
1599
1599
|
version: link:modules/auth-oauth
|
|
1600
1600
|
vona-module-auth-simple:
|
|
1601
1601
|
specifier: workspace:^
|
|
@@ -86,7 +86,7 @@ export class BeanAuth extends BeanBase {
|
|
|
86
86
|
strategy.redirect = (location: string) => {
|
|
87
87
|
// real
|
|
88
88
|
if (!clientOptions.mockUsername) {
|
|
89
|
-
return this.ctx.redirect(location);
|
|
89
|
+
return this.ctx.redirect(location, { trustedExternal: true });
|
|
90
90
|
}
|
|
91
91
|
// mock
|
|
92
92
|
this.ctx.request.query.code = clientOptions.mockProfileId
|
|
@@ -39,8 +39,8 @@ const app = useApp();
|
|
|
39
39
|
clients: {
|
|
40
40
|
github: {
|
|
41
41
|
Strategy: StrategyGithub,
|
|
42
|
-
clientID: app.meta.env.AUTH_GITHUB_CLIENTID,
|
|
43
|
-
clientSecret: app.meta.env.AUTH_GITHUB_CLIENTSECRET,
|
|
42
|
+
clientID: app.meta.env.AUTH_GITHUB_CLIENTID || 'Shoule specify clientID',
|
|
43
|
+
clientSecret: app.meta.env.AUTH_GITHUB_CLIENTSECRET || 'Shoule specify clientSecret',
|
|
44
44
|
},
|
|
45
45
|
},
|
|
46
46
|
})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vona-suite-a-auth",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.27",
|
|
4
4
|
"gitHead": "a79189b882c17af5911573896a781bbb0046d37d",
|
|
5
5
|
"description": "",
|
|
6
6
|
"author": "",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"type": "module",
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"vona-module-a-auth": "workspace:^",
|
|
11
|
-
"vona-module-auth-oauth": "^5.0.
|
|
11
|
+
"vona-module-auth-oauth": "^5.0.12",
|
|
12
12
|
"vona-module-auth-simple": "workspace:^"
|
|
13
13
|
},
|
|
14
14
|
"title": "a-auth"
|