@absolutejs/auth 0.53.0 → 0.53.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.
@@ -0,0 +1,329 @@
1
+ {
2
+ "contract": 1,
3
+ "identity": {
4
+ "accent": "#6366f1",
5
+ "category": "auth",
6
+ "description": "OAuth/OIDC sign-in for 60+ providers, email/password, magic links, passkeys, MFA, enterprise SSO/SCIM, organizations, roles, and API keys — one Elysia plugin backed by your Postgres database.",
7
+ "docsUrl": "https://github.com/absolutejs/auth",
8
+ "name": "@absolutejs/auth",
9
+ "tagline": "Let people create accounts and sign in."
10
+ },
11
+ "implements": [
12
+ {
13
+ "contract": "auth/session-store",
14
+ "factory": "createNeonAuthSessionStore",
15
+ "from": "@absolutejs/auth",
16
+ "requires": {
17
+ "env": [
18
+ {
19
+ "description": "Postgres connection string",
20
+ "example": "postgres://user:pass@host/db",
21
+ "key": "DATABASE_URL",
22
+ "secret": true
23
+ }
24
+ ]
25
+ },
26
+ "title": "Your Postgres database (recommended)",
27
+ "wiring": {
28
+ "code": "createNeonAuthSessionStore(${env.DATABASE_URL} ?? \"\")",
29
+ "imports": [
30
+ {
31
+ "from": "@absolutejs/auth",
32
+ "names": [
33
+ "createNeonAuthSessionStore"
34
+ ]
35
+ }
36
+ ]
37
+ }
38
+ },
39
+ {
40
+ "contract": "auth/session-store",
41
+ "factory": "createInMemoryAuthSessionStore",
42
+ "from": "@absolutejs/auth",
43
+ "title": "In memory (development only — sign-ins reset on restart)",
44
+ "wiring": {
45
+ "code": "createInMemoryAuthSessionStore()",
46
+ "imports": [
47
+ {
48
+ "from": "@absolutejs/auth",
49
+ "names": [
50
+ "createInMemoryAuthSessionStore"
51
+ ]
52
+ }
53
+ ]
54
+ }
55
+ }
56
+ ],
57
+ "lifecycle": [
58
+ {
59
+ "command": "bunx absolute-auth migrate",
60
+ "id": "migrate",
61
+ "idempotent": true,
62
+ "kind": "migration",
63
+ "title": "Set up the sign-in tables in your database",
64
+ "when": "after-install"
65
+ },
66
+ {
67
+ "command": "bunx absolute-auth migrate",
68
+ "id": "migrate-upgrade",
69
+ "idempotent": true,
70
+ "kind": "migration",
71
+ "title": "Apply new sign-in tables after upgrading",
72
+ "when": "after-upgrade"
73
+ }
74
+ ],
75
+ "presets": [
76
+ {
77
+ "id": "social-login",
78
+ "title": "Social login (Google + GitHub)",
79
+ "values": {
80
+ "providersConfiguration": {
81
+ "github": {},
82
+ "google": {}
83
+ }
84
+ }
85
+ }
86
+ ],
87
+ "requires": {
88
+ "env": [
89
+ {
90
+ "description": "Postgres connection string (sign-in tables live here)",
91
+ "example": "postgres://user:pass@host/db",
92
+ "key": "DATABASE_URL",
93
+ "secret": true
94
+ },
95
+ {
96
+ "description": "Discord OAuth client id",
97
+ "docsUrl": "https://github.com/absolutejs/auth#providers",
98
+ "key": "DISCORD_CLIENT_ID",
99
+ "when": "providersConfiguration.discord"
100
+ },
101
+ {
102
+ "description": "Discord OAuth client secret",
103
+ "docsUrl": "https://github.com/absolutejs/auth#providers",
104
+ "key": "DISCORD_CLIENT_SECRET",
105
+ "secret": true,
106
+ "when": "providersConfiguration.discord"
107
+ },
108
+ {
109
+ "description": "Facebook OAuth client id",
110
+ "docsUrl": "https://github.com/absolutejs/auth#providers",
111
+ "key": "FACEBOOK_CLIENT_ID",
112
+ "when": "providersConfiguration.facebook"
113
+ },
114
+ {
115
+ "description": "Facebook OAuth client secret",
116
+ "docsUrl": "https://github.com/absolutejs/auth#providers",
117
+ "key": "FACEBOOK_CLIENT_SECRET",
118
+ "secret": true,
119
+ "when": "providersConfiguration.facebook"
120
+ },
121
+ {
122
+ "description": "Github OAuth client id",
123
+ "docsUrl": "https://github.com/absolutejs/auth#providers",
124
+ "key": "GITHUB_CLIENT_ID",
125
+ "when": "providersConfiguration.github"
126
+ },
127
+ {
128
+ "description": "Github OAuth client secret",
129
+ "docsUrl": "https://github.com/absolutejs/auth#providers",
130
+ "key": "GITHUB_CLIENT_SECRET",
131
+ "secret": true,
132
+ "when": "providersConfiguration.github"
133
+ },
134
+ {
135
+ "description": "Google OAuth client id",
136
+ "docsUrl": "https://github.com/absolutejs/auth#providers",
137
+ "key": "GOOGLE_CLIENT_ID",
138
+ "when": "providersConfiguration.google"
139
+ },
140
+ {
141
+ "description": "Google OAuth client secret",
142
+ "docsUrl": "https://github.com/absolutejs/auth#providers",
143
+ "key": "GOOGLE_CLIENT_SECRET",
144
+ "secret": true,
145
+ "when": "providersConfiguration.google"
146
+ },
147
+ {
148
+ "description": "Linkedin OAuth client id",
149
+ "docsUrl": "https://github.com/absolutejs/auth#providers",
150
+ "key": "LINKEDIN_CLIENT_ID",
151
+ "when": "providersConfiguration.linkedin"
152
+ },
153
+ {
154
+ "description": "Linkedin OAuth client secret",
155
+ "docsUrl": "https://github.com/absolutejs/auth#providers",
156
+ "key": "LINKEDIN_CLIENT_SECRET",
157
+ "secret": true,
158
+ "when": "providersConfiguration.linkedin"
159
+ },
160
+ {
161
+ "description": "Microsoft OAuth client id",
162
+ "docsUrl": "https://github.com/absolutejs/auth#providers",
163
+ "key": "MICROSOFT_CLIENT_ID",
164
+ "when": "providersConfiguration.microsoft"
165
+ },
166
+ {
167
+ "description": "Microsoft OAuth client secret",
168
+ "docsUrl": "https://github.com/absolutejs/auth#providers",
169
+ "key": "MICROSOFT_CLIENT_SECRET",
170
+ "secret": true,
171
+ "when": "providersConfiguration.microsoft"
172
+ },
173
+ {
174
+ "description": "Slack OAuth client id",
175
+ "docsUrl": "https://github.com/absolutejs/auth#providers",
176
+ "key": "SLACK_CLIENT_ID",
177
+ "when": "providersConfiguration.slack"
178
+ },
179
+ {
180
+ "description": "Slack OAuth client secret",
181
+ "docsUrl": "https://github.com/absolutejs/auth#providers",
182
+ "key": "SLACK_CLIENT_SECRET",
183
+ "secret": true,
184
+ "when": "providersConfiguration.slack"
185
+ },
186
+ {
187
+ "description": "Spotify OAuth client id",
188
+ "docsUrl": "https://github.com/absolutejs/auth#providers",
189
+ "key": "SPOTIFY_CLIENT_ID",
190
+ "when": "providersConfiguration.spotify"
191
+ },
192
+ {
193
+ "description": "Spotify OAuth client secret",
194
+ "docsUrl": "https://github.com/absolutejs/auth#providers",
195
+ "key": "SPOTIFY_CLIENT_SECRET",
196
+ "secret": true,
197
+ "when": "providersConfiguration.spotify"
198
+ },
199
+ {
200
+ "description": "Twitch OAuth client id",
201
+ "docsUrl": "https://github.com/absolutejs/auth#providers",
202
+ "key": "TWITCH_CLIENT_ID",
203
+ "when": "providersConfiguration.twitch"
204
+ },
205
+ {
206
+ "description": "Twitch OAuth client secret",
207
+ "docsUrl": "https://github.com/absolutejs/auth#providers",
208
+ "key": "TWITCH_CLIENT_SECRET",
209
+ "secret": true,
210
+ "when": "providersConfiguration.twitch"
211
+ }
212
+ ],
213
+ "peers": [
214
+ {
215
+ "name": "elysia",
216
+ "range": ">=1.0",
217
+ "reason": "plugin host"
218
+ }
219
+ ],
220
+ "services": [
221
+ {
222
+ "description": "Stores accounts, sessions, and audit events",
223
+ "id": "postgres"
224
+ }
225
+ ]
226
+ },
227
+ "settings": {
228
+ "type": "object",
229
+ "properties": {
230
+ "cleanupIntervalMs": {
231
+ "description": "How often expired sessions are swept, in milliseconds.",
232
+ "minimum": 1000,
233
+ "title": "Session cleanup interval",
234
+ "x-group": "advanced",
235
+ "type": "number"
236
+ },
237
+ "cookieSecure": {
238
+ "description": "Only send the sign-in cookie over HTTPS. Leave off in local development.",
239
+ "title": "HTTPS-only cookies",
240
+ "x-group": "advanced",
241
+ "type": "boolean"
242
+ },
243
+ "maxSessions": {
244
+ "description": "How many devices someone can stay signed in on at once.",
245
+ "minimum": 1,
246
+ "title": "Signed-in devices per person",
247
+ "x-group": "sessions",
248
+ "type": "integer"
249
+ },
250
+ "providersConfiguration": {
251
+ "description": "Which services people can sign in with. Each needs a client id and secret from that provider.",
252
+ "title": "Sign-in providers",
253
+ "x-group": "providers",
254
+ "type": "object",
255
+ "patternProperties": {
256
+ "^(.*)$": {
257
+ "type": "object",
258
+ "properties": {
259
+ "scope": {
260
+ "description": "Extra permissions to request from the provider.",
261
+ "title": "Permissions",
262
+ "type": "array",
263
+ "items": {
264
+ "type": "string"
265
+ }
266
+ }
267
+ }
268
+ }
269
+ }
270
+ },
271
+ "sessionDurationMs": {
272
+ "description": "How long someone stays signed in, in milliseconds. Default is 7 days.",
273
+ "minimum": 60000,
274
+ "title": "Stay signed in for",
275
+ "x-group": "sessions",
276
+ "type": "number"
277
+ }
278
+ }
279
+ },
280
+ "slots": {
281
+ "sessionStore": {
282
+ "configPath": "authSessionStore",
283
+ "contract": "auth/session-store",
284
+ "description": "Where live sign-in sessions are kept",
285
+ "known": [
286
+ "@absolutejs/auth#postgres",
287
+ "@absolutejs/auth#memory"
288
+ ],
289
+ "required": true
290
+ }
291
+ },
292
+ "wiring": [
293
+ {
294
+ "description": "Sign in with Google, GitHub, and 60+ other services. Add email/password later from settings.",
295
+ "id": "default",
296
+ "server": {
297
+ "code": ".use(\n\tawait auth({\n\t\t// TODO: return your application user for a session subject.\n\t\tgetUser: (sub) => ({ sub }),\n\t\tauthSessionStore: ${slot.sessionStore},\n\t\tcookieSecure: ${settings.cookieSecure},\n\t\tmaxSessions: ${settings.maxSessions},\n\t\tprovidersConfiguration: providersFromEnv(${settings.providersConfiguration} ?? {}),\n\t\tsessionDurationMs: ${settings.sessionDurationMs}\n\t})\n)",
298
+ "imports": [
299
+ {
300
+ "from": "@absolutejs/auth",
301
+ "names": [
302
+ "auth",
303
+ "providersFromEnv"
304
+ ]
305
+ }
306
+ ],
307
+ "placement": "server-plugin"
308
+ },
309
+ "title": "Social sign-in (OAuth)"
310
+ }
311
+ ],
312
+ "tools": {
313
+ "list_sign_in_providers": {
314
+ "annotations": {
315
+ "readOnlyHint": true
316
+ },
317
+ "capabilities": [
318
+ "read",
319
+ "glob"
320
+ ],
321
+ "description": "List which sign-in providers this project has configured, and which are missing credentials.",
322
+ "input": {
323
+ "type": "object",
324
+ "properties": {}
325
+ },
326
+ "kind": "workspace"
327
+ }
328
+ }
329
+ }
@@ -930,7 +930,7 @@ export declare const buildClientProviders: (providersConfiguration: OAuth2Config
930
930
  authIn: "header";
931
931
  encoding: "application/json";
932
932
  method: "GET";
933
- url: (config: any) => string;
933
+ url: string;
934
934
  };
