@softistx/janus-graphql 0.0.0-stage → 0.30.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/LICENSE +21 -0
- package/README.md +716 -2
- package/dist/api-keys/index.d.ts +11 -0
- package/dist/api-keys/index.d.ts.map +1 -0
- package/dist/api-keys/resolvers/deps.d.ts +39 -0
- package/dist/api-keys/resolvers/deps.d.ts.map +1 -0
- package/dist/api-keys/resolvers/index.d.ts +39 -0
- package/dist/api-keys/resolvers/index.d.ts.map +1 -0
- package/dist/api-keys/resolvers/list.d.ts +16 -0
- package/dist/api-keys/resolvers/list.d.ts.map +1 -0
- package/dist/api-keys/resolvers/manage.d.ts +17 -0
- package/dist/api-keys/resolvers/manage.d.ts.map +1 -0
- package/dist/api-keys/sdl.d.ts +14 -0
- package/dist/api-keys/sdl.d.ts.map +1 -0
- package/dist/api-keys/shape.d.ts +38 -0
- package/dist/api-keys/shape.d.ts.map +1 -0
- package/dist/api-keys/types.d.ts +149 -0
- package/dist/api-keys/types.d.ts.map +1 -0
- package/dist/avatar/index.d.ts +32 -0
- package/dist/avatar/index.d.ts.map +1 -0
- package/dist/avatar/resolvers.d.ts +41 -0
- package/dist/avatar/resolvers.d.ts.map +1 -0
- package/dist/avatar/sdl.d.ts +16 -0
- package/dist/avatar/sdl.d.ts.map +1 -0
- package/dist/bad-input.d.ts +17 -0
- package/dist/bad-input.d.ts.map +1 -0
- package/dist/connection/connection.d.ts +36 -0
- package/dist/connection/connection.d.ts.map +1 -0
- package/dist/connection/credential.d.ts +34 -0
- package/dist/connection/credential.d.ts.map +1 -0
- package/dist/connection/types.d.ts +61 -0
- package/dist/connection/types.d.ts.map +1 -0
- package/dist/context/create.d.ts +32 -0
- package/dist/context/create.d.ts.map +1 -0
- package/dist/context/index.d.ts +9 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/context/registry.d.ts +72 -0
- package/dist/context/registry.d.ts.map +1 -0
- package/dist/context/resolve.d.ts +20 -0
- package/dist/context/resolve.d.ts.map +1 -0
- package/dist/device.d.ts +28 -0
- package/dist/device.d.ts.map +1 -0
- package/dist/directives/apply.d.ts +51 -0
- package/dist/directives/apply.d.ts.map +1 -0
- package/dist/directives/guard.d.ts +22 -0
- package/dist/directives/guard.d.ts.map +1 -0
- package/dist/directives/permission/enforce.d.ts +24 -0
- package/dist/directives/permission/enforce.d.ts.map +1 -0
- package/dist/directives/permission/model.d.ts +35 -0
- package/dist/directives/permission/model.d.ts.map +1 -0
- package/dist/directives/permission/path.d.ts +31 -0
- package/dist/directives/permission/path.d.ts.map +1 -0
- package/dist/directives/permission/validate.d.ts +42 -0
- package/dist/directives/permission/validate.d.ts.map +1 -0
- package/dist/directives/read.d.ts +43 -0
- package/dist/directives/read.d.ts.map +1 -0
- package/dist/directives/validate.d.ts +39 -0
- package/dist/directives/validate.d.ts.map +1 -0
- package/dist/directives/words.d.ts +7 -0
- package/dist/directives/words.d.ts.map +1 -0
- package/dist/errors/denial.d.ts +6 -0
- package/dist/errors/denial.d.ts.map +1 -0
- package/dist/errors/index.d.ts +12 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/janus-error.d.ts +20 -0
- package/dist/errors/janus-error.d.ts.map +1 -0
- package/dist/errors/mask.d.ts +69 -0
- package/dist/errors/mask.d.ts.map +1 -0
- package/dist/fresh.d.ts +44 -0
- package/dist/fresh.d.ts.map +1 -0
- package/dist/helpers.d.ts +56 -0
- package/dist/helpers.d.ts.map +1 -0
- package/dist/index.d.ts +86 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3393 -0
- package/dist/index.js.map +75 -0
- package/dist/invitations/index.d.ts +12 -0
- package/dist/invitations/index.d.ts.map +1 -0
- package/dist/invitations/resolvers/anonymous.d.ts +11 -0
- package/dist/invitations/resolvers/anonymous.d.ts.map +1 -0
- package/dist/invitations/resolvers/deps.d.ts +38 -0
- package/dist/invitations/resolvers/deps.d.ts.map +1 -0
- package/dist/invitations/resolvers/index.d.ts +37 -0
- package/dist/invitations/resolvers/index.d.ts.map +1 -0
- package/dist/invitations/resolvers/owner.d.ts +17 -0
- package/dist/invitations/resolvers/owner.d.ts.map +1 -0
- package/dist/invitations/sdl/accept.d.ts +7 -0
- package/dist/invitations/sdl/accept.d.ts.map +1 -0
- package/dist/invitations/sdl/index.d.ts +14 -0
- package/dist/invitations/sdl/index.d.ts.map +1 -0
- package/dist/invitations/sdl/owner.d.ts +8 -0
- package/dist/invitations/sdl/owner.d.ts.map +1 -0
- package/dist/invitations/shape.d.ts +63 -0
- package/dist/invitations/shape.d.ts.map +1 -0
- package/dist/invitations/types/index.d.ts +5 -0
- package/dist/invitations/types/index.d.ts.map +1 -0
- package/dist/invitations/types/options.d.ts +104 -0
- package/dist/invitations/types/options.d.ts.map +1 -0
- package/dist/invitations/types/out.d.ts +136 -0
- package/dist/invitations/types/out.d.ts.map +1 -0
- package/dist/invitations/types/surface.d.ts +18 -0
- package/dist/invitations/types/surface.d.ts.map +1 -0
- package/dist/map-code.d.ts +10 -0
- package/dist/map-code.d.ts.map +1 -0
- package/dist/mask-error.d.ts +18 -0
- package/dist/mask-error.d.ts.map +1 -0
- package/dist/memo.d.ts +16 -0
- package/dist/memo.d.ts.map +1 -0
- package/dist/options.d.ts +17 -0
- package/dist/options.d.ts.map +1 -0
- package/dist/passkeys/deps.d.ts +23 -0
- package/dist/passkeys/deps.d.ts.map +1 -0
- package/dist/passkeys/first-factor.types.d.ts +38 -0
- package/dist/passkeys/first-factor.types.d.ts.map +1 -0
- package/dist/passkeys/index.d.ts +14 -0
- package/dist/passkeys/index.d.ts.map +1 -0
- package/dist/passkeys/resolvers.d.ts +23 -0
- package/dist/passkeys/resolvers.d.ts.map +1 -0
- package/dist/passkeys/sdl.d.ts +14 -0
- package/dist/passkeys/sdl.d.ts.map +1 -0
- package/dist/passkeys/shape.d.ts +14 -0
- package/dist/passkeys/shape.d.ts.map +1 -0
- package/dist/passkeys/sign-in.resolvers.d.ts +19 -0
- package/dist/passkeys/sign-in.resolvers.d.ts.map +1 -0
- package/dist/passkeys/sign-in.sdl.d.ts +16 -0
- package/dist/passkeys/sign-in.sdl.d.ts.map +1 -0
- package/dist/passkeys/types.d.ts +193 -0
- package/dist/passkeys/types.d.ts.map +1 -0
- package/dist/plugin.d.ts +59 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/renewal.d.ts +51 -0
- package/dist/renewal.d.ts.map +1 -0
- package/dist/report.d.ts +29 -0
- package/dist/report.d.ts.map +1 -0
- package/dist/sdl.d.ts +12 -0
- package/dist/sdl.d.ts.map +1 -0
- package/dist/second-factor/index.d.ts +12 -0
- package/dist/second-factor/index.d.ts.map +1 -0
- package/dist/second-factor/resolvers/deps.d.ts +39 -0
- package/dist/second-factor/resolvers/deps.d.ts.map +1 -0
- package/dist/second-factor/resolvers/index.d.ts +39 -0
- package/dist/second-factor/resolvers/index.d.ts.map +1 -0
- package/dist/second-factor/resolvers/sign-in.d.ts +10 -0
- package/dist/second-factor/resolvers/sign-in.d.ts.map +1 -0
- package/dist/second-factor/resolvers/status.d.ts +10 -0
- package/dist/second-factor/resolvers/status.d.ts.map +1 -0
- package/dist/second-factor/resolvers/step-up.d.ts +16 -0
- package/dist/second-factor/resolvers/step-up.d.ts.map +1 -0
- package/dist/second-factor/resolvers/writes.d.ts +19 -0
- package/dist/second-factor/resolvers/writes.d.ts.map +1 -0
- package/dist/second-factor/sdl.d.ts +14 -0
- package/dist/second-factor/sdl.d.ts.map +1 -0
- package/dist/second-factor/shape.d.ts +18 -0
- package/dist/second-factor/shape.d.ts.map +1 -0
- package/dist/second-factor/types/index.d.ts +5 -0
- package/dist/second-factor/types/index.d.ts.map +1 -0
- package/dist/second-factor/types/options.d.ts +61 -0
- package/dist/second-factor/types/options.d.ts.map +1 -0
- package/dist/second-factor/types/out.d.ts +84 -0
- package/dist/second-factor/types/out.d.ts.map +1 -0
- package/dist/second-factor/types/surface.d.ts +89 -0
- package/dist/second-factor/types/surface.d.ts.map +1 -0
- package/dist/social/index.d.ts +10 -0
- package/dist/social/index.d.ts.map +1 -0
- package/dist/social/resolvers.d.ts +25 -0
- package/dist/social/resolvers.d.ts.map +1 -0
- package/dist/social/sdl.d.ts +13 -0
- package/dist/social/sdl.d.ts.map +1 -0
- package/dist/social/shape.d.ts +11 -0
- package/dist/social/shape.d.ts.map +1 -0
- package/dist/social/types.d.ts +160 -0
- package/dist/social/types.d.ts.map +1 -0
- package/dist/surface/api.d.ts +16 -0
- package/dist/surface/api.d.ts.map +1 -0
- package/dist/surface/request.d.ts +10 -0
- package/dist/surface/request.d.ts.map +1 -0
- package/dist/surface/signed-in.d.ts +30 -0
- package/dist/surface/signed-in.d.ts.map +1 -0
- package/dist/types.d.ts +117 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/wiring.d.ts +56 -0
- package/dist/wiring.d.ts.map +1 -0
- package/docs/README.md +26 -0
- package/docs/guide/api-keys.md +365 -0
- package/docs/guide/avatars.md +129 -0
- package/docs/guide/context.md +371 -0
- package/docs/guide/directives.md +371 -0
- package/docs/guide/errors.md +318 -0
- package/docs/guide/federation.md +71 -0
- package/docs/guide/invitations.md +269 -0
- package/docs/guide/passkeys.md +207 -0
- package/docs/guide/second-factor.md +238 -0
- package/docs/guide/social.md +190 -0
- package/docs/guide/step-up.md +208 -0
- package/docs/guide/subscriptions.md +255 -0
- package/docs/guide/telemetry.md +45 -0
- package/docs/roadmap.md +124 -0
- package/docs/troubleshooting.md +1265 -0
- package/graphql/janus-api-keys.graphqls +237 -0
- package/graphql/janus-avatar.graphqls +19 -0
- package/graphql/janus-invitations.graphqls +280 -0
- package/graphql/janus-passkey-sign-in.graphqls +40 -0
- package/graphql/janus-passkeys.graphqls +134 -0
- package/graphql/janus-second-factor.graphqls +199 -0
- package/graphql/janus-social.graphqls +155 -0
- package/graphql/janus.graphqls +44 -0
- package/package.json +80 -5
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/** What every field's resolver reads, resolved once by `secondFactorResolvers()`. */
|
|
2
|
+
import { type Duration } from '@softistx/janus';
|
|
3
|
+
import type { DeviceCookieOptions } from '../../device';
|
|
4
|
+
import type { AnyUser, Context, Current, SecondFactorAction, SecondFactorAuth, SecondFactorResolversOptions, SecondFactorTypeApi } from '../types';
|
|
5
|
+
export interface Deps {
|
|
6
|
+
readonly auth: SecondFactorAuth;
|
|
7
|
+
readonly api: SecondFactorTypeApi;
|
|
8
|
+
readonly answerToken: boolean;
|
|
9
|
+
/** The device cookie's attributes, or `undefined` when devices are not tracked. */
|
|
10
|
+
readonly device: DeviceCookieOptions | undefined;
|
|
11
|
+
readonly freshWithin: Exclude<Duration, number> | undefined;
|
|
12
|
+
readonly freshMs: number | undefined;
|
|
13
|
+
readonly options: SecondFactorResolversOptions<SecondFactorAuth, string, never>;
|
|
14
|
+
/** The request's session; null for no credential and for an API key, which is no session. */
|
|
15
|
+
session(ctx: Context): Promise<Current | null>;
|
|
16
|
+
/** `ctx.janus`'s user: for the reads of the viewer's own status. */
|
|
17
|
+
userOf(ctx: Context): Promise<AnyUser>;
|
|
18
|
+
}
|
|
19
|
+
/** What `depsOf()` answers: the bound instance serving this request. */
|
|
20
|
+
export type DepsSource = (ctx: Context) => Promise<Deps>;
|
|
21
|
+
/**
|
|
22
|
+
* The instance of each request, bound. A given instance is bound once, at
|
|
23
|
+
* wiring (a missing surface is a `TypeError` then); a function is asked on
|
|
24
|
+
* every field, and its answer bound once per instance (a missing surface is
|
|
25
|
+
* a `TypeError` on that request).
|
|
26
|
+
*/
|
|
27
|
+
export declare function depsOf(options: SecondFactorResolversOptions<SecondFactorAuth, string, never>): DepsSource;
|
|
28
|
+
/**
|
|
29
|
+
* The request's session, or `UNAUTHENTICATED`: an API key is no session, so
|
|
30
|
+
* under `useJanus({ apiKey: true })` it cannot change its owner's factor or
|
|
31
|
+
* touch their step-ups.
|
|
32
|
+
*/
|
|
33
|
+
export declare function sessionOrDeny(deps: Deps, ctx: Context): Promise<Current>;
|
|
34
|
+
/**
|
|
35
|
+
* The user of a write, once the request's session is proved, fresh when
|
|
36
|
+
* `freshWithin` is given, and let through by the `guard` hook.
|
|
37
|
+
*/
|
|
38
|
+
export declare function writer(deps: Deps, action: SecondFactorAction, ctx: Context): Promise<AnyUser>;
|
|
39
|
+
//# sourceMappingURL=deps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deps.d.ts","sourceRoot":"","sources":["../../../src/second-factor/resolvers/deps.ts"],"names":[],"mappings":"AAAA,qFAAqF;AAErF,OAAO,EAAE,KAAK,QAAQ,EAAiB,MAAM,iBAAiB,CAAC;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAMxD,OAAO,KAAK,EACX,OAAO,EACP,OAAO,EACP,OAAO,EACP,kBAAkB,EAClB,gBAAgB,EAEhB,4BAA4B,EAC5B,mBAAmB,EACnB,MAAM,UAAU,CAAC;AAElB,MAAM,WAAW,IAAI;IACpB,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAChC,QAAQ,CAAC,GAAG,EAAE,mBAAmB,CAAC;IAClC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,mFAAmF;IACnF,QAAQ,CAAC,MAAM,EAAE,mBAAmB,GAAG,SAAS,CAAC;IACjD,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC,QAAQ,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;IAC5D,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,QAAQ,CAAC,OAAO,EAAE,4BAA4B,CAC7C,gBAAgB,EAChB,MAAM,EACN,KAAK,CACL,CAAC;IACF,6FAA6F;IAC7F,OAAO,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;IAC/C,oEAAoE;IACpE,MAAM,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACvC;AAED,wEAAwE;AACxE,MAAM,MAAM,UAAU,GAAG,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAEzD;;;;;GAKG;AACH,wBAAgB,MAAM,CACrB,OAAO,EAAE,4BAA4B,CAAC,gBAAgB,EAAE,MAAM,EAAE,KAAK,CAAC,GACpE,UAAU,CAkDZ;AAYD;;;;GAIG;AACH,wBAAsB,aAAa,CAClC,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,OAAO,GACV,OAAO,CAAC,OAAO,CAAC,CAIlB;AAED;;;GAGG;AACH,wBAAsB,MAAM,CAC3B,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,kBAAkB,EAC1B,GAAG,EAAE,OAAO,GACV,OAAO,CAAC,OAAO,CAAC,CAUlB"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The resolvers of the second-factor SDL: two `Query` fields and eight
|
|
3
|
+
* `Mutation` fields. A completed sign-in sets the session cookie and the
|
|
4
|
+
* device cookie through `useJanus()`'s `onResponse`, as a renewed session is.
|
|
5
|
+
*/
|
|
6
|
+
import type { Context, SecondFactorAuth, SecondFactorResolvers, SecondFactorResolversOptions, SecondFactorViewerFields } from '../types';
|
|
7
|
+
/**
|
|
8
|
+
* The resolvers of the second-factor SDL. A refusal of the core —
|
|
9
|
+
* `CODE_INVALID`, `TOKEN_UNKNOWN`, `SECOND_FACTOR_ACTIVE`,
|
|
10
|
+
* `SECOND_FACTOR_NOT_ENROLLED`, `STEP_UP_REQUIRED`… — is rethrown as its
|
|
11
|
+
* `GraphQLError`, so `janusMaskError()` answers its code and status. Needs
|
|
12
|
+
* `useJanus()` for the directives and to set the cookies of a completed
|
|
13
|
+
* sign-in. Throws a `TypeError` at wiring when `auth` (or `auth[type]`)
|
|
14
|
+
* carries no `secondFactor` surface (with `auth` a function: on the request
|
|
15
|
+
* that gets such an instance), or `freshWithin` is not a duration
|
|
16
|
+
* string.
|
|
17
|
+
*
|
|
18
|
+
* The writes and `requestStepUp` need a session: an API key (under
|
|
19
|
+
* `useJanus({ apiKey: true })`) is `UNAUTHENTICATED` there.
|
|
20
|
+
*
|
|
21
|
+
* ```ts
|
|
22
|
+
* const resolvers = mergeResolvers([secondFactorResolvers({ auth, freshWithin: '10m' }), mine]);
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* `Query` and `Mutation` are keys of the map: merge it with yours rather than
|
|
26
|
+
* spreading over them.
|
|
27
|
+
*/
|
|
28
|
+
export declare function secondFactorResolvers<A extends SecondFactorAuth, const T extends string = never, Ctx = Context>(options: SecondFactorResolversOptions<A, T, Ctx>): SecondFactorResolvers;
|
|
29
|
+
/**
|
|
30
|
+
* The two fields for your own `Viewer` type — `secondFactor { enabled
|
|
31
|
+
* recoveryCodesLeft }` and `sessionConfirmedUntil` — read from the request's
|
|
32
|
+
* session, with the same options as `secondFactorResolvers`.
|
|
33
|
+
*
|
|
34
|
+
* ```ts
|
|
35
|
+
* resolvers: { Viewer: secondFactorViewerFields({ auth, freshWithin: '10m' }) }
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export declare function secondFactorViewerFields<A extends SecondFactorAuth, const T extends string = never, Ctx = Context>(options: SecondFactorResolversOptions<A, T, Ctx>): SecondFactorViewerFields;
|
|
39
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/second-factor/resolvers/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACX,OAAO,EACP,gBAAgB,EAChB,qBAAqB,EACrB,4BAA4B,EAC5B,wBAAwB,EACxB,MAAM,UAAU,CAAC;AAYlB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,qBAAqB,CACpC,CAAC,SAAS,gBAAgB,EAC1B,KAAK,CAAC,CAAC,SAAS,MAAM,GAAG,KAAK,EAC9B,GAAG,GAAG,OAAO,EACZ,OAAO,EAAE,4BAA4B,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,GAAG,qBAAqB,CAoBzE;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CACvC,CAAC,SAAS,gBAAgB,EAC1B,KAAK,CAAC,CAAC,SAAS,MAAM,GAAG,KAAK,EAC9B,GAAG,GAAG,OAAO,EACZ,OAAO,EAAE,4BAA4B,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,GAAG,wBAAwB,CAM5E"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** `confirmSecondFactor` and `recoverSecondFactor`: redeem a sign-in's challenge. */
|
|
2
|
+
import type { SecondFactorResolvers } from '../types';
|
|
3
|
+
import type { DepsSource } from './deps';
|
|
4
|
+
type Mutations = SecondFactorResolvers['Mutation'];
|
|
5
|
+
/** `confirmSecondFactor`: redeems a sign-in's challenge with the app's code. */
|
|
6
|
+
export declare function confirmSecondFactor(source: DepsSource): Mutations['confirmSecondFactor'];
|
|
7
|
+
/** `recoverSecondFactor`: redeems it with a recovery code. */
|
|
8
|
+
export declare function recoverSecondFactor(source: DepsSource): Mutations['recoverSecondFactor'];
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=sign-in.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sign-in.d.ts","sourceRoot":"","sources":["../../../src/second-factor/resolvers/sign-in.ts"],"names":[],"mappings":"AAAA,qFAAqF;AAOrF,OAAO,KAAK,EAAW,qBAAqB,EAAe,MAAM,UAAU,CAAC;AAC5E,OAAO,KAAK,EAAQ,UAAU,EAAE,MAAM,QAAQ,CAAC;AAE/C,KAAK,SAAS,GAAG,qBAAqB,CAAC,UAAU,CAAC,CAAC;AAYnD,gFAAgF;AAChF,wBAAgB,mBAAmB,CAClC,MAAM,EAAE,UAAU,GAChB,SAAS,CAAC,qBAAqB,CAAC,CAelC;AAED,8DAA8D;AAC9D,wBAAgB,mBAAmB,CAClC,MAAM,EAAE,UAAU,GAChB,SAAS,CAAC,qBAAqB,CAAC,CAelC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** `Query.secondFactor` and `Query.sessionConfirmedUntil`, also the fields of your `Viewer`. */
|
|
2
|
+
import type { SecondFactorResolvers } from '../types';
|
|
3
|
+
import type { DepsSource } from './deps';
|
|
4
|
+
type Queries = SecondFactorResolvers['Query'];
|
|
5
|
+
/** `secondFactor`: whether the factor is active, and the recovery codes left. */
|
|
6
|
+
export declare function status(source: DepsSource): Queries['secondFactor'];
|
|
7
|
+
/** `sessionConfirmedUntil`: the session's last proof plus `freshWithin`; null without either. */
|
|
8
|
+
export declare function sessionConfirmedUntil(source: DepsSource): Queries['sessionConfirmedUntil'];
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/second-factor/resolvers/status.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAGhG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEzC,KAAK,OAAO,GAAG,qBAAqB,CAAC,OAAO,CAAC,CAAC;AAE9C,iFAAiF;AACjF,wBAAgB,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,cAAc,CAAC,CAYlE;AAED,iGAAiG;AACjG,wBAAgB,qBAAqB,CACpC,MAAM,EAAE,UAAU,GAChB,OAAO,CAAC,uBAAuB,CAAC,CAUlC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** `requestStepUp` and `confirmStepUp`, and the guard on a user type that has no step-up. */
|
|
2
|
+
import type { SecondFactorResolvers, SecondFactorTypeApi } from '../types';
|
|
3
|
+
import { type DepsSource } from './deps';
|
|
4
|
+
type Mutations = SecondFactorResolvers['Mutation'];
|
|
5
|
+
/** The step-up surface, or a `TypeError`: `stepUp` exists on a user type with an e-mail only. */
|
|
6
|
+
export declare function stepUpOf(api: SecondFactorTypeApi, caller: string): NonNullable<SecondFactorTypeApi['stepUp']>;
|
|
7
|
+
/**
|
|
8
|
+
* `requestStepUp`: the app's code for a user with a factor, else an e-mailed
|
|
9
|
+
* one through `sendStepUpCode`. Only a session asks: an API key cannot cancel
|
|
10
|
+
* its owner's step-ups.
|
|
11
|
+
*/
|
|
12
|
+
export declare function requestStepUp(source: DepsSource): Mutations['requestStepUp'];
|
|
13
|
+
/** `confirmStepUp`: the code; the request's session is stamped, and answered with its end. */
|
|
14
|
+
export declare function confirmStepUp(source: DepsSource): Mutations['confirmStepUp'];
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=step-up.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-up.d.ts","sourceRoot":"","sources":["../../../src/second-factor/resolvers/step-up.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAK7F,OAAO,KAAK,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC3E,OAAO,EAAE,KAAK,UAAU,EAAiB,MAAM,QAAQ,CAAC;AAExD,KAAK,SAAS,GAAG,qBAAqB,CAAC,UAAU,CAAC,CAAC;AAEnD,iGAAiG;AACjG,wBAAgB,QAAQ,CACvB,GAAG,EAAE,mBAAmB,EACxB,MAAM,EAAE,MAAM,GACZ,WAAW,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAO5C;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,UAAU,GAAG,SAAS,CAAC,eAAe,CAAC,CAsB5E;AAED,8FAA8F;AAC9F,wBAAgB,aAAa,CAAC,MAAM,EAAE,UAAU,GAAG,SAAS,CAAC,eAAe,CAAC,CAgB5E"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** The four writes of the factor: enroll, activate, regenerate the recovery codes, disable. */
|
|
2
|
+
import type { SecondFactorResolvers } from '../types';
|
|
3
|
+
import { type DepsSource } from './deps';
|
|
4
|
+
type Mutations = SecondFactorResolvers['Mutation'];
|
|
5
|
+
/** `enrollSecondFactor`: the secret and the URI to show as a QR code; never cached. */
|
|
6
|
+
export declare function enrollSecondFactor(source: DepsSource): Mutations['enrollSecondFactor'];
|
|
7
|
+
/** `activateSecondFactor`: the first code; answers the ten recovery codes, never cached. */
|
|
8
|
+
export declare function activateSecondFactor(source: DepsSource): Mutations['activateSecondFactor'];
|
|
9
|
+
/** `regenerateRecoveryCodes`: ten new codes on a current code of the app, never cached. */
|
|
10
|
+
export declare function regenerateRecoveryCodes(source: DepsSource): Mutations['regenerateRecoveryCodes'];
|
|
11
|
+
/**
|
|
12
|
+
* `disableSecondFactor`: a current code of the app, checked by a step-up of
|
|
13
|
+
* the request's session (five attempts per challenge, counted with the
|
|
14
|
+
* recovery-code tries), then the factor is removed. A user with no active
|
|
15
|
+
* factor is refused before any step-up is issued.
|
|
16
|
+
*/
|
|
17
|
+
export declare function disableSecondFactor(source: DepsSource): Mutations['disableSecondFactor'];
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=writes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"writes.d.ts","sourceRoot":"","sources":["../../../src/second-factor/resolvers/writes.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAM/F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,EAAE,KAAK,UAAU,EAAU,MAAM,QAAQ,CAAC;AAGjD,KAAK,SAAS,GAAG,qBAAqB,CAAC,UAAU,CAAC,CAAC;AAEnD,uFAAuF;AACvF,wBAAgB,kBAAkB,CACjC,MAAM,EAAE,UAAU,GAChB,SAAS,CAAC,oBAAoB,CAAC,CAUjC;AAED,4FAA4F;AAC5F,wBAAgB,oBAAoB,CACnC,MAAM,EAAE,UAAU,GAChB,SAAS,CAAC,sBAAsB,CAAC,CAUnC;AAED,2FAA2F;AAC3F,wBAAgB,uBAAuB,CACtC,MAAM,EAAE,UAAU,GAChB,SAAS,CAAC,yBAAyB,CAAC,CAUtC;AAUD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAClC,MAAM,EAAE,UAAU,GAChB,SAAS,CAAC,qBAAqB,CAAC,CAclC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The opt-in TOTP second-factor SDL: put it beside your own type definitions
|
|
3
|
+
* when users may hold an authenticator app (`janus({ secondFactor })`). It
|
|
4
|
+
* `extend`s your `Query` and `Mutation`, and needs `janusTypeDefs` for
|
|
5
|
+
* `@authenticated`. The same text ships as
|
|
6
|
+
* `graphql/janus-second-factor.graphqls` — `sdl.spec.ts` holds that the two
|
|
7
|
+
* are identical. Timestamps are ISO-8601 `String`s: no scalar to collide with.
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* createSchema({ typeDefs: [janusTypeDefs, janusSecondFactorTypeDefs, typeDefs], resolvers });
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export declare const janusSecondFactorTypeDefs: string;
|
|
14
|
+
//# sourceMappingURL=sdl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdl.d.ts","sourceRoot":"","sources":["../../src/second-factor/sdl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,yBAAyB,EAAE,MAuMvC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The answers of the second-factor resolvers: a core result as the plain
|
|
3
|
+
* object the schema's fields read, timestamps as ISO-8601 strings.
|
|
4
|
+
*/
|
|
5
|
+
import type { ChallengeIn, ChallengeOut } from './types';
|
|
6
|
+
/**
|
|
7
|
+
* The sign-in challenge as `JanusSecondFactorChallenge`, for your own
|
|
8
|
+
* sign-in resolver: pass it the core's `status: 'secondFactor'` answer and the
|
|
9
|
+
* request (`ctx.request`). The challenge is single-use, so the response is sent
|
|
10
|
+
* `Cache-Control: no-store` (through `useJanus()`'s `onResponse`, over HTTP);
|
|
11
|
+
* without the request nothing is sent and the response is yours to mark.
|
|
12
|
+
*
|
|
13
|
+
* ```ts
|
|
14
|
+
* if (result.status === 'secondFactor') return { __typename: 'JanusSecondFactorChallenge', ...secondFactorChallengeOut(result, ctx.request) };
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare function secondFactorChallengeOut(result: ChallengeIn, request?: Request): ChallengeOut;
|
|
18
|
+
//# sourceMappingURL=shape.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shape.d.ts","sourceRoot":"","sources":["../../src/second-factor/shape.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEzD;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,CACvC,MAAM,EAAE,WAAW,EACnB,OAAO,CAAC,EAAE,OAAO,GACf,YAAY,CAWd"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** The types of the second-factor resolvers: the surface they call, their options, and their answers. */
|
|
2
|
+
export type { Context, SecondFactorAction, SecondFactorResolversOptions, } from './options';
|
|
3
|
+
export type { ChallengeIn, ChallengeOut, ConfirmedOut, RecoveryCodesOut, SecondFactorResolvers, SecondFactorViewerFields, SignedInOut, StatusOut, StepUpOut, } from './out';
|
|
4
|
+
export type { AnyUser, Current, SecondFactorAuth, SecondFactorAuthSource, SecondFactorSurface, SecondFactorTypeApi, } from './surface';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/second-factor/types/index.ts"],"names":[],"mappings":"AAAA,yGAAyG;AAEzG,YAAY,EACX,OAAO,EACP,kBAAkB,EAClB,4BAA4B,GAC5B,MAAM,WAAW,CAAC;AACnB,YAAY,EACX,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,qBAAqB,EACrB,wBAAwB,EACxB,WAAW,EACX,SAAS,EACT,SAAS,GACT,MAAM,OAAO,CAAC;AACf,YAAY,EACX,OAAO,EACP,OAAO,EACP,gBAAgB,EAChB,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,GACnB,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/** What `secondFactorResolvers()` takes. */
|
|
2
|
+
import type { Duration, StepUpByEmail } from '@softistx/janus';
|
|
3
|
+
import type { DeviceCookieOptions } from '../../device';
|
|
4
|
+
import type { AnyUser, SecondFactorAuth, SecondFactorAuthSource, SecondFactorSurface } from './surface';
|
|
5
|
+
/** A GraphQL context as these resolvers read it. */
|
|
6
|
+
export interface Context {
|
|
7
|
+
readonly request?: Request;
|
|
8
|
+
}
|
|
9
|
+
/** The writes the `guard` hook is asked about. */
|
|
10
|
+
export type SecondFactorAction = 'enroll' | 'activate' | 'regenerateRecoveryCodes' | 'disable';
|
|
11
|
+
export interface SecondFactorResolversOptions<A extends SecondFactorAuth = SecondFactorAuth, T extends string = string, Ctx = Context> {
|
|
12
|
+
/**
|
|
13
|
+
* What `janus()` answered; its instance needs `secondFactor`. Or a
|
|
14
|
+
* function of the GraphQL context answering the instance that serves the
|
|
15
|
+
* request — `(ctx) => instances.get(ctx.host)` — to serve several tenants
|
|
16
|
+
* from one schema. It runs on every field, awaited when it returns a
|
|
17
|
+
* promise; `null` or `undefined` for none is `UNAUTHENTICATED`, 401. An
|
|
18
|
+
* instance that lacks the surface is then a `TypeError` on that request,
|
|
19
|
+
* not at wiring. Give `useJanus()` the same function.
|
|
20
|
+
*/
|
|
21
|
+
readonly auth: SecondFactorAuthSource<A & SecondFactorSurface<T>, Ctx>;
|
|
22
|
+
/**
|
|
23
|
+
* The user type that holds the factor. Needed when several user types are
|
|
24
|
+
* configured (`auth.<type>.secondFactor` is then the surface); it also
|
|
25
|
+
* limits the fields to that type's users.
|
|
26
|
+
*/
|
|
27
|
+
readonly type?: T;
|
|
28
|
+
/**
|
|
29
|
+
* Answer the session token in `SecondFactorSignedIn.token` instead of
|
|
30
|
+
* setting the session cookie, for a backend-for-frontend that keeps the
|
|
31
|
+
* token in its own cookie. Off by default.
|
|
32
|
+
*/
|
|
33
|
+
readonly answerToken?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Track the device of the sign-in, as a sign-in mutation does: `true`, or
|
|
36
|
+
* the device cookie's attributes. Needs `janus({ devices })`.
|
|
37
|
+
*/
|
|
38
|
+
readonly device?: DeviceCookieOptions | true;
|
|
39
|
+
/**
|
|
40
|
+
* The freshness window, a duration with its unit (`'10m'`): your policy.
|
|
41
|
+
* Given, `enrollSecondFactor`, `activateSecondFactor`,
|
|
42
|
+
* `regenerateRecoveryCodes` and `disableSecondFactor` refuse a session
|
|
43
|
+
* that proved who it is longer ago (`STEP_UP_REQUIRED`), and
|
|
44
|
+
* `sessionConfirmedUntil` and `confirmStepUp` answer when it ends. Not
|
|
45
|
+
* given: no freshness is asked for here, and no end is answered.
|
|
46
|
+
*/
|
|
47
|
+
readonly freshWithin?: Exclude<Duration, number>;
|
|
48
|
+
/**
|
|
49
|
+
* Runs before each write of the factor, after the freshness check: throw to
|
|
50
|
+
* refuse (a role that must keep its factor, a verified e-mail asked
|
|
51
|
+
* before `enroll`). A thrown `GraphQLError` is answered as it is.
|
|
52
|
+
*/
|
|
53
|
+
readonly guard?: (action: SecondFactorAction, user: AnyUser, ctx: Context) => void | Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* Sends the e-mailed code of a step-up for a user with no active factor
|
|
56
|
+
* (`issued.email`, `issued.code`). Without it, `requestStepUp` refuses such
|
|
57
|
+
* a user with a `TypeError` before issuing anything.
|
|
58
|
+
*/
|
|
59
|
+
readonly sendStepUpCode?: (issued: StepUpByEmail<AnyUser>, ctx: Context) => void | Promise<void>;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/second-factor/types/options.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAE5C,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,KAAK,EACX,OAAO,EACP,gBAAgB,EAChB,sBAAsB,EACtB,mBAAmB,EACnB,MAAM,WAAW,CAAC;AAEnB,oDAAoD;AACpD,MAAM,WAAW,OAAO;IACvB,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,kDAAkD;AAClD,MAAM,MAAM,kBAAkB,GAC3B,QAAQ,GACR,UAAU,GACV,yBAAyB,GACzB,SAAS,CAAC;AAEb,MAAM,WAAW,4BAA4B,CAC5C,CAAC,SAAS,gBAAgB,GAAG,gBAAgB,EAC7C,CAAC,SAAS,MAAM,GAAG,MAAM,EACzB,GAAG,GAAG,OAAO;IAEb;;;;;;;;OAQG;IACH,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAC,CAAC,GAAG,mBAAmB,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IACvE;;;;OAIG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAClB;;;;OAIG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAC/B;;;OAGG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAC;IAC7C;;;;;;;OAOG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACjD;;;;OAIG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,CAChB,MAAM,EAAE,kBAAkB,EAC1B,IAAI,EAAE,OAAO,EACb,GAAG,EAAE,OAAO,KACR,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B;;;;OAIG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,CACzB,MAAM,EAAE,aAAa,CAAC,OAAO,CAAC,EAC9B,GAAG,EAAE,OAAO,KACR,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1B"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/** The resolver map these resolvers return, and the plain objects the schema's fields read. */
|
|
2
|
+
import type { AnyUser, Context } from './index';
|
|
3
|
+
type Resolver<Args, Out> = (parent: unknown, args: Args, ctx: Context) => Promise<Out>;
|
|
4
|
+
/** The resolver map, keyed as `createSchema` expects. */
|
|
5
|
+
export interface SecondFactorResolvers {
|
|
6
|
+
readonly Query: {
|
|
7
|
+
readonly secondFactor: Resolver<unknown, StatusOut>;
|
|
8
|
+
readonly sessionConfirmedUntil: Resolver<unknown, string | null>;
|
|
9
|
+
};
|
|
10
|
+
readonly Mutation: {
|
|
11
|
+
readonly confirmSecondFactor: Resolver<{
|
|
12
|
+
readonly challenge: string;
|
|
13
|
+
readonly code: string;
|
|
14
|
+
}, SignedInOut>;
|
|
15
|
+
readonly recoverSecondFactor: Resolver<{
|
|
16
|
+
readonly challenge: string;
|
|
17
|
+
readonly recoveryCode: string;
|
|
18
|
+
}, SignedInOut>;
|
|
19
|
+
readonly enrollSecondFactor: Resolver<unknown, {
|
|
20
|
+
readonly secret: string;
|
|
21
|
+
readonly uri: string;
|
|
22
|
+
}>;
|
|
23
|
+
readonly activateSecondFactor: Resolver<{
|
|
24
|
+
readonly code: string;
|
|
25
|
+
}, RecoveryCodesOut>;
|
|
26
|
+
readonly regenerateRecoveryCodes: Resolver<{
|
|
27
|
+
readonly code: string;
|
|
28
|
+
}, RecoveryCodesOut>;
|
|
29
|
+
readonly disableSecondFactor: Resolver<{
|
|
30
|
+
readonly code: string;
|
|
31
|
+
}, boolean>;
|
|
32
|
+
readonly requestStepUp: Resolver<unknown, StepUpOut>;
|
|
33
|
+
readonly confirmStepUp: Resolver<{
|
|
34
|
+
readonly challenge: string;
|
|
35
|
+
readonly code: string;
|
|
36
|
+
}, ConfirmedOut>;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/** The fields to put under your own `Viewer`. */
|
|
40
|
+
export interface SecondFactorViewerFields {
|
|
41
|
+
readonly secondFactor: Resolver<unknown, StatusOut>;
|
|
42
|
+
readonly sessionConfirmedUntil: Resolver<unknown, string | null>;
|
|
43
|
+
}
|
|
44
|
+
export interface StatusOut {
|
|
45
|
+
readonly enabled: boolean;
|
|
46
|
+
readonly recoveryCodesLeft: number | null;
|
|
47
|
+
}
|
|
48
|
+
export interface RecoveryCodesOut {
|
|
49
|
+
readonly recoveryCodes: readonly string[];
|
|
50
|
+
}
|
|
51
|
+
export interface StepUpOut {
|
|
52
|
+
readonly via: 'email' | 'secondFactor';
|
|
53
|
+
readonly challenge: string;
|
|
54
|
+
readonly expiresAt: string;
|
|
55
|
+
}
|
|
56
|
+
export interface ConfirmedOut {
|
|
57
|
+
readonly confirmedAt: string;
|
|
58
|
+
readonly confirmedUntil: string | null;
|
|
59
|
+
}
|
|
60
|
+
export interface SignedInOut {
|
|
61
|
+
/** For a `user` field of your own on `SecondFactorSignedIn`. */
|
|
62
|
+
readonly user: AnyUser;
|
|
63
|
+
/** The session token with `answerToken`, else null. */
|
|
64
|
+
readonly token: string | null;
|
|
65
|
+
readonly userId: string;
|
|
66
|
+
readonly expiresAt: string;
|
|
67
|
+
readonly newDevice: boolean;
|
|
68
|
+
readonly recoveryCodesLeft: number | null;
|
|
69
|
+
}
|
|
70
|
+
/** What `secondFactorChallengeOut` reads of the core's `secondFactor` sign-in answer. */
|
|
71
|
+
export interface ChallengeIn {
|
|
72
|
+
readonly challenge: string;
|
|
73
|
+
readonly expiresAt: Date;
|
|
74
|
+
readonly methods: readonly string[];
|
|
75
|
+
readonly passkeyOptions?: Readonly<Record<string, unknown>>;
|
|
76
|
+
}
|
|
77
|
+
export interface ChallengeOut {
|
|
78
|
+
readonly challenge: string;
|
|
79
|
+
readonly expiresAt: string;
|
|
80
|
+
readonly methods: readonly string[];
|
|
81
|
+
readonly passkeyOptions: string | null;
|
|
82
|
+
}
|
|
83
|
+
export {};
|
|
84
|
+
//# sourceMappingURL=out.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"out.d.ts","sourceRoot":"","sources":["../../../src/second-factor/types/out.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/** The part of `janus()`'s answer the second-factor resolvers call, and what they read of a user. */
|
|
2
|
+
import type { Session, SignedIn, StepUpByApp, StepUpByEmail } from '@softistx/janus';
|
|
3
|
+
/** The user as these resolvers read one. */
|
|
4
|
+
export type AnyUser = {
|
|
5
|
+
readonly type: string;
|
|
6
|
+
readonly id: string;
|
|
7
|
+
readonly hasSecondFactor?: boolean;
|
|
8
|
+
};
|
|
9
|
+
/** A session as `authenticate` answers it for a request that presented one. */
|
|
10
|
+
export interface Current {
|
|
11
|
+
readonly via: 'session';
|
|
12
|
+
readonly user: AnyUser;
|
|
13
|
+
readonly session: Session;
|
|
14
|
+
readonly token: string;
|
|
15
|
+
readonly renewed: boolean;
|
|
16
|
+
}
|
|
17
|
+
/** What a user type answers once `janus()` is given a `secondFactor` (and, for a step-up, an e-mail). */
|
|
18
|
+
export interface SecondFactorTypeApi {
|
|
19
|
+
readonly secondFactor: {
|
|
20
|
+
enroll(user: {
|
|
21
|
+
readonly id: string;
|
|
22
|
+
}): Promise<{
|
|
23
|
+
readonly secret: string;
|
|
24
|
+
readonly uri: string;
|
|
25
|
+
}>;
|
|
26
|
+
activate(user: {
|
|
27
|
+
readonly id: string;
|
|
28
|
+
}, code: string): Promise<{
|
|
29
|
+
readonly recoveryCodes: readonly string[];
|
|
30
|
+
}>;
|
|
31
|
+
regenerateRecoveryCodes(user: {
|
|
32
|
+
readonly id: string;
|
|
33
|
+
}, code: string): Promise<{
|
|
34
|
+
readonly recoveryCodes: readonly string[];
|
|
35
|
+
}>;
|
|
36
|
+
disable(user: {
|
|
37
|
+
readonly id: string;
|
|
38
|
+
}): Promise<unknown>;
|
|
39
|
+
confirm(challenge: string, code: string, options?: {
|
|
40
|
+
readonly device?: string | null;
|
|
41
|
+
}): Promise<SignedIn<AnyUser>>;
|
|
42
|
+
recover(challenge: string, code: string, options?: {
|
|
43
|
+
readonly device?: string | null;
|
|
44
|
+
}): Promise<SignedIn<AnyUser> & {
|
|
45
|
+
readonly recoveryCodesLeft: number;
|
|
46
|
+
}>;
|
|
47
|
+
recoveryCodesLeft(user: {
|
|
48
|
+
readonly id: string;
|
|
49
|
+
}): Promise<number | null>;
|
|
50
|
+
};
|
|
51
|
+
/** Absent on a user type with no e-mail. */
|
|
52
|
+
readonly stepUp?: {
|
|
53
|
+
request(user: {
|
|
54
|
+
readonly id: string;
|
|
55
|
+
}): Promise<StepUpByEmail<AnyUser> | StepUpByApp<AnyUser>>;
|
|
56
|
+
confirm(request: Request, challenge: string, code: string): Promise<Session>;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* What these resolvers call of every `janus()` answer: `authenticate` and the
|
|
61
|
+
* session `cookie`. The second-factor surface is required beside it by
|
|
62
|
+
* {@link SecondFactorSurface}: loosely typed on purpose, the types of your
|
|
63
|
+
* instance narrow its own calls.
|
|
64
|
+
*/
|
|
65
|
+
export interface SecondFactorAuth {
|
|
66
|
+
authenticate(request: Request, options?: {
|
|
67
|
+
readonly type?: string;
|
|
68
|
+
}): Promise<Current | null>;
|
|
69
|
+
readonly cookie: {
|
|
70
|
+
serialize(token: string, session: Session): string;
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* What `auth` must carry besides {@link SecondFactorAuth}: `secondFactor` (and
|
|
75
|
+
* `stepUp`) at its top (one user type; `type` then only limits the fields),
|
|
76
|
+
* or under the named `type` with several.
|
|
77
|
+
*/
|
|
78
|
+
export type SecondFactorSurface<T extends string> = [T] extends [never] ? SecondFactorTypeApi : SecondFactorTypeApi | {
|
|
79
|
+
readonly [K in T]: SecondFactorTypeApi;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* `auth` as `secondFactorResolvers()` takes it: the instance, or a function
|
|
83
|
+
* of the GraphQL context answering the instance that serves the request
|
|
84
|
+
* (`null` or `undefined` for none), as `passkeyResolvers()` takes it.
|
|
85
|
+
*/
|
|
86
|
+
export type SecondFactorAuthSource<A, Ctx = {
|
|
87
|
+
readonly request?: Request;
|
|
88
|
+
}> = A | ((ctx: Ctx) => A | null | undefined | Promise<A | null | undefined>);
|
|
89
|
+
//# sourceMappingURL=surface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"surface.d.ts","sourceRoot":"","sources":["../../../src/second-factor/types/surface.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The social sign-in surface, opt-in: `janusSocialTypeDefs` beside your own
|
|
3
|
+
* type definitions and `socialResolvers({ auth, type? })` for its fields.
|
|
4
|
+
* The visitor's flow is kept by the caller (a BFF's own cookie); a completed
|
|
5
|
+
* sign-in sets the session cookie.
|
|
6
|
+
*/
|
|
7
|
+
export { socialResolvers } from './resolvers';
|
|
8
|
+
export { janusSocialTypeDefs } from './sdl';
|
|
9
|
+
export type { SocialAuth, SocialAuthSource, SocialResolvers, SocialResolversOptions, } from './types';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/social/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAC5C,YAAY,EACX,UAAU,EACV,gBAAgB,EAChB,eAAe,EACf,sBAAsB,GACtB,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The resolvers of the social SDL: `Query.socialLinks`, the four
|
|
3
|
+
* `Mutation` fields and the result union's `__resolveType`. The flow is the
|
|
4
|
+
* caller's to keep (the BFF's own cookie): nothing here sets a flow cookie.
|
|
5
|
+
* A completed sign-in sets the session cookie through `useJanus()`'s
|
|
6
|
+
* `onResponse`, as a renewed one is.
|
|
7
|
+
*/
|
|
8
|
+
import type { SocialResolvers, SocialResolversOptions } from './types';
|
|
9
|
+
/**
|
|
10
|
+
* The resolvers of the social SDL. A refusal of the core — `FLOW_EXPIRED`,
|
|
11
|
+
* `PROVIDER_ERROR` (502), `SOCIAL_ACCOUNT_TAKEN`… — is rethrown as its
|
|
12
|
+
* `GraphQLError`, so `janusMaskError()` answers its code and status; a
|
|
13
|
+
* refusal after the flow was authenticated also carries `returnTo` and
|
|
14
|
+
* `flowSpent` in its `extensions`. Needs `useJanus()` for the directives and
|
|
15
|
+
* to set the session cookie of a completed sign-in.
|
|
16
|
+
*
|
|
17
|
+
* ```ts
|
|
18
|
+
* const resolvers = mergeResolvers([socialResolvers({ auth }), mine]);
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* `Query` and `Mutation` are keys of the map: merge it with yours rather than
|
|
22
|
+
* spreading over them.
|
|
23
|
+
*/
|
|
24
|
+
export declare function socialResolvers(options: SocialResolversOptions): SocialResolvers;
|
|
25
|
+
//# sourceMappingURL=resolvers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../src/social/resolvers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAQH,OAAO,KAAK,EAKX,eAAe,EACf,sBAAsB,EACtB,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAC9B,OAAO,EAAE,sBAAsB,GAC7B,eAAe,CA8DjB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The opt-in social sign-in SDL: put it beside your own type definitions when
|
|
3
|
+
* users sign in with an external provider. It `extend`s your `Query` and
|
|
4
|
+
* `Mutation`, and needs `janusTypeDefs` for its directives. The same text
|
|
5
|
+
* ships as `graphql/janus-social.graphqls` — `sdl.spec.ts` holds that the two
|
|
6
|
+
* are identical. Timestamps are ISO-8601 `String`s: no scalar to collide with.
|
|
7
|
+
*
|
|
8
|
+
* ```ts
|
|
9
|
+
* createSchema({ typeDefs: [janusTypeDefs, janusSocialTypeDefs, typeDefs], resolvers });
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
12
|
+
export declare const janusSocialTypeDefs: string;
|
|
13
|
+
//# sourceMappingURL=sdl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdl.d.ts","sourceRoot":"","sources":["../../src/social/sdl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,mBAAmB,EAAE,MA2JjC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The answers of the social resolvers: a core result as the plain object the
|
|
3
|
+
* schema's fields read, timestamps as ISO-8601 strings.
|
|
4
|
+
*/
|
|
5
|
+
import type { SocialFlowStart, SocialLink } from '@softistx/janus';
|
|
6
|
+
import type { FlowOut, LinkOut } from './types';
|
|
7
|
+
export declare const linkOut: (link: SocialLink) => LinkOut;
|
|
8
|
+
export declare const flowOut: (start: SocialFlowStart) => FlowOut;
|
|
9
|
+
/** The query of the provider's callback URL, absolute or relative; nothing of it is echoed back. */
|
|
10
|
+
export declare function callbackOf(callbackUrl: string): URLSearchParams;
|
|
11
|
+
//# sourceMappingURL=shape.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shape.d.ts","sourceRoot":"","sources":["../../src/social/shape.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAEnE,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAEhD,eAAO,MAAM,OAAO,SAAU,UAAU,KAAG,OAKzC,CAAC;AAEH,eAAO,MAAM,OAAO,UAAW,eAAe,KAAG,OAI/C,CAAC;AAEH,oGAAoG;AACpG,wBAAgB,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,eAAe,CAQ/D"}
|