gipity 1.1.39 → 1.1.40
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/commands/project-auth.js +33 -15
- package/dist/commands/project-users.js +2 -2
- package/dist/index.js +34 -17
- package/package.json +1 -1
|
@@ -47,12 +47,13 @@ const SETUP_STEPS = {
|
|
|
47
47
|
'gipity project auth provider google --client-id <id> --client-secret <secret>',
|
|
48
48
|
],
|
|
49
49
|
apple: r => [
|
|
50
|
-
'Apple Developer > Certificates, Identifiers & Profiles >
|
|
51
|
-
'
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
'
|
|
55
|
-
'gipity project auth provider apple --
|
|
50
|
+
'Apple Developer > Certificates, Identifiers & Profiles > Keys > add a key with Sign in with Apple enabled.',
|
|
51
|
+
' Note its Key ID and download the .p8 file (only once). Your Team ID is on the Membership details page.',
|
|
52
|
+
'Web sign-in (the hosted sign-in page): Identifiers > add a Services ID. Its identifier is your client ID.',
|
|
53
|
+
` Enable Sign in with Apple on it, register your domain and the return URL: ${r}`,
|
|
54
|
+
'iOS app (native, POST /api/<guid>/auth/apple): enable Sign in with Apple on your App ID; its bundle ID is what you pass as --bundle-id.',
|
|
55
|
+
'gipity project auth provider apple --team-id <team> --key-id <key> --private-key-file AuthKey_XXXX.p8 [--client-id <services-id>] [--bundle-id <bundle-id> ...] [--require-nonce]',
|
|
56
|
+
' Pass every flag each time: this replaces the app\'s whole Apple setup.',
|
|
56
57
|
],
|
|
57
58
|
discord: r => [
|
|
58
59
|
'Discord Developer Portal > Applications > your application > OAuth2.',
|
|
@@ -68,6 +69,9 @@ function formatProvider(p) {
|
|
|
68
69
|
];
|
|
69
70
|
if (p.note)
|
|
70
71
|
lines.push(muted(p.note));
|
|
72
|
+
if (p.provider === 'apple' && p.bundle_ids) {
|
|
73
|
+
lines.push(`iOS bundle ids: ${p.bundle_ids.length ? p.bundle_ids.join(', ') : 'none'}${p.require_nonce ? ' (nonce required)' : ''}`);
|
|
74
|
+
}
|
|
71
75
|
lines.push('', `Redirect URI: ${p.redirect_uri}`, '', 'Use your own credentials:');
|
|
72
76
|
let n = 0;
|
|
73
77
|
for (const step of SETUP_STEPS[p.provider](p.redirect_uri)) {
|
|
@@ -92,13 +96,15 @@ Modes:
|
|
|
92
96
|
gipity Sign in with Gipity only (default)
|
|
93
97
|
app Users sign in to this app alone, without a Gipity account:
|
|
94
98
|
Google, Apple, Discord and email codes for web apps (the hosted sign-in
|
|
95
|
-
page / Gipity.auth.signIn)
|
|
96
|
-
|
|
99
|
+
page / Gipity.auth.signIn); native apps sign in over HTTPS with Steam
|
|
100
|
+
(POST /api/<guid>/auth/steam), guest devices (/auth/guest), Sign in with
|
|
101
|
+
Apple from iOS (/auth/apple) or email codes, and renew with /auth/refresh
|
|
97
102
|
both Either
|
|
98
103
|
|
|
99
104
|
Sign-in providers:
|
|
100
105
|
gipity project auth provider <google|apple|discord> show setup steps and the redirect URI
|
|
101
|
-
Google and Discord work at once on Gipity's shared credentials; Apple needs your own
|
|
106
|
+
Google and Discord work at once on Gipity's shared credentials; Apple needs your own
|
|
107
|
+
(a web Services ID, iOS bundle ids with --bundle-id, or both).
|
|
102
108
|
Manage the app's users: gipity project users
|
|
103
109
|
|
|
104
110
|
--unique-names on|off
|
|
@@ -156,7 +162,9 @@ See: gipity skill read steam-game`)
|
|
|
156
162
|
auth
|
|
157
163
|
.command('provider <name>')
|
|
158
164
|
.description('Show setup for a sign-in provider (google, apple, discord), set your own credentials, or go back to shared')
|
|
159
|
-
.option('--client-id <id>', 'OAuth client ID (Apple: the Services ID)')
|
|
165
|
+
.option('--client-id <id>', 'OAuth client ID (Apple: the web Services ID)')
|
|
166
|
+
.option('--bundle-id <id>', 'Apple: an iOS bundle ID allowed to sign in natively (repeat for several)', (v, prev = []) => [...prev, v])
|
|
167
|
+
.option('--require-nonce', 'Apple: native sign-in must send a nonce')
|
|
160
168
|
.option('--client-secret <secret>', 'OAuth client secret (Google, Discord)')
|
|
161
169
|
.option('--team-id <id>', 'Apple Team ID')
|
|
162
170
|
.option('--key-id <id>', 'Apple Sign in with Apple key ID')
|
|
@@ -170,7 +178,7 @@ See: gipity skill read steam-game`)
|
|
|
170
178
|
const config = requireConfig();
|
|
171
179
|
const base = `/projects/${config.projectGuid}/auth/providers/${provider}`;
|
|
172
180
|
const label = PROVIDER_LABEL[provider];
|
|
173
|
-
const credFlags = ['clientId', 'clientSecret', 'teamId', 'keyId', 'privateKeyFile'].filter(k => opts[k] !== undefined);
|
|
181
|
+
const credFlags = ['clientId', 'clientSecret', 'teamId', 'keyId', 'privateKeyFile', 'bundleId', 'requireNonce'].filter(k => opts[k] !== undefined);
|
|
174
182
|
if (opts.shared) {
|
|
175
183
|
if (credFlags.length)
|
|
176
184
|
fail('--shared cannot be combined with credential flags.');
|
|
@@ -191,10 +199,12 @@ See: gipity skill read steam-game`)
|
|
|
191
199
|
}
|
|
192
200
|
let body;
|
|
193
201
|
if (provider === 'apple') {
|
|
194
|
-
const missing = [['
|
|
202
|
+
const missing = [['teamId', '--team-id'], ['keyId', '--key-id'], ['privateKeyFile', '--private-key-file']]
|
|
195
203
|
.filter(([k]) => !opts[k]).map(([, f]) => f);
|
|
196
204
|
if (missing.length)
|
|
197
205
|
fail(`Apple needs ${missing.join(', ')}. See: gipity project auth provider apple`);
|
|
206
|
+
if (!opts.clientId && !opts.bundleId)
|
|
207
|
+
fail('Apple needs --client-id (web Services ID), --bundle-id (iOS app), or both. See: gipity project auth provider apple');
|
|
198
208
|
if (opts.clientSecret)
|
|
199
209
|
fail('Apple takes --team-id, --key-id and --private-key-file, not --client-secret.');
|
|
200
210
|
let privateKey;
|
|
@@ -206,22 +216,30 @@ See: gipity skill read steam-game`)
|
|
|
206
216
|
}
|
|
207
217
|
if (!privateKey.includes('PRIVATE KEY'))
|
|
208
218
|
fail(`${opts.privateKeyFile} does not look like a .p8 private key.`);
|
|
209
|
-
body = {
|
|
219
|
+
body = {
|
|
220
|
+
...(opts.clientId ? { client_id: opts.clientId } : {}),
|
|
221
|
+
...(opts.bundleId ? { bundle_ids: opts.bundleId } : {}),
|
|
222
|
+
...(opts.requireNonce ? { require_nonce: true } : {}),
|
|
223
|
+
team_id: opts.teamId, key_id: opts.keyId, private_key: privateKey,
|
|
224
|
+
};
|
|
210
225
|
}
|
|
211
226
|
else {
|
|
212
227
|
const missing = [['clientId', '--client-id'], ['clientSecret', '--client-secret']]
|
|
213
228
|
.filter(([k]) => !opts[k]).map(([, f]) => f);
|
|
214
229
|
if (missing.length)
|
|
215
230
|
fail(`${label} needs ${missing.join(' and ')}. See: gipity project auth provider ${provider}`);
|
|
216
|
-
const extra = ['teamId', 'keyId', 'privateKeyFile'].filter(k => opts[k] !== undefined);
|
|
231
|
+
const extra = ['teamId', 'keyId', 'privateKeyFile', 'bundleId', 'requireNonce'].filter(k => opts[k] !== undefined);
|
|
217
232
|
if (extra.length)
|
|
218
|
-
fail(`--team-id, --key-id
|
|
233
|
+
fail(`--team-id, --key-id, --private-key-file, --bundle-id and --require-nonce are for Apple only.`);
|
|
219
234
|
body = { client_id: opts.clientId, client_secret: opts.clientSecret };
|
|
220
235
|
}
|
|
221
236
|
const res = await put(base, body);
|
|
222
237
|
const lines = [success(`${label} sign-in now uses your own credentials.`)];
|
|
223
238
|
if (provider === 'google')
|
|
224
239
|
lines.push(muted('Existing Google users keep their accounts.'));
|
|
240
|
+
if (provider === 'apple' && opts.bundleId) {
|
|
241
|
+
lines.push(muted(`iOS apps (${opts.bundleId.join(', ')}) can sign in with POST /api/<guid>/auth/apple. See: gipity skill read app-users`));
|
|
242
|
+
}
|
|
225
243
|
printResult(lines.join('\n'), opts, res.data);
|
|
226
244
|
}));
|
|
227
245
|
}
|
|
@@ -49,7 +49,7 @@ email code, Steam or a guest device. They belong to the app, not to Gipity.
|
|
|
49
49
|
gipity project users --search ann find users by name or email
|
|
50
50
|
gipity project users export -o users.csv every user, as CSV (or --format json)
|
|
51
51
|
gipity project users delete <guid> erase a user (runs the app's user_deleted hooks)
|
|
52
|
-
gipity project users signout <guid>
|
|
52
|
+
gipity project users signout <guid> sign a user out everywhere (web and native apps)`);
|
|
53
53
|
users
|
|
54
54
|
.command('list', { isDefault: true })
|
|
55
55
|
.description("List the app's users")
|
|
@@ -119,7 +119,7 @@ email code, Steam or a guest device. They belong to the app, not to Gipity.
|
|
|
119
119
|
}));
|
|
120
120
|
users
|
|
121
121
|
.command('signout <userGuid>')
|
|
122
|
-
.description("Sign a user out everywhere
|
|
122
|
+
.description("Sign a user out everywhere: end their web sessions, revoke their native apps' refresh tokens, and void their access tokens")
|
|
123
123
|
.option('--json', 'Output as JSON')
|
|
124
124
|
.action((userGuid, opts) => run('Sign out', async () => {
|
|
125
125
|
const res = await post(`/projects/${requireConfig().projectGuid}/app-users/${encodeURIComponent(userGuid)}/signout`);
|
package/dist/index.js
CHANGED
|
@@ -40260,12 +40260,13 @@ var SETUP_STEPS = {
|
|
|
40260
40260
|
"gipity project auth provider google --client-id <id> --client-secret <secret>"
|
|
40261
40261
|
],
|
|
40262
40262
|
apple: (r) => [
|
|
40263
|
-
"Apple Developer > Certificates, Identifiers & Profiles >
|
|
40264
|
-
"
|
|
40265
|
-
|
|
40266
|
-
|
|
40267
|
-
"
|
|
40268
|
-
"gipity project auth provider apple --
|
|
40263
|
+
"Apple Developer > Certificates, Identifiers & Profiles > Keys > add a key with Sign in with Apple enabled.",
|
|
40264
|
+
" Note its Key ID and download the .p8 file (only once). Your Team ID is on the Membership details page.",
|
|
40265
|
+
"Web sign-in (the hosted sign-in page): Identifiers > add a Services ID. Its identifier is your client ID.",
|
|
40266
|
+
` Enable Sign in with Apple on it, register your domain and the return URL: ${r}`,
|
|
40267
|
+
"iOS app (native, POST /api/<guid>/auth/apple): enable Sign in with Apple on your App ID; its bundle ID is what you pass as --bundle-id.",
|
|
40268
|
+
"gipity project auth provider apple --team-id <team> --key-id <key> --private-key-file AuthKey_XXXX.p8 [--client-id <services-id>] [--bundle-id <bundle-id> ...] [--require-nonce]",
|
|
40269
|
+
" Pass every flag each time: this replaces the app's whole Apple setup."
|
|
40269
40270
|
],
|
|
40270
40271
|
discord: (r) => [
|
|
40271
40272
|
"Discord Developer Portal > Applications > your application > OAuth2.",
|
|
@@ -40280,6 +40281,9 @@ function formatProvider(p) {
|
|
|
40280
40281
|
`${bold(name)}: ${credentialsLabel(p)}${p.available ? "" : muted(" (off)")}`
|
|
40281
40282
|
];
|
|
40282
40283
|
if (p.note) lines.push(muted(p.note));
|
|
40284
|
+
if (p.provider === "apple" && p.bundle_ids) {
|
|
40285
|
+
lines.push(`iOS bundle ids: ${p.bundle_ids.length ? p.bundle_ids.join(", ") : "none"}${p.require_nonce ? " (nonce required)" : ""}`);
|
|
40286
|
+
}
|
|
40283
40287
|
lines.push("", `Redirect URI: ${p.redirect_uri}`, "", "Use your own credentials:");
|
|
40284
40288
|
let n = 0;
|
|
40285
40289
|
for (const step of SETUP_STEPS[p.provider](p.redirect_uri)) {
|
|
@@ -40299,13 +40303,15 @@ Modes:
|
|
|
40299
40303
|
gipity Sign in with Gipity only (default)
|
|
40300
40304
|
app Users sign in to this app alone, without a Gipity account:
|
|
40301
40305
|
Google, Apple, Discord and email codes for web apps (the hosted sign-in
|
|
40302
|
-
page / Gipity.auth.signIn)
|
|
40303
|
-
|
|
40306
|
+
page / Gipity.auth.signIn); native apps sign in over HTTPS with Steam
|
|
40307
|
+
(POST /api/<guid>/auth/steam), guest devices (/auth/guest), Sign in with
|
|
40308
|
+
Apple from iOS (/auth/apple) or email codes, and renew with /auth/refresh
|
|
40304
40309
|
both Either
|
|
40305
40310
|
|
|
40306
40311
|
Sign-in providers:
|
|
40307
40312
|
gipity project auth provider <google|apple|discord> show setup steps and the redirect URI
|
|
40308
|
-
Google and Discord work at once on Gipity's shared credentials; Apple needs your own
|
|
40313
|
+
Google and Discord work at once on Gipity's shared credentials; Apple needs your own
|
|
40314
|
+
(a web Services ID, iOS bundle ids with --bundle-id, or both).
|
|
40309
40315
|
Manage the app's users: gipity project users
|
|
40310
40316
|
|
|
40311
40317
|
--unique-names on|off
|
|
@@ -40356,13 +40362,13 @@ See: gipity skill read steam-game`).option("--unique-names <on|off>", "Require u
|
|
|
40356
40362
|
}
|
|
40357
40363
|
printResult(lines.join("\n"), opts, { ...body, ...res.data.players_sharing_names !== void 0 ? { players_sharing_names: res.data.players_sharing_names } : {} });
|
|
40358
40364
|
}));
|
|
40359
|
-
auth.command("provider <name>").description("Show setup for a sign-in provider (google, apple, discord), set your own credentials, or go back to shared").option("--client-id <id>", "OAuth client ID (Apple: the Services ID)").option("--client-secret <secret>", "OAuth client secret (Google, Discord)").option("--team-id <id>", "Apple Team ID").option("--key-id <id>", "Apple Sign in with Apple key ID").option("--private-key-file <path>", "Apple .p8 private key file").option("--shared", "Remove your own credentials and use Gipity's shared ones").option("--json", "Output as JSON").action((name, opts) => run("Provider", async () => {
|
|
40365
|
+
auth.command("provider <name>").description("Show setup for a sign-in provider (google, apple, discord), set your own credentials, or go back to shared").option("--client-id <id>", "OAuth client ID (Apple: the web Services ID)").option("--bundle-id <id>", "Apple: an iOS bundle ID allowed to sign in natively (repeat for several)", (v7, prev = []) => [...prev, v7]).option("--require-nonce", "Apple: native sign-in must send a nonce").option("--client-secret <secret>", "OAuth client secret (Google, Discord)").option("--team-id <id>", "Apple Team ID").option("--key-id <id>", "Apple Sign in with Apple key ID").option("--private-key-file <path>", "Apple .p8 private key file").option("--shared", "Remove your own credentials and use Gipity's shared ones").option("--json", "Output as JSON").action((name, opts) => run("Provider", async () => {
|
|
40360
40366
|
const provider = name.toLowerCase();
|
|
40361
40367
|
if (!PROVIDERS.includes(provider)) fail(`Unknown provider "${name}". Use one of: ${PROVIDERS.join(", ")}.`);
|
|
40362
40368
|
const config = requireConfig2();
|
|
40363
40369
|
const base = `/projects/${config.projectGuid}/auth/providers/${provider}`;
|
|
40364
40370
|
const label2 = PROVIDER_LABEL[provider];
|
|
40365
|
-
const credFlags = ["clientId", "clientSecret", "teamId", "keyId", "privateKeyFile"].filter((k7) => opts[k7] !== void 0);
|
|
40371
|
+
const credFlags = ["clientId", "clientSecret", "teamId", "keyId", "privateKeyFile", "bundleId", "requireNonce"].filter((k7) => opts[k7] !== void 0);
|
|
40366
40372
|
if (opts.shared) {
|
|
40367
40373
|
if (credFlags.length) fail("--shared cannot be combined with credential flags.");
|
|
40368
40374
|
const res2 = await del(base);
|
|
@@ -40379,8 +40385,9 @@ See: gipity skill read steam-game`).option("--unique-names <on|off>", "Require u
|
|
|
40379
40385
|
}
|
|
40380
40386
|
let body;
|
|
40381
40387
|
if (provider === "apple") {
|
|
40382
|
-
const missing = [["
|
|
40388
|
+
const missing = [["teamId", "--team-id"], ["keyId", "--key-id"], ["privateKeyFile", "--private-key-file"]].filter(([k7]) => !opts[k7]).map(([, f]) => f);
|
|
40383
40389
|
if (missing.length) fail(`Apple needs ${missing.join(", ")}. See: gipity project auth provider apple`);
|
|
40390
|
+
if (!opts.clientId && !opts.bundleId) fail("Apple needs --client-id (web Services ID), --bundle-id (iOS app), or both. See: gipity project auth provider apple");
|
|
40384
40391
|
if (opts.clientSecret) fail("Apple takes --team-id, --key-id and --private-key-file, not --client-secret.");
|
|
40385
40392
|
let privateKey;
|
|
40386
40393
|
try {
|
|
@@ -40389,17 +40396,27 @@ See: gipity skill read steam-game`).option("--unique-names <on|off>", "Require u
|
|
|
40389
40396
|
fail(`Cannot read ${opts.privateKeyFile}: ${err.code === "ENOENT" ? "no such file" : err.message}`);
|
|
40390
40397
|
}
|
|
40391
40398
|
if (!privateKey.includes("PRIVATE KEY")) fail(`${opts.privateKeyFile} does not look like a .p8 private key.`);
|
|
40392
|
-
body = {
|
|
40399
|
+
body = {
|
|
40400
|
+
...opts.clientId ? { client_id: opts.clientId } : {},
|
|
40401
|
+
...opts.bundleId ? { bundle_ids: opts.bundleId } : {},
|
|
40402
|
+
...opts.requireNonce ? { require_nonce: true } : {},
|
|
40403
|
+
team_id: opts.teamId,
|
|
40404
|
+
key_id: opts.keyId,
|
|
40405
|
+
private_key: privateKey
|
|
40406
|
+
};
|
|
40393
40407
|
} else {
|
|
40394
40408
|
const missing = [["clientId", "--client-id"], ["clientSecret", "--client-secret"]].filter(([k7]) => !opts[k7]).map(([, f]) => f);
|
|
40395
40409
|
if (missing.length) fail(`${label2} needs ${missing.join(" and ")}. See: gipity project auth provider ${provider}`);
|
|
40396
|
-
const extra = ["teamId", "keyId", "privateKeyFile"].filter((k7) => opts[k7] !== void 0);
|
|
40397
|
-
if (extra.length) fail(`--team-id, --key-id
|
|
40410
|
+
const extra = ["teamId", "keyId", "privateKeyFile", "bundleId", "requireNonce"].filter((k7) => opts[k7] !== void 0);
|
|
40411
|
+
if (extra.length) fail(`--team-id, --key-id, --private-key-file, --bundle-id and --require-nonce are for Apple only.`);
|
|
40398
40412
|
body = { client_id: opts.clientId, client_secret: opts.clientSecret };
|
|
40399
40413
|
}
|
|
40400
40414
|
const res = await put(base, body);
|
|
40401
40415
|
const lines = [success(`${label2} sign-in now uses your own credentials.`)];
|
|
40402
40416
|
if (provider === "google") lines.push(muted("Existing Google users keep their accounts."));
|
|
40417
|
+
if (provider === "apple" && opts.bundleId) {
|
|
40418
|
+
lines.push(muted(`iOS apps (${opts.bundleId.join(", ")}) can sign in with POST /api/<guid>/auth/apple. See: gipity skill read app-users`));
|
|
40419
|
+
}
|
|
40403
40420
|
printResult(lines.join("\n"), opts, res.data);
|
|
40404
40421
|
}));
|
|
40405
40422
|
}
|
|
@@ -40461,7 +40478,7 @@ email code, Steam or a guest device. They belong to the app, not to Gipity.
|
|
|
40461
40478
|
gipity project users --search ann find users by name or email
|
|
40462
40479
|
gipity project users export -o users.csv every user, as CSV (or --format json)
|
|
40463
40480
|
gipity project users delete <guid> erase a user (runs the app's user_deleted hooks)
|
|
40464
|
-
gipity project users signout <guid>
|
|
40481
|
+
gipity project users signout <guid> sign a user out everywhere (web and native apps)`);
|
|
40465
40482
|
users.command("list", { isDefault: true }).description("List the app's users").option("--search <text>", "Match name or email").option("--limit <n>", "How many to show (1-500, default 100)").option("--json", "Output as JSON").action((opts) => run("Users", async () => {
|
|
40466
40483
|
let limit;
|
|
40467
40484
|
if (opts.limit !== void 0) {
|
|
@@ -40511,7 +40528,7 @@ email code, Steam or a guest device. They belong to the app, not to Gipity.
|
|
|
40511
40528
|
const res = await del(`/projects/${requireConfig2().projectGuid}/app-users/${encodeURIComponent(userGuid)}`);
|
|
40512
40529
|
printResult(success(`Deleted user ${userGuid}.`), opts, { guid: userGuid, ...res.data });
|
|
40513
40530
|
}));
|
|
40514
|
-
users.command("signout <userGuid>").description("Sign a user out everywhere
|
|
40531
|
+
users.command("signout <userGuid>").description("Sign a user out everywhere: end their web sessions, revoke their native apps' refresh tokens, and void their access tokens").option("--json", "Output as JSON").action((userGuid, opts) => run("Sign out", async () => {
|
|
40515
40532
|
const res = await post(`/projects/${requireConfig2().projectGuid}/app-users/${encodeURIComponent(userGuid)}/signout`);
|
|
40516
40533
|
const n = res.data.signed_out_sessions;
|
|
40517
40534
|
printResult(success(`Signed out ${userGuid}: ${n} session${n === 1 ? "" : "s"} ended.`), opts, { guid: userGuid, ...res.data });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gipity",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.40",
|
|
4
4
|
"description": "The full-stack platform tuned for AI agents. Database, storage, auth, functions, deploy, and drop-in kits - all agent-tuned. Pair with Claude Code or use standalone.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"gipity": "dist/updater/shim.js",
|