@adonis-agora/authkit-server 0.81.2 → 0.81.3
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/build/src/host/durable/account_deletion_workflow.d.ts +5 -1
- package/build/src/host/durable/account_deletion_workflow.js +3 -2
- package/build/src/host/durable/account_export_workflow.d.ts +4 -0
- package/build/src/host/durable/account_export_workflow.js +2 -1
- package/build/src/host/durable/index.d.ts +2 -2
- package/build/src/host/durable/index.js +5 -4
- package/build/src/host/durable/package_origin.d.ts +7 -0
- package/build/src/host/durable/package_origin.js +7 -0
- package/package.json +1 -1
|
@@ -33,7 +33,7 @@ export interface AccountDeletionWorkflowDeps {
|
|
|
33
33
|
* ```ts
|
|
34
34
|
* import { defineAccountDeletionWorkflow } from '@adonis-agora/authkit-server/durable'
|
|
35
35
|
* const wf = defineAccountDeletionWorkflow({ oidc: () => app.container.make('authkit.server') })
|
|
36
|
-
* engine.register(wf.name, wf.version, wf.body)
|
|
36
|
+
* engine.register(wf.name, wf.version, wf.body, wf.options)
|
|
37
37
|
* ```
|
|
38
38
|
*
|
|
39
39
|
* O corpo é FORWARD-ONLY (sem compensação — nunca des-deleta): cada etapa do
|
|
@@ -47,4 +47,8 @@ export declare function defineAccountDeletionWorkflow(deps: AccountDeletionWorkf
|
|
|
47
47
|
name: string;
|
|
48
48
|
version: string;
|
|
49
49
|
body: WorkflowBody;
|
|
50
|
+
/** Opções de `engine.register` — carimba `origin` com o nome deste pacote. */
|
|
51
|
+
options: {
|
|
52
|
+
origin: string;
|
|
53
|
+
};
|
|
50
54
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { anonymizeAudit, auditDeleted, deleteAccountAvatar, deleteAccountRow, disableMfa, removeFromOrgs, removePasskeys, revokePats, revokeSessions, snapshotAccount, unlinkProviders, } from '../account_deletion_ops.js';
|
|
2
|
+
import { PACKAGE_ORIGIN } from './package_origin.js';
|
|
2
3
|
/** Nome canônico do workflow durável de deleção de conta. */
|
|
3
4
|
export const ACCOUNT_DELETE_WORKFLOW = 'authkit.account.delete';
|
|
4
5
|
/** Estado inicial vazio do {@link DeletionResult} (acumulado etapa a etapa). */
|
|
@@ -26,7 +27,7 @@ function emptyResult() {
|
|
|
26
27
|
* ```ts
|
|
27
28
|
* import { defineAccountDeletionWorkflow } from '@adonis-agora/authkit-server/durable'
|
|
28
29
|
* const wf = defineAccountDeletionWorkflow({ oidc: () => app.container.make('authkit.server') })
|
|
29
|
-
* engine.register(wf.name, wf.version, wf.body)
|
|
30
|
+
* engine.register(wf.name, wf.version, wf.body, wf.options)
|
|
30
31
|
* ```
|
|
31
32
|
*
|
|
32
33
|
* O corpo é FORWARD-ONLY (sem compensação — nunca des-deleta): cada etapa do
|
|
@@ -82,5 +83,5 @@ export function defineAccountDeletionWorkflow(deps) {
|
|
|
82
83
|
result.ok = (await ctx.localStep('delete.account', async () => deleteAccountRow((await deps.oidc()).config, accountId))).ok;
|
|
83
84
|
return result;
|
|
84
85
|
};
|
|
85
|
-
return { name: ACCOUNT_DELETE_WORKFLOW, version: '1', body };
|
|
86
|
+
return { name: ACCOUNT_DELETE_WORKFLOW, version: '1', body, options: { origin: PACKAGE_ORIGIN } };
|
|
86
87
|
}
|
|
@@ -65,4 +65,8 @@ export declare function defineAccountExportWorkflow(deps: AccountExportWorkflowD
|
|
|
65
65
|
body: (ctx: DurableStepCtx & {
|
|
66
66
|
runId?: string;
|
|
67
67
|
}, input: AccountExportWorkflowInput) => Promise<unknown>;
|
|
68
|
+
/** Opções de `engine.register` — carimba `origin` com o nome deste pacote. */
|
|
69
|
+
options: {
|
|
70
|
+
origin: string;
|
|
71
|
+
};
|
|
68
72
|
};
|
|
@@ -7,6 +7,7 @@ var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExte
|
|
|
7
7
|
return path;
|
|
8
8
|
};
|
|
9
9
|
import { AccountExportService } from '../account_export_service.js';
|
|
10
|
+
import { PACKAGE_ORIGIN } from './package_origin.js';
|
|
10
11
|
/** Nome canônico do workflow durável de export de dados de conta. */
|
|
11
12
|
export const ACCOUNT_EXPORT_WORKFLOW = 'authkit.account.export';
|
|
12
13
|
/** Persistência default: grava o JSON no disk do drive do app (best-effort). */
|
|
@@ -89,5 +90,5 @@ export function defineAccountExportWorkflow(deps) {
|
|
|
89
90
|
});
|
|
90
91
|
return { ok: true, artifactKey, bytes: json.length };
|
|
91
92
|
};
|
|
92
|
-
return { name: ACCOUNT_EXPORT_WORKFLOW, version: '1', body };
|
|
93
|
+
return { name: ACCOUNT_EXPORT_WORKFLOW, version: '1', body, options: { origin: PACKAGE_ORIGIN } };
|
|
93
94
|
}
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
* const oidc = () => app.container.make('authkit.server')
|
|
22
22
|
* const del = defineAccountDeletionWorkflow({ oidc })
|
|
23
23
|
* const exp = defineAccountExportWorkflow({ oidc })
|
|
24
|
-
* engine.register(del.name, del.version, del.body)
|
|
25
|
-
* engine.register(exp.name, exp.version, exp.body)
|
|
24
|
+
* engine.register(del.name, del.version, del.body, del.options)
|
|
25
|
+
* engine.register(exp.name, exp.version, exp.body, exp.options)
|
|
26
26
|
* // ...e rode um worker (engine.runPending / runOne) p/ o grupo do authkit.
|
|
27
27
|
* ```
|
|
28
28
|
*/
|
|
@@ -21,13 +21,14 @@
|
|
|
21
21
|
* const oidc = () => app.container.make('authkit.server')
|
|
22
22
|
* const del = defineAccountDeletionWorkflow({ oidc })
|
|
23
23
|
* const exp = defineAccountExportWorkflow({ oidc })
|
|
24
|
-
* engine.register(del.name, del.version, del.body)
|
|
25
|
-
* engine.register(exp.name, exp.version, exp.body)
|
|
24
|
+
* engine.register(del.name, del.version, del.body, del.options)
|
|
25
|
+
* engine.register(exp.name, exp.version, exp.body, exp.options)
|
|
26
26
|
* // ...e rode um worker (engine.runPending / runOne) p/ o grupo do authkit.
|
|
27
27
|
* ```
|
|
28
28
|
*/
|
|
29
29
|
import { ACCOUNT_DELETE_WORKFLOW, } from './account_deletion_workflow.js';
|
|
30
30
|
import { ACCOUNT_EXPORT_WORKFLOW, } from './account_export_workflow.js';
|
|
31
|
+
import { PACKAGE_ORIGIN } from './package_origin.js';
|
|
31
32
|
export { ACCOUNT_DELETE_WORKFLOW, defineAccountDeletionWorkflow, } from './account_deletion_workflow.js';
|
|
32
33
|
export { ACCOUNT_EXPORT_WORKFLOW, defineAccountExportWorkflow, } from './account_export_workflow.js';
|
|
33
34
|
/**
|
|
@@ -53,7 +54,7 @@ export async function resolveWorkflowEngine(resolver) {
|
|
|
53
54
|
*/
|
|
54
55
|
export async function enqueueAccountDeletion(engine, input) {
|
|
55
56
|
const runId = `${ACCOUNT_DELETE_WORKFLOW}:${input.accountId}`;
|
|
56
|
-
await engine.start(ACCOUNT_DELETE_WORKFLOW, input, runId);
|
|
57
|
+
await engine.start(ACCOUNT_DELETE_WORKFLOW, input, runId, { origin: PACKAGE_ORIGIN });
|
|
57
58
|
return runId;
|
|
58
59
|
}
|
|
59
60
|
/**
|
|
@@ -62,7 +63,7 @@ export async function enqueueAccountDeletion(engine, input) {
|
|
|
62
63
|
*/
|
|
63
64
|
export async function enqueueAccountExport(engine, input) {
|
|
64
65
|
const runId = `${ACCOUNT_EXPORT_WORKFLOW}:${input.accountId}`;
|
|
65
|
-
await engine.start(ACCOUNT_EXPORT_WORKFLOW, input, runId);
|
|
66
|
+
await engine.start(ACCOUNT_EXPORT_WORKFLOW, input, runId, { origin: PACKAGE_ORIGIN });
|
|
66
67
|
return runId;
|
|
67
68
|
}
|
|
68
69
|
/**
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* O nome npm deste pacote, carimbado como `origin` nos runs duráveis do authkit (ver
|
|
3
|
+
* `WorkflowRun.origin` do `@adonis-agora/durable`) — a faceta ORIGIN do console separa
|
|
4
|
+
* os runs da lib dos runs do próprio app. Requer durable >= 0.36 (engines mais antigos
|
|
5
|
+
* ignoram a opção).
|
|
6
|
+
*/
|
|
7
|
+
export declare const PACKAGE_ORIGIN = "@adonis-agora/authkit-server";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* O nome npm deste pacote, carimbado como `origin` nos runs duráveis do authkit (ver
|
|
3
|
+
* `WorkflowRun.origin` do `@adonis-agora/durable`) — a faceta ORIGIN do console separa
|
|
4
|
+
* os runs da lib dos runs do próprio app. Requer durable >= 0.36 (engines mais antigos
|
|
5
|
+
* ignoram a opção).
|
|
6
|
+
*/
|
|
7
|
+
export const PACKAGE_ORIGIN = '@adonis-agora/authkit-server';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adonis-agora/authkit-server",
|
|
3
|
-
"version": "0.81.
|
|
3
|
+
"version": "0.81.3",
|
|
4
4
|
"description": "AdonisJS OIDC/OAuth2 provider (Identity Provider) toolkit: ejectable auth server with sessions, rate-limiting, MFA/TOTP, audit log, federated logout and OpenTelemetry metrics.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "dudousxd",
|