@cedarjs/auth-dbauth-setup 7.0.1-next.467 → 7.1.0-rc.32
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/setup.d.ts +0 -1
- package/dist/setup.d.ts.map +1 -1
- package/dist/setup.js +0 -5
- package/dist/setupData.d.ts +1 -1
- package/dist/setupData.d.ts.map +1 -1
- package/dist/setupData.js +1 -3
- package/dist/setupHandler.d.ts +1 -1
- package/dist/setupHandler.d.ts.map +1 -1
- package/dist/setupHandler.js +4 -50
- package/dist/shared.js +1 -1
- package/dist/templates/api/functions/auth.ts.template +0 -37
- package/dist/templates/api/functions/auth.webAuthn.ts.template +0 -37
- package/dist/webAuthn.setupData.d.ts +1 -1
- package/dist/webAuthn.setupData.d.ts.map +1 -1
- package/dist/webAuthn.setupData.js +3 -4
- package/package.json +6 -6
- package/dist/oauth.setupData.d.ts +0 -57
- package/dist/oauth.setupData.d.ts.map +0 -1
- package/dist/oauth.setupData.js +0 -336
- package/dist/templates/api/functions/auth.oauth.ts.template +0 -364
- package/dist/templates/api/functions/auth.webAuthn.oauth.ts.template +0 -382
package/dist/setup.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ export declare const description = "Set up auth for for dbAuth";
|
|
|
4
4
|
export declare function builder(yargs: Argv): void;
|
|
5
5
|
export interface Args {
|
|
6
6
|
webauthn: boolean | null;
|
|
7
|
-
oauth?: string | null;
|
|
8
7
|
createUserModel: boolean | null;
|
|
9
8
|
generateAuthPages: boolean | null;
|
|
10
9
|
force: boolean;
|
package/dist/setup.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AAEjC,eAAO,MAAM,OAAO,WAAW,CAAA;AAC/B,eAAO,MAAM,WAAW,+BAA+B,CAAA;AAEvD,wBAAgB,OAAO,CAAC,KAAK,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AAEjC,eAAO,MAAM,OAAO,WAAW,CAAA;AAC/B,eAAO,MAAM,WAAW,+BAA+B,CAAA;AAEvD,wBAAgB,OAAO,CAAC,KAAK,EAAE,IAAI,QAgClC;AAED,MAAM,WAAW,IAAI;IACnB,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAA;IACxB,eAAe,EAAE,OAAO,GAAG,IAAI,CAAA;IAC/B,iBAAiB,EAAE,OAAO,GAAG,IAAI,CAAA;IACjC,KAAK,EAAE,OAAO,CAAA;CACf;AAED,eAAO,MAAM,OAAO,GAAU,SAAS,IAAI,kBAG1C,CAAA"}
|
package/dist/setup.js
CHANGED
|
@@ -12,11 +12,6 @@ function builder(yargs) {
|
|
|
12
12
|
default: null,
|
|
13
13
|
description: "Include WebAuthn support (TouchID/FaceID)",
|
|
14
14
|
type: "boolean"
|
|
15
|
-
}).option("oauth", {
|
|
16
|
-
alias: "o",
|
|
17
|
-
default: null,
|
|
18
|
-
description: "Include OAuth support for the given comma-separated providers (google, github), e.g. --oauth google,github",
|
|
19
|
-
type: "string"
|
|
20
15
|
}).option("createUserModel", {
|
|
21
16
|
alias: "u",
|
|
22
17
|
default: null,
|
package/dist/setupData.d.ts
CHANGED
package/dist/setupData.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setupData.d.ts","sourceRoot":"","sources":["../src/setupData.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"setupData.d.ts","sourceRoot":"","sources":["../src/setupData.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAM5D,eAAO,MAAM,SAAS;;;CAKrB,CAAA;AAED,eAAO,MAAM,mBAAmB;;gBAEZ,gBAAgB;CAoBnC,CAAA;AAGD,eAAO,MAAM,KAAK,UAsDjB,CAAA;AAED,eAAO,MAAM,qBAAqB,UAwBjC,CAAA;AAED,eAAO,MAAM,YAAY,UAMxB,CAAA;AAED,eAAO,MAAM,cAAc,UAO1B,CAAA"}
|
package/dist/setupData.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import crypto from "node:crypto";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import { colors } from "@cedarjs/cli-helpers
|
|
4
|
-
import { getPaths } from "@cedarjs/cli-helpers/paths";
|
|
5
|
-
import { addEnvVarTask } from "@cedarjs/cli-helpers/project";
|
|
3
|
+
import { getPaths, colors, addEnvVarTask } from "@cedarjs/cli-helpers";
|
|
6
4
|
import { addModels, functionsPath, hasModel, libPath } from "./shared.js";
|
|
7
5
|
const secret = crypto.randomBytes(32).toString("base64");
|
|
8
6
|
const extraTask = addEnvVarTask(
|
package/dist/setupHandler.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Args } from './setup.js';
|
|
2
|
-
export declare function handler({ webauthn,
|
|
2
|
+
export declare function handler({ webauthn, createUserModel, generateAuthPages, force: forceArg, }: Args): Promise<void>;
|
|
3
3
|
export declare const createAuthDecoderFunction: {
|
|
4
4
|
title: string;
|
|
5
5
|
task: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setupHandler.d.ts","sourceRoot":"","sources":["../src/setupHandler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"setupHandler.d.ts","sourceRoot":"","sources":["../src/setupHandler.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAwBtC,wBAAsB,OAAO,CAAC,EAC5B,QAAQ,EACR,eAAe,EACf,iBAAiB,EACjB,KAAK,EAAE,QAAQ,GAChB,EAAE,IAAI,iBAyEN;AAsED,eAAO,MAAM,yBAAyB;;;CAuCrC,CAAA"}
|
package/dist/setupHandler.js
CHANGED
|
@@ -1,20 +1,7 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import prompts from "prompts";
|
|
4
|
-
import { standardAuthHandler } from "@cedarjs/cli-helpers
|
|
5
|
-
import { getGraphqlPath } from "@cedarjs/cli-helpers/project";
|
|
6
|
-
import { requireTTYOrExit } from "@cedarjs/cli-helpers/tty";
|
|
7
|
-
import {
|
|
8
|
-
apiPackages as oauthApiPackages,
|
|
9
|
-
configureOAuthProvidersTask,
|
|
10
|
-
createUserModelTask as oauthCreateUserModelTask,
|
|
11
|
-
envVarNotes as oauthEnvVarNotes,
|
|
12
|
-
noteGenerate as oauthNoteGenerate,
|
|
13
|
-
notes as oauthNotes,
|
|
14
|
-
parseOAuthProviders,
|
|
15
|
-
webAuthnCreateUserModelTask as webAuthnOauthCreateUserModelTask,
|
|
16
|
-
webAuthnOauthNotes
|
|
17
|
-
} from "./oauth.setupData.js";
|
|
4
|
+
import { getGraphqlPath, standardAuthHandler } from "@cedarjs/cli-helpers";
|
|
18
5
|
import {
|
|
19
6
|
notes,
|
|
20
7
|
noteGenerate,
|
|
@@ -39,7 +26,6 @@ import {
|
|
|
39
26
|
} from "./webAuthn.setupData.js";
|
|
40
27
|
async function handler({
|
|
41
28
|
webauthn,
|
|
42
|
-
oauth,
|
|
43
29
|
createUserModel,
|
|
44
30
|
generateAuthPages,
|
|
45
31
|
force: forceArg
|
|
@@ -51,22 +37,10 @@ async function handler({
|
|
|
51
37
|
)
|
|
52
38
|
);
|
|
53
39
|
const webAuthn = await shouldIncludeWebAuthn(webauthn);
|
|
54
|
-
const oauthProviders = parseOAuthProviders(oauth);
|
|
55
|
-
const includeOAuth = oauthProviders.length > 0;
|
|
56
40
|
const createDbUserModel = await shouldCreateUserModel(createUserModel);
|
|
57
41
|
const generateDbAuthPages = await shouldGenerateDbAuthPages(generateAuthPages);
|
|
58
42
|
const oneMoreThing = [];
|
|
59
|
-
if (webAuthn
|
|
60
|
-
if (createDbUserModel) {
|
|
61
|
-
oneMoreThing.push(...notesCreatedUserModel);
|
|
62
|
-
} else {
|
|
63
|
-
oneMoreThing.push(...webAuthnOauthNotes());
|
|
64
|
-
}
|
|
65
|
-
oneMoreThing.push(...oauthEnvVarNotes(oauthProviders));
|
|
66
|
-
if (!generateDbAuthPages) {
|
|
67
|
-
oneMoreThing.push(...webAuthnNoteGenerate);
|
|
68
|
-
}
|
|
69
|
-
} else if (webAuthn) {
|
|
43
|
+
if (webAuthn) {
|
|
70
44
|
if (createDbUserModel) {
|
|
71
45
|
oneMoreThing.push(...notesCreatedUserModel);
|
|
72
46
|
} else {
|
|
@@ -75,16 +49,6 @@ async function handler({
|
|
|
75
49
|
if (!generateDbAuthPages) {
|
|
76
50
|
oneMoreThing.push(...webAuthnNoteGenerate);
|
|
77
51
|
}
|
|
78
|
-
} else if (includeOAuth) {
|
|
79
|
-
if (createDbUserModel) {
|
|
80
|
-
oneMoreThing.push(...notesCreatedUserModel);
|
|
81
|
-
} else {
|
|
82
|
-
oneMoreThing.push(...oauthNotes());
|
|
83
|
-
}
|
|
84
|
-
oneMoreThing.push(...oauthEnvVarNotes(oauthProviders));
|
|
85
|
-
if (!generateDbAuthPages) {
|
|
86
|
-
oneMoreThing.push(...oauthNoteGenerate);
|
|
87
|
-
}
|
|
88
52
|
} else {
|
|
89
53
|
if (createDbUserModel) {
|
|
90
54
|
oneMoreThing.push(...notesCreatedUserModel);
|
|
@@ -98,12 +62,8 @@ async function handler({
|
|
|
98
62
|
oneMoreThing.push(...notePrivateSet);
|
|
99
63
|
let createDbUserModelTask = void 0;
|
|
100
64
|
if (createDbUserModel) {
|
|
101
|
-
if (webAuthn
|
|
102
|
-
createDbUserModelTask = webAuthnOauthCreateUserModelTask;
|
|
103
|
-
} else if (webAuthn) {
|
|
65
|
+
if (webAuthn) {
|
|
104
66
|
createDbUserModelTask = webAuthnCreateUserModelTask;
|
|
105
|
-
} else if (includeOAuth) {
|
|
106
|
-
createDbUserModelTask = oauthCreateUserModelTask;
|
|
107
67
|
} else {
|
|
108
68
|
createDbUserModelTask = createUserModelTask;
|
|
109
69
|
}
|
|
@@ -114,21 +74,18 @@ async function handler({
|
|
|
114
74
|
provider: "dbAuth",
|
|
115
75
|
authDecoderImport: "import { createAuthDecoder } from '@cedarjs/auth-dbauth-api'",
|
|
116
76
|
webAuthn,
|
|
117
|
-
oauth: includeOAuth,
|
|
118
77
|
webPackages: [
|
|
119
78
|
`@cedarjs/auth-dbauth-web@${version}`,
|
|
120
79
|
...webAuthn ? webAuthnWebPackages : []
|
|
121
80
|
],
|
|
122
81
|
apiPackages: [
|
|
123
82
|
`@cedarjs/auth-dbauth-api@${version}`,
|
|
124
|
-
...webAuthn ? webAuthnApiPackages : []
|
|
125
|
-
...includeOAuth ? [`@cedarjs/auth-dbauth-oauth@${version}`, ...oauthApiPackages] : []
|
|
83
|
+
...webAuthn ? webAuthnApiPackages : []
|
|
126
84
|
],
|
|
127
85
|
extraTasks: [
|
|
128
86
|
webAuthn ? webAuthnExtraTask : extraTask,
|
|
129
87
|
createDbUserModelTask,
|
|
130
88
|
createAuthDecoderFunction,
|
|
131
|
-
includeOAuth ? configureOAuthProvidersTask(oauthProviders) : void 0,
|
|
132
89
|
generateDbAuthPages ? generateAuthPagesTask(createDbUserModel) : void 0
|
|
133
90
|
],
|
|
134
91
|
notes: oneMoreThing
|
|
@@ -136,7 +93,6 @@ async function handler({
|
|
|
136
93
|
}
|
|
137
94
|
async function shouldIncludeWebAuthn(webauthn) {
|
|
138
95
|
if (webauthn === null) {
|
|
139
|
-
requireTTYOrExit("--webauthn or --webauthn=false");
|
|
140
96
|
const webAuthnResponse = await prompts({
|
|
141
97
|
type: "confirm",
|
|
142
98
|
name: "answer",
|
|
@@ -155,7 +111,6 @@ async function shouldCreateUserModel(createUserModel) {
|
|
|
155
111
|
return true;
|
|
156
112
|
}
|
|
157
113
|
if (createUserModel === null && !hasUserModel) {
|
|
158
|
-
requireTTYOrExit("--createUserModel or --createUserModel=false");
|
|
159
114
|
const createModelResponse = await prompts({
|
|
160
115
|
type: "confirm",
|
|
161
116
|
name: "answer",
|
|
@@ -168,7 +123,6 @@ async function shouldCreateUserModel(createUserModel) {
|
|
|
168
123
|
}
|
|
169
124
|
async function shouldGenerateDbAuthPages(generateAuthPages) {
|
|
170
125
|
if (generateAuthPages === null && !hasAuthPages()) {
|
|
171
|
-
requireTTYOrExit("--generateAuthPages or --generateAuthPages=false");
|
|
172
126
|
const generateAuthPagesResponse = await prompts({
|
|
173
127
|
type: "confirm",
|
|
174
128
|
name: "answer",
|
package/dist/shared.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import prismaInternals from "@prisma/internals";
|
|
4
|
+
import { getPaths } from "@cedarjs/cli-helpers";
|
|
4
5
|
import { runBin } from "@cedarjs/cli-helpers/packageManager/exec";
|
|
5
|
-
import { getPaths } from "@cedarjs/cli-helpers/paths";
|
|
6
6
|
import {
|
|
7
7
|
processPagesDir,
|
|
8
8
|
getSchemaPath,
|
|
@@ -102,42 +102,6 @@ export const handler = async (
|
|
|
102
102
|
},
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
const changePasswordOptions: DbAuthHandlerOptions['changePassword'] = {
|
|
106
|
-
// handler() is invoked after a logged in user has entered their current
|
|
107
|
-
// password correctly and the new password has been saved to the database.
|
|
108
|
-
// This is a good place to let the user know, by email for example, that
|
|
109
|
-
// their password was changed.
|
|
110
|
-
//
|
|
111
|
-
// Returning anything truthy keeps the user logged in. Return `false` to
|
|
112
|
-
// log them out, and in the Change Password page redirect the user to the
|
|
113
|
-
// login page.
|
|
114
|
-
handler: (_user) => {
|
|
115
|
-
// TODO: Send an email/message to the user letting them know that their
|
|
116
|
-
// password was changed. When you implement this, change `_user` to
|
|
117
|
-
// `user` in the function arguments above.
|
|
118
|
-
|
|
119
|
-
return true
|
|
120
|
-
},
|
|
121
|
-
|
|
122
|
-
// If `false` then the new password MUST be different from the current one
|
|
123
|
-
allowReusedPassword: false,
|
|
124
|
-
|
|
125
|
-
errors: {
|
|
126
|
-
// the current password was not provided
|
|
127
|
-
currentPasswordRequired: 'Current password is required',
|
|
128
|
-
// the new password was not provided
|
|
129
|
-
newPasswordRequired: 'New password is required',
|
|
130
|
-
// the current password is not correct
|
|
131
|
-
incorrectCurrentPassword: 'Current password is incorrect',
|
|
132
|
-
// the user doesn't have a password yet (they signed up with a third
|
|
133
|
-
// party login provider, for example)
|
|
134
|
-
passwordNotSet:
|
|
135
|
-
'This account does not have a password. Use "Forgot password" to set one',
|
|
136
|
-
// new password is the same as the current password
|
|
137
|
-
reusedPassword: 'Must choose a new password',
|
|
138
|
-
},
|
|
139
|
-
}
|
|
140
|
-
|
|
141
105
|
interface UserAttributes {
|
|
142
106
|
name: string
|
|
143
107
|
}
|
|
@@ -233,7 +197,6 @@ export const handler = async (
|
|
|
233
197
|
name: cookieName,
|
|
234
198
|
},
|
|
235
199
|
|
|
236
|
-
changePassword: changePasswordOptions,
|
|
237
200
|
forgotPassword: forgotPasswordOptions,
|
|
238
201
|
login: loginOptions,
|
|
239
202
|
resetPassword: resetPasswordOptions,
|
|
@@ -93,42 +93,6 @@ export const handler = async (
|
|
|
93
93
|
},
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
const changePasswordOptions: DbAuthHandlerOptions['changePassword'] = {
|
|
97
|
-
// handler() is invoked after a logged in user has entered their current
|
|
98
|
-
// password correctly and the new password has been saved to the database.
|
|
99
|
-
// This is a good place to let the user know, by email for example, that
|
|
100
|
-
// their password was changed.
|
|
101
|
-
//
|
|
102
|
-
// Returning anything truthy keeps the user logged in. Return `false` to
|
|
103
|
-
// log them out, and in the Change Password page redirect the user to the
|
|
104
|
-
// login page.
|
|
105
|
-
handler: (_user) => {
|
|
106
|
-
// TODO: Send an email/message to the user letting them know that their
|
|
107
|
-
// password was changed. When you implement this, change `_user` to
|
|
108
|
-
// `user` in the function arguments above.
|
|
109
|
-
|
|
110
|
-
return true
|
|
111
|
-
},
|
|
112
|
-
|
|
113
|
-
// If `false` then the new password MUST be different from the current one
|
|
114
|
-
allowReusedPassword: false,
|
|
115
|
-
|
|
116
|
-
errors: {
|
|
117
|
-
// the current password was not provided
|
|
118
|
-
currentPasswordRequired: 'Current password is required',
|
|
119
|
-
// the new password was not provided
|
|
120
|
-
newPasswordRequired: 'New password is required',
|
|
121
|
-
// the current password is not correct
|
|
122
|
-
incorrectCurrentPassword: 'Current password is incorrect',
|
|
123
|
-
// the user doesn't have a password yet (they signed up with a third
|
|
124
|
-
// party login provider, for example)
|
|
125
|
-
passwordNotSet:
|
|
126
|
-
'This account does not have a password. Use "Forgot password" to set one',
|
|
127
|
-
// new password is the same as the current password
|
|
128
|
-
reusedPassword: 'Must choose a new password',
|
|
129
|
-
},
|
|
130
|
-
}
|
|
131
|
-
|
|
132
96
|
interface UserAttributes {
|
|
133
97
|
name: string
|
|
134
98
|
}
|
|
@@ -223,7 +187,6 @@ export const handler = async (
|
|
|
223
187
|
name: cookieName,
|
|
224
188
|
},
|
|
225
189
|
|
|
226
|
-
changePassword: changePasswordOptions,
|
|
227
190
|
forgotPassword: forgotPasswordOptions,
|
|
228
191
|
login: loginOptions,
|
|
229
192
|
resetPassword: resetPasswordOptions,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuthGeneratorCtx } from '@cedarjs/cli-helpers
|
|
1
|
+
import type { AuthGeneratorCtx } from '@cedarjs/cli-helpers';
|
|
2
2
|
export { extraTask } from './setupData.js';
|
|
3
3
|
export declare const webPackages: string[];
|
|
4
4
|
export declare const apiPackages: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webAuthn.setupData.d.ts","sourceRoot":"","sources":["../src/webAuthn.setupData.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"webAuthn.setupData.d.ts","sourceRoot":"","sources":["../src/webAuthn.setupData.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAK5D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAG1C,eAAO,MAAM,WAAW,UAAkC,CAAA;AAG1D,eAAO,MAAM,WAAW,UAAiC,CAAA;AAEzD,eAAO,MAAM,mBAAmB;;gBAEZ,gBAAgB;CA+BnC,CAAA;AAGD,eAAO,MAAM,KAAK,UAoEjB,CAAA;AAED,eAAO,MAAM,YAAY,UAMxB,CAAA"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import { colors } from "@cedarjs/cli-helpers
|
|
3
|
-
import { getPaths } from "@cedarjs/cli-helpers/paths";
|
|
2
|
+
import { getPaths, colors } from "@cedarjs/cli-helpers";
|
|
4
3
|
import { addModels, functionsPath, hasModel, libPath } from "./shared.js";
|
|
5
4
|
import { extraTask } from "./setupData.js";
|
|
6
|
-
const webPackages = ["@simplewebauthn/browser@^
|
|
7
|
-
const apiPackages = ["@simplewebauthn/server@^
|
|
5
|
+
const webPackages = ["@simplewebauthn/browser@^10"];
|
|
6
|
+
const apiPackages = ["@simplewebauthn/server@^10"];
|
|
8
7
|
const createUserModelTask = {
|
|
9
8
|
title: "Creating model `User`...",
|
|
10
9
|
task: async (ctx) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/auth-dbauth-setup",
|
|
3
|
-
"version": "7.0
|
|
3
|
+
"version": "7.1.0-rc.32",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/cedarjs/cedar.git",
|
|
@@ -23,16 +23,16 @@
|
|
|
23
23
|
"test:watch": "yarn test --watch"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@cedarjs/cli-helpers": "7.0
|
|
27
|
-
"@cedarjs/project-config": "7.0
|
|
28
|
-
"@prisma/internals": "7.
|
|
26
|
+
"@cedarjs/cli-helpers": "7.1.0-rc.32",
|
|
27
|
+
"@cedarjs/project-config": "7.1.0-rc.32",
|
|
28
|
+
"@prisma/internals": "7.8.0",
|
|
29
29
|
"prompts": "2.4.2",
|
|
30
30
|
"termi-link": "1.1.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@cedarjs/framework-tools": "7.0
|
|
33
|
+
"@cedarjs/framework-tools": "7.1.0-rc.32",
|
|
34
34
|
"@types/yargs": "17.0.35",
|
|
35
|
-
"memfs": "4.
|
|
35
|
+
"memfs": "4.78.1",
|
|
36
36
|
"nodemon": "3.1.14",
|
|
37
37
|
"ts-dedent": "2.3.0",
|
|
38
38
|
"typescript": "5.9.3",
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import type { AuthGeneratorCtx } from '@cedarjs/cli-helpers/auth/setupHelpers';
|
|
2
|
-
/**
|
|
3
|
-
* The OAuth providers `cedar setup auth dbAuth --oauth` knows how to
|
|
4
|
-
* configure out of the box. Anything else is served by implementing the
|
|
5
|
-
* `OAuthStrategy` interface, documented at
|
|
6
|
-
* https://cedarjs.com/docs/auth/dbauth#oauth-custom-strategies
|
|
7
|
-
*/
|
|
8
|
-
export declare const KNOWN_OAUTH_PROVIDERS: readonly ["google", "github"];
|
|
9
|
-
export type OAuthProviderName = (typeof KNOWN_OAUTH_PROVIDERS)[number];
|
|
10
|
-
/**
|
|
11
|
-
* Parses the comma-separated value of `--oauth` into a deduped list of
|
|
12
|
-
* provider names, validating every entry against `KNOWN_OAUTH_PROVIDERS`.
|
|
13
|
-
*
|
|
14
|
-
* Returns an empty array when `oauth` is nullish (the flag wasn't passed).
|
|
15
|
-
* Some callers pass `null` explicitly for "flag absent"; others invoke the
|
|
16
|
-
* setup handler programmatically and simply omit the argument, which comes
|
|
17
|
-
* through as `undefined`. Both mean "OAuth disabled".
|
|
18
|
-
*/
|
|
19
|
-
export declare function parseOAuthProviders(oauth: string | null | undefined): OAuthProviderName[];
|
|
20
|
-
export declare const apiPackages: string[];
|
|
21
|
-
export declare const createUserModelTask: {
|
|
22
|
-
title: string;
|
|
23
|
-
task: (ctx: AuthGeneratorCtx) => Promise<void>;
|
|
24
|
-
};
|
|
25
|
-
export declare const webAuthnCreateUserModelTask: {
|
|
26
|
-
title: string;
|
|
27
|
-
task: (ctx: AuthGeneratorCtx) => Promise<void>;
|
|
28
|
-
};
|
|
29
|
-
export declare function envVarNotes(providers: OAuthProviderName[]): string[];
|
|
30
|
-
export declare function notes(): string[];
|
|
31
|
-
export declare function webAuthnOauthNotes(): string[];
|
|
32
|
-
export declare const noteGenerate: string[];
|
|
33
|
-
/**
|
|
34
|
-
* Strips the config for every OAuth provider that wasn't selected out of the
|
|
35
|
-
* `auth.oauth.ts`/`auth.webAuthn.oauth.ts` templates, and drops the marker
|
|
36
|
-
* comments around the config for every provider that was.
|
|
37
|
-
*
|
|
38
|
-
* The templates carry every known provider so there's a single source of
|
|
39
|
-
* truth for the generated file's shape; this function is what turns that
|
|
40
|
-
* into a file that only configures the providers the user actually asked
|
|
41
|
-
* for. It's a pure string transform, so re-running setup (which always
|
|
42
|
-
* starts from a fresh copy of the template) produces byte-identical output.
|
|
43
|
-
*
|
|
44
|
-
* Exported for testing.
|
|
45
|
-
*/
|
|
46
|
-
export declare function pruneOAuthProviders(content: string, providers: OAuthProviderName[]): string;
|
|
47
|
-
/**
|
|
48
|
-
* Rewrites the generated `functions/auth.ts` (or `.js`) in place so it only
|
|
49
|
-
* configures the OAuth providers the user selected with `--oauth`. Runs
|
|
50
|
-
* after `generateAuthApiFiles` has written the fresh, unpruned template, so
|
|
51
|
-
* every run starts from the same source and produces the same result.
|
|
52
|
-
*/
|
|
53
|
-
export declare function configureOAuthProvidersTask(providers: OAuthProviderName[]): {
|
|
54
|
-
title: string;
|
|
55
|
-
task: () => void;
|
|
56
|
-
};
|
|
57
|
-
//# sourceMappingURL=oauth.setupData.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"oauth.setupData.d.ts","sourceRoot":"","sources":["../src/oauth.setupData.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAA;AAO9E;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,+BAAgC,CAAA;AAElE,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAA;AAMtE;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAC/B,iBAAiB,EAAE,CAqCrB;AAGD,eAAO,MAAM,WAAW,UAAsB,CAAA;AAmB9C,eAAO,MAAM,mBAAmB;;gBAEZ,gBAAgB;CAqBnC,CAAA;AAED,eAAO,MAAM,2BAA2B;;gBAEpB,gBAAgB;CAgCnC,CAAA;AAOD,wBAAgB,WAAW,CAAC,SAAS,EAAE,iBAAiB,EAAE,YAWzD;AAuCD,wBAAgB,KAAK,aAkDpB;AAED,wBAAgB,kBAAkB,aAgEjC;AAED,eAAO,MAAM,YAAY,UAMxB,CAAA;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,iBAAiB,EAAE,UA2B/B;AAMD;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,SAAS,EAAE,iBAAiB,EAAE;;;EAsBzE"}
|