@lobb-js/lobb-ext-auth 0.11.3 → 0.13.0
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/lib/components/pages/loginPage/index.svelte +1 -1
- package/dist/lib/components/pages/settings/pages/activityFeed.svelte +1 -1
- package/dist/lib/components/pages/settings/pages/rolesAndPermissions.svelte +1 -1
- package/dist/lib/components/pages/settings/pages/users.svelte +1 -1
- package/dist/lib/components/pages/userSettings/index.svelte +1 -1
- package/extensions/auth/studio/lib/components/pages/loginPage/index.svelte +1 -1
- package/extensions/auth/studio/lib/components/pages/settings/pages/activityFeed.svelte +1 -1
- package/extensions/auth/studio/lib/components/pages/settings/pages/rolesAndPermissions.svelte +1 -1
- package/extensions/auth/studio/lib/components/pages/settings/pages/users.svelte +1 -1
- package/extensions/auth/studio/lib/components/pages/userSettings/index.svelte +1 -1
- package/package.json +5 -5
- package/extensions/auth/tests/collections/extend_users_collection.test.ts +0 -61
- package/extensions/auth/tests/collections/shares.test.ts +0 -657
- package/extensions/auth/tests/configs/auth.ts +0 -101
- package/extensions/auth/tests/configs/auth_no_roles.ts +0 -65
- package/extensions/auth/tests/configs/auth_public_full_access.ts +0 -69
- package/extensions/auth/tests/configs/auth_with_admin_extra_fields.ts +0 -53
- package/extensions/auth/tests/configs/auth_with_different_admin_creds.ts +0 -81
- package/extensions/auth/tests/configs/auth_with_extend_users.ts +0 -79
- package/extensions/auth/tests/configs/auth_with_refresh_token.ts +0 -86
- package/extensions/auth/tests/configs/auth_with_short_access_token_only.ts +0 -95
- package/extensions/auth/tests/configs/auth_with_short_time_refresh_token.ts +0 -86
- package/extensions/auth/tests/configs/social_blog.ts +0 -146
- package/extensions/auth/tests/controllers/change_password.test.ts +0 -113
- package/extensions/auth/tests/controllers/dashboardAccessRoles.test.ts +0 -29
- package/extensions/auth/tests/controllers/login.test.ts +0 -101
- package/extensions/auth/tests/controllers/logout.test.ts +0 -89
- package/extensions/auth/tests/controllers/me.test.ts +0 -376
- package/extensions/auth/tests/controllers/register.test.ts +0 -45
- package/extensions/auth/tests/database/adminExtraFields.test.ts +0 -50
- package/extensions/auth/tests/database/db.test.ts +0 -64
- package/extensions/auth/tests/database/differentAdminCreds.test.ts +0 -51
- package/extensions/auth/tests/middlewares/adminAuthGuard.test.ts +0 -157
- package/extensions/auth/tests/middlewares/adminProtection.test.ts +0 -59
- package/extensions/auth/tests/middlewares/publicAllowBasic.test.ts +0 -137
- package/extensions/auth/tests/middlewares/publicPreventBasic.test.ts +0 -108
- package/extensions/auth/tests/permissions.test.ts +0 -127
- package/extensions/auth/tests/socialBlog.test.ts +0 -253
- package/extensions/auth/tests/utils/addArticles.ts +0 -22
- package/extensions/auth/tests/utils/addSocialBlogArticles.ts +0 -52
- package/extensions/auth/tests/utils/data/articles.ts +0 -65
- package/extensions/auth/tests/utils/data/socialBlogArticles.ts +0 -56
- package/extensions/auth/tests/workflows/shareIntersection.test.ts +0 -158
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import type { Config } from "@lobb-js/core";
|
|
2
|
-
import auth from "../../index.ts";
|
|
3
|
-
|
|
4
|
-
export const authConfig: Config = {
|
|
5
|
-
project: {
|
|
6
|
-
name: "Lobb",
|
|
7
|
-
force_sync: true,
|
|
8
|
-
support_email: "support@lobb.com",
|
|
9
|
-
},
|
|
10
|
-
database: {
|
|
11
|
-
host: "localhost",
|
|
12
|
-
port: 5432,
|
|
13
|
-
username: "test",
|
|
14
|
-
password: "test",
|
|
15
|
-
database: "*",
|
|
16
|
-
|
|
17
|
-
},
|
|
18
|
-
web_server: {
|
|
19
|
-
host: "0.0.0.0",
|
|
20
|
-
port: 0,
|
|
21
|
-
},
|
|
22
|
-
extensions: [
|
|
23
|
-
auth({
|
|
24
|
-
admin: {
|
|
25
|
-
password: "admin",
|
|
26
|
-
email: "admin@test.com",
|
|
27
|
-
},
|
|
28
|
-
extend_users: {
|
|
29
|
-
fields: {
|
|
30
|
-
name: {
|
|
31
|
-
type: "string",
|
|
32
|
-
length: 255,
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
roles: {
|
|
37
|
-
public: {
|
|
38
|
-
permissions: {
|
|
39
|
-
auth_users: {
|
|
40
|
-
create: true,
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
author: {
|
|
45
|
-
permissions: {
|
|
46
|
-
auth_users: {
|
|
47
|
-
read: {
|
|
48
|
-
filter: { id: ({ user }: any) => user?.id ?? null },
|
|
49
|
-
},
|
|
50
|
-
update: true,
|
|
51
|
-
delete: true,
|
|
52
|
-
},
|
|
53
|
-
articles: {
|
|
54
|
-
read: {
|
|
55
|
-
filter: { user_id: ({ user }: any) => user?.id ?? null },
|
|
56
|
-
fields: { id: true, title: true, body: true },
|
|
57
|
-
},
|
|
58
|
-
create: { fields: { title: true, body: true } },
|
|
59
|
-
},
|
|
60
|
-
auth_shares: {
|
|
61
|
-
create: true,
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
// Role with no auth_users perm at all — used to test that /me still
|
|
66
|
-
// works for a logged-in user whose role can't generally read auth_users.
|
|
67
|
-
reader: {
|
|
68
|
-
permissions: {
|
|
69
|
-
articles: { read: true },
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
}),
|
|
74
|
-
],
|
|
75
|
-
collections: {
|
|
76
|
-
articles: {
|
|
77
|
-
indexes: {},
|
|
78
|
-
fields: {
|
|
79
|
-
id: {
|
|
80
|
-
type: "integer",
|
|
81
|
-
},
|
|
82
|
-
title: {
|
|
83
|
-
type: "string",
|
|
84
|
-
length: 255,
|
|
85
|
-
},
|
|
86
|
-
body: {
|
|
87
|
-
type: "text",
|
|
88
|
-
},
|
|
89
|
-
published: {
|
|
90
|
-
type: "bool",
|
|
91
|
-
},
|
|
92
|
-
number_of_likes: {
|
|
93
|
-
type: "integer",
|
|
94
|
-
},
|
|
95
|
-
user_id: {
|
|
96
|
-
type: "integer",
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
};
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import type { Config } from "@lobb-js/core";
|
|
2
|
-
import auth from "../../index.ts";
|
|
3
|
-
|
|
4
|
-
export const authNoRolesConfig: Config = {
|
|
5
|
-
project: {
|
|
6
|
-
name: "Lobb",
|
|
7
|
-
force_sync: true,
|
|
8
|
-
support_email: "support@lobb.com",
|
|
9
|
-
},
|
|
10
|
-
database: {
|
|
11
|
-
host: "localhost",
|
|
12
|
-
port: 5432,
|
|
13
|
-
username: "test",
|
|
14
|
-
password: "test",
|
|
15
|
-
database: "*",
|
|
16
|
-
|
|
17
|
-
},
|
|
18
|
-
web_server: {
|
|
19
|
-
host: "0.0.0.0",
|
|
20
|
-
port: 0,
|
|
21
|
-
},
|
|
22
|
-
extensions: [
|
|
23
|
-
auth({
|
|
24
|
-
admin: {
|
|
25
|
-
password: "admin",
|
|
26
|
-
email: "admin@test.com",
|
|
27
|
-
},
|
|
28
|
-
extend_users: {
|
|
29
|
-
fields: {
|
|
30
|
-
name: {
|
|
31
|
-
type: "string",
|
|
32
|
-
length: 255,
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
roles: {},
|
|
37
|
-
}),
|
|
38
|
-
],
|
|
39
|
-
collections: {
|
|
40
|
-
articles: {
|
|
41
|
-
indexes: {},
|
|
42
|
-
fields: {
|
|
43
|
-
id: {
|
|
44
|
-
type: "integer",
|
|
45
|
-
},
|
|
46
|
-
title: {
|
|
47
|
-
type: "string",
|
|
48
|
-
length: 255,
|
|
49
|
-
},
|
|
50
|
-
body: {
|
|
51
|
-
type: "text",
|
|
52
|
-
},
|
|
53
|
-
published: {
|
|
54
|
-
type: "bool",
|
|
55
|
-
},
|
|
56
|
-
number_of_likes: {
|
|
57
|
-
type: "integer",
|
|
58
|
-
},
|
|
59
|
-
user_id: {
|
|
60
|
-
type: "integer",
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
};
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import type { Config } from "@lobb-js/core";
|
|
2
|
-
import auth from "../../index.ts";
|
|
3
|
-
|
|
4
|
-
export const authPublicFullAccessConfig: Config = {
|
|
5
|
-
project: {
|
|
6
|
-
name: "Lobb",
|
|
7
|
-
force_sync: true,
|
|
8
|
-
support_email: "support@lobb.com",
|
|
9
|
-
},
|
|
10
|
-
database: {
|
|
11
|
-
host: "localhost",
|
|
12
|
-
port: 5432,
|
|
13
|
-
username: "test",
|
|
14
|
-
password: "test",
|
|
15
|
-
database: "*",
|
|
16
|
-
|
|
17
|
-
},
|
|
18
|
-
web_server: {
|
|
19
|
-
host: "0.0.0.0",
|
|
20
|
-
port: 0,
|
|
21
|
-
},
|
|
22
|
-
extensions: [
|
|
23
|
-
auth({
|
|
24
|
-
admin: {
|
|
25
|
-
password: "admin",
|
|
26
|
-
email: "admin@test.com",
|
|
27
|
-
},
|
|
28
|
-
extend_users: {
|
|
29
|
-
fields: {
|
|
30
|
-
name: {
|
|
31
|
-
type: "string",
|
|
32
|
-
length: 255,
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
roles: {
|
|
37
|
-
public: {
|
|
38
|
-
permissions: true,
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
}),
|
|
42
|
-
],
|
|
43
|
-
collections: {
|
|
44
|
-
articles: {
|
|
45
|
-
indexes: {},
|
|
46
|
-
fields: {
|
|
47
|
-
id: {
|
|
48
|
-
type: "integer",
|
|
49
|
-
},
|
|
50
|
-
title: {
|
|
51
|
-
type: "string",
|
|
52
|
-
length: 255,
|
|
53
|
-
},
|
|
54
|
-
body: {
|
|
55
|
-
type: "text",
|
|
56
|
-
},
|
|
57
|
-
published: {
|
|
58
|
-
type: "bool",
|
|
59
|
-
},
|
|
60
|
-
number_of_likes: {
|
|
61
|
-
type: "integer",
|
|
62
|
-
},
|
|
63
|
-
user_id: {
|
|
64
|
-
type: "integer",
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import type { Config } from "@lobb-js/core";
|
|
2
|
-
import auth from "../../index.ts";
|
|
3
|
-
|
|
4
|
-
export const authWithAdminExtraFieldsConfig: Config = {
|
|
5
|
-
project: {
|
|
6
|
-
name: "Lobb",
|
|
7
|
-
force_sync: true,
|
|
8
|
-
support_email: "support@lobb.com",
|
|
9
|
-
},
|
|
10
|
-
database: {
|
|
11
|
-
host: "localhost",
|
|
12
|
-
port: 5432,
|
|
13
|
-
username: "test",
|
|
14
|
-
password: "test",
|
|
15
|
-
database: "*",
|
|
16
|
-
},
|
|
17
|
-
web_server: {
|
|
18
|
-
host: "0.0.0.0",
|
|
19
|
-
port: 0,
|
|
20
|
-
},
|
|
21
|
-
extensions: [
|
|
22
|
-
auth({
|
|
23
|
-
admin: {
|
|
24
|
-
email: "admin@test.com",
|
|
25
|
-
password: "admin",
|
|
26
|
-
name: "Super Admin",
|
|
27
|
-
username: "superadmin",
|
|
28
|
-
},
|
|
29
|
-
extend_users: {
|
|
30
|
-
fields: {
|
|
31
|
-
name: {
|
|
32
|
-
type: "string",
|
|
33
|
-
length: 255,
|
|
34
|
-
},
|
|
35
|
-
username: {
|
|
36
|
-
type: "string",
|
|
37
|
-
length: 255,
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
roles: {
|
|
42
|
-
public: {
|
|
43
|
-
permissions: {
|
|
44
|
-
auth_users: {
|
|
45
|
-
read: true,
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
}),
|
|
51
|
-
],
|
|
52
|
-
collections: {},
|
|
53
|
-
};
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import type { Config } from "@lobb-js/core";
|
|
2
|
-
import auth from "../../index.ts";
|
|
3
|
-
|
|
4
|
-
export const authWithDifferentAdminCredsConfig: Config = {
|
|
5
|
-
project: {
|
|
6
|
-
name: "Lobb",
|
|
7
|
-
force_sync: true,
|
|
8
|
-
support_email: "support@lobb.com",
|
|
9
|
-
},
|
|
10
|
-
database: {
|
|
11
|
-
host: "localhost",
|
|
12
|
-
port: 5432,
|
|
13
|
-
username: "test",
|
|
14
|
-
password: "test",
|
|
15
|
-
database: "*",
|
|
16
|
-
|
|
17
|
-
},
|
|
18
|
-
web_server: {
|
|
19
|
-
host: "0.0.0.0",
|
|
20
|
-
port: 0,
|
|
21
|
-
},
|
|
22
|
-
extensions: [
|
|
23
|
-
auth({
|
|
24
|
-
admin: {
|
|
25
|
-
password: "123456",
|
|
26
|
-
email: "admin@wow.yey",
|
|
27
|
-
},
|
|
28
|
-
extend_users: {
|
|
29
|
-
fields: {
|
|
30
|
-
name: {
|
|
31
|
-
type: "string",
|
|
32
|
-
length: 255,
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
roles: {
|
|
37
|
-
public: {
|
|
38
|
-
permissions: {
|
|
39
|
-
auth_users: {
|
|
40
|
-
read: true,
|
|
41
|
-
},
|
|
42
|
-
articles: true,
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
author: {
|
|
46
|
-
permissions: {
|
|
47
|
-
articles: {
|
|
48
|
-
create: true,
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
}),
|
|
54
|
-
],
|
|
55
|
-
collections: {
|
|
56
|
-
articles: {
|
|
57
|
-
indexes: {},
|
|
58
|
-
fields: {
|
|
59
|
-
id: {
|
|
60
|
-
type: "integer",
|
|
61
|
-
},
|
|
62
|
-
title: {
|
|
63
|
-
type: "string",
|
|
64
|
-
length: 255,
|
|
65
|
-
},
|
|
66
|
-
body: {
|
|
67
|
-
type: "text",
|
|
68
|
-
},
|
|
69
|
-
published: {
|
|
70
|
-
type: "bool",
|
|
71
|
-
},
|
|
72
|
-
number_of_likes: {
|
|
73
|
-
type: "integer",
|
|
74
|
-
},
|
|
75
|
-
user_id: {
|
|
76
|
-
type: "integer",
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
};
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import type { Config } from "@lobb-js/core";
|
|
2
|
-
import auth from "../../index.ts";
|
|
3
|
-
|
|
4
|
-
export const authWithExtendUsersConfig: Config = {
|
|
5
|
-
project: {
|
|
6
|
-
name: "Lobb",
|
|
7
|
-
force_sync: true,
|
|
8
|
-
support_email: "support@lobb.com",
|
|
9
|
-
},
|
|
10
|
-
database: {
|
|
11
|
-
host: "localhost",
|
|
12
|
-
port: 5432,
|
|
13
|
-
username: "test",
|
|
14
|
-
password: "test",
|
|
15
|
-
database: "*",
|
|
16
|
-
|
|
17
|
-
},
|
|
18
|
-
web_server: {
|
|
19
|
-
host: "0.0.0.0",
|
|
20
|
-
port: 0,
|
|
21
|
-
},
|
|
22
|
-
extensions: [
|
|
23
|
-
auth({
|
|
24
|
-
admin: {
|
|
25
|
-
password: "admin",
|
|
26
|
-
email: "admin@example.com",
|
|
27
|
-
},
|
|
28
|
-
roles: {
|
|
29
|
-
public: {
|
|
30
|
-
permissions: {
|
|
31
|
-
auth_users: true,
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
extend_users: {
|
|
36
|
-
fields: {
|
|
37
|
-
name: {
|
|
38
|
-
type: "string",
|
|
39
|
-
length: 255,
|
|
40
|
-
},
|
|
41
|
-
bio: {
|
|
42
|
-
type: "text",
|
|
43
|
-
},
|
|
44
|
-
language: {
|
|
45
|
-
type: "string",
|
|
46
|
-
length: 255,
|
|
47
|
-
enum: ["en", "ar", "tr"],
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
}),
|
|
52
|
-
],
|
|
53
|
-
collections: {
|
|
54
|
-
articles: {
|
|
55
|
-
indexes: {},
|
|
56
|
-
fields: {
|
|
57
|
-
id: {
|
|
58
|
-
type: "integer",
|
|
59
|
-
},
|
|
60
|
-
title: {
|
|
61
|
-
type: "string",
|
|
62
|
-
length: 255,
|
|
63
|
-
},
|
|
64
|
-
body: {
|
|
65
|
-
type: "text",
|
|
66
|
-
},
|
|
67
|
-
published: {
|
|
68
|
-
type: "bool",
|
|
69
|
-
},
|
|
70
|
-
number_of_likes: {
|
|
71
|
-
type: "integer",
|
|
72
|
-
},
|
|
73
|
-
user_id: {
|
|
74
|
-
type: "integer",
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
};
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import type { Config } from "@lobb-js/core";
|
|
2
|
-
import auth from "../../index.ts";
|
|
3
|
-
|
|
4
|
-
export const authWithRefreshTokenConfig: Config = {
|
|
5
|
-
project: {
|
|
6
|
-
name: "Lobb",
|
|
7
|
-
force_sync: true,
|
|
8
|
-
support_email: "support@lobb.com",
|
|
9
|
-
},
|
|
10
|
-
database: {
|
|
11
|
-
host: "localhost",
|
|
12
|
-
port: 5432,
|
|
13
|
-
username: "test",
|
|
14
|
-
password: "test",
|
|
15
|
-
database: "*",
|
|
16
|
-
|
|
17
|
-
},
|
|
18
|
-
web_server: {
|
|
19
|
-
host: "0.0.0.0",
|
|
20
|
-
port: 0,
|
|
21
|
-
},
|
|
22
|
-
extensions: [
|
|
23
|
-
auth({
|
|
24
|
-
admin: {
|
|
25
|
-
password: "admin",
|
|
26
|
-
email: "admin@test.com",
|
|
27
|
-
},
|
|
28
|
-
extend_users: {
|
|
29
|
-
fields: {
|
|
30
|
-
name: {
|
|
31
|
-
type: "string",
|
|
32
|
-
length: 255,
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
roles: {
|
|
37
|
-
public: {
|
|
38
|
-
permissions: {
|
|
39
|
-
auth_users: {
|
|
40
|
-
read: true,
|
|
41
|
-
},
|
|
42
|
-
articles: {
|
|
43
|
-
create: true,
|
|
44
|
-
delete: true,
|
|
45
|
-
update: true,
|
|
46
|
-
read: false,
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
author: {
|
|
51
|
-
permissions: {
|
|
52
|
-
articles: {
|
|
53
|
-
create: true,
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
}),
|
|
59
|
-
],
|
|
60
|
-
collections: {
|
|
61
|
-
articles: {
|
|
62
|
-
indexes: {},
|
|
63
|
-
fields: {
|
|
64
|
-
id: {
|
|
65
|
-
type: "integer",
|
|
66
|
-
},
|
|
67
|
-
title: {
|
|
68
|
-
type: "string",
|
|
69
|
-
length: 255,
|
|
70
|
-
},
|
|
71
|
-
body: {
|
|
72
|
-
type: "text",
|
|
73
|
-
},
|
|
74
|
-
published: {
|
|
75
|
-
type: "bool",
|
|
76
|
-
},
|
|
77
|
-
number_of_likes: {
|
|
78
|
-
type: "integer",
|
|
79
|
-
},
|
|
80
|
-
user_id: {
|
|
81
|
-
type: "integer",
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
};
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import type { Config } from "@lobb-js/core";
|
|
2
|
-
import { mail } from "@lobb-js/lobb-mail-ext";
|
|
3
|
-
import auth from "../../index.ts";
|
|
4
|
-
|
|
5
|
-
export const authWithShortAccessTokenOnlyConfig: Config = {
|
|
6
|
-
project: {
|
|
7
|
-
name: "Lobb",
|
|
8
|
-
force_sync: true,
|
|
9
|
-
support_email: "support@lobb.com",
|
|
10
|
-
},
|
|
11
|
-
database: {
|
|
12
|
-
host: "localhost",
|
|
13
|
-
port: 5432,
|
|
14
|
-
username: "test",
|
|
15
|
-
password: "test",
|
|
16
|
-
database: "*",
|
|
17
|
-
|
|
18
|
-
},
|
|
19
|
-
web_server: {
|
|
20
|
-
host: "0.0.0.0",
|
|
21
|
-
port: 0,
|
|
22
|
-
},
|
|
23
|
-
extensions: [
|
|
24
|
-
mail({
|
|
25
|
-
transporter: {
|
|
26
|
-
host: "127.0.0.1",
|
|
27
|
-
port: 2525,
|
|
28
|
-
secure: false,
|
|
29
|
-
ignoreTLS: true,
|
|
30
|
-
},
|
|
31
|
-
}),
|
|
32
|
-
auth({
|
|
33
|
-
admin: {
|
|
34
|
-
password: "admin",
|
|
35
|
-
email: "admin@test.com",
|
|
36
|
-
},
|
|
37
|
-
extend_users: {
|
|
38
|
-
fields: {
|
|
39
|
-
name: {
|
|
40
|
-
type: "string",
|
|
41
|
-
length: 255,
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
roles: {
|
|
46
|
-
public: {
|
|
47
|
-
permissions: {
|
|
48
|
-
auth_users: {
|
|
49
|
-
read: true,
|
|
50
|
-
},
|
|
51
|
-
articles: {
|
|
52
|
-
create: true,
|
|
53
|
-
delete: true,
|
|
54
|
-
update: true,
|
|
55
|
-
read: false,
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
author: {
|
|
60
|
-
permissions: {
|
|
61
|
-
articles: {
|
|
62
|
-
create: true,
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
}),
|
|
68
|
-
],
|
|
69
|
-
collections: {
|
|
70
|
-
articles: {
|
|
71
|
-
indexes: {},
|
|
72
|
-
fields: {
|
|
73
|
-
id: {
|
|
74
|
-
type: "integer",
|
|
75
|
-
},
|
|
76
|
-
title: {
|
|
77
|
-
type: "string",
|
|
78
|
-
length: 255,
|
|
79
|
-
},
|
|
80
|
-
body: {
|
|
81
|
-
type: "text",
|
|
82
|
-
},
|
|
83
|
-
published: {
|
|
84
|
-
type: "bool",
|
|
85
|
-
},
|
|
86
|
-
number_of_likes: {
|
|
87
|
-
type: "integer",
|
|
88
|
-
},
|
|
89
|
-
user_id: {
|
|
90
|
-
type: "integer",
|
|
91
|
-
},
|
|
92
|
-
},
|
|
93
|
-
},
|
|
94
|
-
},
|
|
95
|
-
};
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import type { Config } from "@lobb-js/core";
|
|
2
|
-
import auth from "../../index.ts";
|
|
3
|
-
|
|
4
|
-
export const authWithShortTimeRefreshTokenConfig: Config = {
|
|
5
|
-
project: {
|
|
6
|
-
name: "Lobb",
|
|
7
|
-
force_sync: true,
|
|
8
|
-
support_email: "support@lobb.com",
|
|
9
|
-
},
|
|
10
|
-
database: {
|
|
11
|
-
host: "localhost",
|
|
12
|
-
port: 5432,
|
|
13
|
-
username: "test",
|
|
14
|
-
password: "test",
|
|
15
|
-
database: "*",
|
|
16
|
-
|
|
17
|
-
},
|
|
18
|
-
web_server: {
|
|
19
|
-
host: "0.0.0.0",
|
|
20
|
-
port: 0,
|
|
21
|
-
},
|
|
22
|
-
extensions: [
|
|
23
|
-
auth({
|
|
24
|
-
admin: {
|
|
25
|
-
password: "admin",
|
|
26
|
-
email: "admin@test.com",
|
|
27
|
-
},
|
|
28
|
-
extend_users: {
|
|
29
|
-
fields: {
|
|
30
|
-
name: {
|
|
31
|
-
type: "string",
|
|
32
|
-
length: 255,
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
roles: {
|
|
37
|
-
public: {
|
|
38
|
-
permissions: {
|
|
39
|
-
auth_users: {
|
|
40
|
-
read: true,
|
|
41
|
-
},
|
|
42
|
-
articles: {
|
|
43
|
-
create: true,
|
|
44
|
-
delete: true,
|
|
45
|
-
update: true,
|
|
46
|
-
read: false,
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
author: {
|
|
51
|
-
permissions: {
|
|
52
|
-
articles: {
|
|
53
|
-
create: true,
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
}),
|
|
59
|
-
],
|
|
60
|
-
collections: {
|
|
61
|
-
articles: {
|
|
62
|
-
indexes: {},
|
|
63
|
-
fields: {
|
|
64
|
-
id: {
|
|
65
|
-
type: "integer",
|
|
66
|
-
},
|
|
67
|
-
title: {
|
|
68
|
-
type: "string",
|
|
69
|
-
length: 255,
|
|
70
|
-
},
|
|
71
|
-
body: {
|
|
72
|
-
type: "text",
|
|
73
|
-
},
|
|
74
|
-
published: {
|
|
75
|
-
type: "bool",
|
|
76
|
-
},
|
|
77
|
-
number_of_likes: {
|
|
78
|
-
type: "integer",
|
|
79
|
-
},
|
|
80
|
-
user_id: {
|
|
81
|
-
type: "integer",
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
};
|