935
935
  scopeRequired: false;
936
936
  subject: string[];
@@ -1077,7 +1077,7 @@ var providers = defineProviders({
1077
1077
  }
1078
1078
  },
1079
1079
  microsoftentraid: {
1080
- authorizationUrl: (config) => `https://${config.tenantId}.b2clogin.com/${config.tenantId}/oauth2/v2.0/authorize`,
1080
+ authorizationUrl: (config) => `https://login.microsoftonline.com/${config.tenantId}/oauth2/v2.0/authorize`,
1081
1081
  isOIDC: true,
1082
1082
  isRefreshable: true,
1083
1083
  PKCEMethod: "S256",
@@ -1085,15 +1085,15 @@ var providers = defineProviders({
1085
1085
  authIn: "header",
1086
1086
  encoding: "application/json",
1087
1087
  method: "GET",
1088
- url: (config) => `https://${config.tenantId}.b2clogin.com/${config.tenantId}/openid/userinfo`
1088
+ url: "https://graph.microsoft.com/oidc/userinfo"
1089
1089
  },
1090
1090
  scopeRequired: false,
1091
- subject: ["id"],
1091
+ subject: ["sub"],
1092
1092
  subjectType: "string",
1093
1093
  tokenRequest: {
1094
1094
  authIn: "body",
1095
1095
  encoding: "application/x-www-form-urlencoded",
1096
- url: (config) => `https://${config.tenantId}.b2clogin.com/${config.tenantId}/oauth2/v2.0/token`
1096
+ url: (config) => `https://login.microsoftonline.com/${config.tenantId}/oauth2/v2.0/token`
1097
1097
  }
1098
1098
  },
1099
1099
  monday: {
@@ -1214,7 +1214,7 @@ var providers = defineProviders({
1214
1214
  }
1215
1215
  },
1216
1216
  onspark: {
1217
- authorizationUrl: "https://app.onspark.com/oauth2/authorize",
1217
+ authorizationUrl: "https://onspark.com/oauth2/authorize",
1218
1218
  email: ["email"],
1219
1219
  familyName: ["family_name"],
1220
1220
  fullName: ["name"],
@@ -1227,13 +1227,13 @@ var providers = defineProviders({
1227
1227
  authIn: "header",
1228
1228
  encoding: "application/json",
1229
1229
  method: "GET",
1230
- url: "https://app.onspark.com/oauth2/userinfo"
1230
+ url: "https://onspark.com/oauth2/userinfo"
1231
1231
  },
1232
1232
  revocationRequest: {
1233
1233
  authIn: "body",
1234
1234
  encoding: "application/x-www-form-urlencoded",
1235
1235
  tokenParamName: "token",
1236
- url: "https://app.onspark.com/oauth2/revoke"
1236
+ url: "https://onspark.com/oauth2/revoke"
1237
1237
  },
1238
1238
  scopeRequired: true,
1239
1239
  subject: ["sub"],
@@ -1241,7 +1241,7 @@ var providers = defineProviders({
1241
1241
  tokenRequest: {
1242
1242
  authIn: "body",
1243
1243
  encoding: "application/x-www-form-urlencoded",
1244
- url: "https://app.onspark.com/oauth2/token"
1244
+ url: "https://onspark.com/oauth2/token"
1245
1245
  }
1246
1246
  },
1247
1247
  osu: {
@@ -2649,5 +2649,5 @@ export {
2649
2649
  decodeJWT
2650
2650
  };
2651
2651
 
2652
- //# debugId=2016F2B1E2EEE32864756E2164756E21
2652
+ //# debugId=0CC902D420872DEC64756E2164756E21
2653
2653
  //# sourceMappingURL=index.js.map