@madauth/server 0.2.0-beta.2 → 0.3.0-beta.2
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/bin.js +99 -32
- package/dist/{chunk-6EJDVZCD.js → chunk-3QRKWLR7.js} +10 -2
- package/dist/{chunk-CNL562LZ.js → chunk-56MOVFO4.js} +24 -2
- package/dist/{chunk-XNBWZZHT.js → chunk-CD7Y4T66.js} +11 -9
- package/dist/{chunk-7CTAB3QV.js → chunk-DCDTO5LG.js} +2 -2
- package/dist/{chunk-YALS7OMV.js → chunk-DVVBIFIV.js} +222 -122
- package/dist/{chunk-5CKEMC6M.js → chunk-TI35AZ2U.js} +227 -88
- package/dist/{config-BkxADgtp.d.ts → config-Dg2fZuWR.d.ts} +7 -6
- package/dist/dynamodb.js +1 -1
- package/dist/entry/azure.d.ts +3 -3
- package/dist/entry/azure.js +4 -4
- package/dist/entry/lambda.d.ts +3 -3
- package/dist/entry/lambda.js +4 -4
- package/dist/entry/node.d.ts +3 -3
- package/dist/entry/node.js +4 -4
- package/dist/index.d.ts +30 -7
- package/dist/index.js +15 -7
- package/dist/{schema-BSgYVRpd.d.ts → schema-3yhCc2jH.d.ts} +17 -9
- package/dist/sqlite.js +2 -2
- package/dist/standalone/azure.mjs +847 -597
- package/dist/standalone/lambda.mjs +847 -597
- package/dist/standalone/main.mjs +594 -344
- package/dist/store/dynamodb.d.ts +1 -1
- package/dist/store/sqlite.d.ts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +2 -0
- package/dist/user-BMWEWREH.d.ts +12 -0
- package/dist/verify.d.ts +1 -1
- package/dist/verify.js +1 -1
- package/dist/{webhook-ltwulgcB.d.ts → webhook-j5u9Kv9l.d.ts} +1 -1
- package/dist/webhook.d.ts +1 -1
- package/dist/webhook.js +1 -1
- package/package.json +1 -1
- package/dist/user-C1A3BfOo.d.ts +0 -12
package/dist/index.js
CHANGED
|
@@ -3,27 +3,33 @@ import {
|
|
|
3
3
|
createTablesSql,
|
|
4
4
|
tableName,
|
|
5
5
|
upgradeTablesSql
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-56MOVFO4.js";
|
|
7
7
|
import {
|
|
8
8
|
madauthSchema
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-CD7Y4T66.js";
|
|
10
10
|
import {
|
|
11
11
|
REDIRECT_ERROR_PARAM,
|
|
12
12
|
createApp
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
13
|
+
} from "./chunk-DVVBIFIV.js";
|
|
14
|
+
import "./chunk-DCDTO5LG.js";
|
|
15
15
|
import {
|
|
16
|
+
ADMIN_ROLE,
|
|
16
17
|
ConfigError,
|
|
18
|
+
SIGN_IN_METHODS,
|
|
17
19
|
envVars,
|
|
18
|
-
loadConfig
|
|
19
|
-
|
|
20
|
+
loadConfig,
|
|
21
|
+
parseClaims,
|
|
22
|
+
parseRoles
|
|
23
|
+
} from "./chunk-TI35AZ2U.js";
|
|
20
24
|
import {
|
|
21
25
|
generateSigningKey
|
|
22
26
|
} from "./chunk-JDQLSL36.js";
|
|
23
|
-
import "./chunk-
|
|
27
|
+
import "./chunk-3QRKWLR7.js";
|
|
24
28
|
export {
|
|
29
|
+
ADMIN_ROLE,
|
|
25
30
|
ConfigError,
|
|
26
31
|
REDIRECT_ERROR_PARAM,
|
|
32
|
+
SIGN_IN_METHODS,
|
|
27
33
|
columnName,
|
|
28
34
|
createApp,
|
|
29
35
|
createTablesSql,
|
|
@@ -31,6 +37,8 @@ export {
|
|
|
31
37
|
generateSigningKey,
|
|
32
38
|
loadConfig,
|
|
33
39
|
madauthSchema,
|
|
40
|
+
parseClaims,
|
|
41
|
+
parseRoles,
|
|
34
42
|
tableName,
|
|
35
43
|
upgradeTablesSql
|
|
36
44
|
};
|
|
@@ -43,8 +43,9 @@ interface Schema {
|
|
|
43
43
|
}
|
|
44
44
|
/** The records madAuth stores. Timestamps are milliseconds since 1970. */
|
|
45
45
|
declare const madauthSchema: {
|
|
46
|
-
readonly version:
|
|
46
|
+
readonly version: 4;
|
|
47
47
|
readonly models: {
|
|
48
|
+
/** Someone who signed in, whichever way: the e-mail address is the identity shared by the sign-in methods. */
|
|
48
49
|
readonly user: {
|
|
49
50
|
readonly fields: {
|
|
50
51
|
readonly id: {
|
|
@@ -75,12 +76,17 @@ declare const madauthSchema: {
|
|
|
75
76
|
readonly wrongCodes: {
|
|
76
77
|
readonly type: "number";
|
|
77
78
|
};
|
|
79
|
+
/** What admins attached to the user, as JSON, e.g. `{"roles":["admin"]}` (since version 4). */
|
|
80
|
+
readonly claims: {
|
|
81
|
+
readonly type: "string";
|
|
82
|
+
readonly nullable: true;
|
|
83
|
+
};
|
|
78
84
|
readonly createdAt: {
|
|
79
85
|
readonly type: "number";
|
|
80
86
|
};
|
|
81
87
|
};
|
|
82
88
|
};
|
|
83
|
-
/** How a user signs in. `key` is
|
|
89
|
+
/** How a user signs in. `key` is `password:<userId>` or `google:<sub>`; later e.g. `totp:<userId>`. */
|
|
84
90
|
readonly account: {
|
|
85
91
|
readonly fields: {
|
|
86
92
|
readonly id: {
|
|
@@ -105,6 +111,11 @@ declare const madauthSchema: {
|
|
|
105
111
|
readonly lockedUntil: {
|
|
106
112
|
readonly type: "number";
|
|
107
113
|
};
|
|
114
|
+
/** The address the provider reported at the last sign-in, e.g. Google's current primary address (since version 4). */
|
|
115
|
+
readonly email: {
|
|
116
|
+
readonly type: "string";
|
|
117
|
+
readonly nullable: true;
|
|
118
|
+
};
|
|
108
119
|
readonly createdAt: {
|
|
109
120
|
readonly type: "number";
|
|
110
121
|
};
|
|
@@ -135,23 +146,20 @@ declare const madauthSchema: {
|
|
|
135
146
|
};
|
|
136
147
|
};
|
|
137
148
|
};
|
|
138
|
-
/**
|
|
139
|
-
|
|
140
|
-
* apply whichever way its owner signs in. `roles` holds the names separated by spaces.
|
|
141
|
-
*/
|
|
142
|
-
readonly role: {
|
|
149
|
+
/** A setting admins change at runtime, as JSON (since version 4), e.g. `methods`: which sign-in methods are on. */
|
|
150
|
+
readonly setting: {
|
|
143
151
|
readonly fields: {
|
|
144
152
|
readonly id: {
|
|
145
153
|
readonly type: "string";
|
|
146
154
|
readonly primaryKey: true;
|
|
147
155
|
};
|
|
148
|
-
readonly
|
|
156
|
+
readonly value: {
|
|
149
157
|
readonly type: "string";
|
|
150
158
|
};
|
|
151
159
|
readonly updatedAt: {
|
|
152
160
|
readonly type: "number";
|
|
153
161
|
};
|
|
154
|
-
/** The address of the admin who set
|
|
162
|
+
/** The address of the admin who set it; empty when set from the command line. */
|
|
155
163
|
readonly updatedBy: {
|
|
156
164
|
readonly type: "string";
|
|
157
165
|
readonly nullable: true;
|
package/dist/sqlite.js
CHANGED
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
createTablesSql,
|
|
4
4
|
tableName,
|
|
5
5
|
upgradeTablesSql
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-56MOVFO4.js";
|
|
7
7
|
import {
|
|
8
8
|
madauthSchema
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-CD7Y4T66.js";
|
|
10
10
|
|
|
11
11
|
// src/store/sqlite.ts
|
|
12
12
|
function createSqliteAdapter(path) {
|