@serve.zone/dcrouter 18.0.2 → 18.1.1
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/deno.json +1 -1
- package/dist_serve/bundle.js +1529 -1382
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/classes.dcrouter.d.ts +7 -2
- package/dist_ts/classes.dcrouter.js +61 -9
- package/dist_ts/db/documents/classes.authentication-event.doc.d.ts +25 -0
- package/dist_ts/db/documents/classes.authentication-event.doc.js +273 -0
- package/dist_ts/db/documents/classes.email-traffic-bucket.doc.d.ts +25 -0
- package/dist_ts/db/documents/classes.email-traffic-bucket.doc.js +200 -0
- package/dist_ts/db/documents/classes.smtp-account.doc.d.ts +31 -0
- package/dist_ts/db/documents/classes.smtp-account.doc.js +176 -0
- package/dist_ts/db/documents/index.d.ts +3 -0
- package/dist_ts/db/documents/index.js +4 -1
- package/dist_ts/email/classes.accepted-email-spool.d.ts +1 -0
- package/dist_ts/email/classes.accepted-email-spool.js +9 -1
- package/dist_ts/email/classes.email-settings.manager.d.ts +7 -0
- package/dist_ts/email/classes.email-settings.manager.js +30 -1
- package/dist_ts/email/classes.smtp-account.manager.d.ts +110 -0
- package/dist_ts/email/classes.smtp-account.manager.js +507 -0
- package/dist_ts/email/classes.workapp-mail-manager.d.ts +23 -4
- package/dist_ts/email/classes.workapp-mail-manager.js +39 -46
- package/dist_ts/email/index.d.ts +2 -0
- package/dist_ts/email/index.js +3 -1
- package/dist_ts/email/smtp-scram.d.ts +13 -0
- package/dist_ts/email/smtp-scram.js +19 -0
- package/dist_ts/monitoring/classes.metricsmanager.d.ts +19 -0
- package/dist_ts/monitoring/classes.metricsmanager.js +240 -44
- package/dist_ts/opsserver/classes.opsserver.d.ts +1 -0
- package/dist_ts/opsserver/classes.opsserver.js +3 -1
- package/dist_ts/opsserver/handlers/admin.handler.d.ts +1 -0
- package/dist_ts/opsserver/handlers/admin.handler.js +61 -14
- package/dist_ts/opsserver/handlers/email-settings.handler.js +14 -2
- package/dist_ts/opsserver/handlers/index.d.ts +1 -0
- package/dist_ts/opsserver/handlers/index.js +2 -1
- package/dist_ts/opsserver/handlers/security.handler.js +21 -3
- package/dist_ts/opsserver/handlers/smtp-account.handler.d.ts +20 -0
- package/dist_ts/opsserver/handlers/smtp-account.handler.js +155 -0
- package/dist_ts/opsserver/handlers/stats.handler.js +27 -10
- package/dist_ts/security/classes.authentication-event-manager.d.ts +35 -0
- package/dist_ts/security/classes.authentication-event-manager.js +185 -0
- package/dist_ts/security/index.d.ts +1 -0
- package/dist_ts/security/index.js +2 -1
- package/dist_ts_interfaces/data/email-settings.d.ts +10 -0
- package/dist_ts_interfaces/data/index.d.ts +1 -0
- package/dist_ts_interfaces/data/index.js +2 -1
- package/dist_ts_interfaces/data/route-management.d.ts +1 -1
- package/dist_ts_interfaces/data/route-management.js +3 -1
- package/dist_ts_interfaces/data/smtp-account.d.ts +50 -0
- package/dist_ts_interfaces/data/smtp-account.js +9 -0
- package/dist_ts_interfaces/data/stats.d.ts +16 -0
- package/dist_ts_interfaces/requests/index.d.ts +1 -0
- package/dist_ts_interfaces/requests/index.js +2 -1
- package/dist_ts_interfaces/requests/smtp-accounts.d.ts +125 -0
- package/dist_ts_interfaces/requests/smtp-accounts.js +2 -0
- package/dist_ts_migrations/index.js +186 -13
- package/dist_ts_web/00_commitinfo_data.js +1 -1
- package/dist_ts_web/appstate/smtp-accounts.d.ts +38 -0
- package/dist_ts_web/appstate/smtp-accounts.js +94 -0
- package/dist_ts_web/appstate.d.ts +1 -0
- package/dist_ts_web/appstate.js +2 -1
- package/dist_ts_web/elements/email/index.d.ts +1 -0
- package/dist_ts_web/elements/email/index.js +2 -1
- package/dist_ts_web/elements/email/ops-view-smtp-accounts.d.ts +25 -0
- package/dist_ts_web/elements/email/ops-view-smtp-accounts.js +598 -0
- package/dist_ts_web/elements/ops-dashboard.js +3 -1
- package/dist_ts_web/elements/overview/ops-view-overview.js +3 -2
- package/dist_ts_web/elements/security/ops-view-security-authentication.js +20 -13
- package/dist_ts_web/elements/security/ops-view-security-overview.js +8 -11
- package/dist_ts_web/router.js +2 -2
- package/package.json +2 -2
- package/readme.md +20 -0
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/classes.dcrouter.ts +66 -8
- package/ts/db/documents/classes.authentication-event.doc.ts +248 -0
- package/ts/db/documents/classes.email-traffic-bucket.doc.ts +161 -0
- package/ts/db/documents/classes.smtp-account.doc.ts +103 -0
- package/ts/db/documents/index.ts +3 -0
- package/ts/email/classes.accepted-email-spool.ts +8 -0
- package/ts/email/classes.email-settings.manager.ts +34 -0
- package/ts/email/classes.smtp-account.manager.ts +601 -0
- package/ts/email/classes.workapp-mail-manager.ts +53 -55
- package/ts/email/index.ts +2 -0
- package/ts/email/smtp-scram.ts +24 -0
- package/ts/monitoring/classes.metricsmanager.ts +287 -50
- package/ts/opsserver/classes.opsserver.ts +2 -0
- package/ts/opsserver/handlers/admin.handler.ts +74 -15
- package/ts/opsserver/handlers/email-settings.handler.ts +13 -1
- package/ts/opsserver/handlers/index.ts +1 -0
- package/ts/opsserver/handlers/security.handler.ts +23 -2
- package/ts/opsserver/handlers/smtp-account.handler.ts +199 -0
- package/ts/opsserver/handlers/stats.handler.ts +29 -9
- package/ts/security/classes.authentication-event-manager.ts +221 -0
- package/ts/security/index.ts +1 -0
- package/ts_web/00_commitinfo_data.ts +1 -1
- package/ts_web/appstate/smtp-accounts.ts +143 -0
- package/ts_web/appstate.ts +1 -0
- package/ts_web/elements/email/index.ts +1 -0
- package/ts_web/elements/email/ops-view-smtp-accounts.ts +586 -0
- package/ts_web/elements/ops-dashboard.ts +2 -0
- package/ts_web/elements/overview/ops-view-overview.ts +2 -1
- package/ts_web/elements/security/ops-view-security-authentication.ts +20 -13
- package/ts_web/elements/security/ops-view-security-overview.ts +7 -12
- package/ts_web/router.ts +1 -1
|
@@ -12,5 +12,6 @@ export * from './dns-record.js';
|
|
|
12
12
|
export * from './acme-config.js';
|
|
13
13
|
export * from './email-domain.js';
|
|
14
14
|
export * from './email-settings.js';
|
|
15
|
+
export * from './smtp-account.js';
|
|
15
16
|
export * from './security-policy.js';
|
|
16
17
|
export * from './config-events.js';
|
|
@@ -12,6 +12,7 @@ export * from './dns-record.js';
|
|
|
12
12
|
export * from './acme-config.js';
|
|
13
13
|
export * from './email-domain.js';
|
|
14
14
|
export * from './email-settings.js';
|
|
15
|
+
export * from './smtp-account.js';
|
|
15
16
|
export * from './security-policy.js';
|
|
16
17
|
export * from './config-events.js';
|
|
17
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
18
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90c19pbnRlcmZhY2VzL2RhdGEvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxXQUFXLENBQUM7QUFDMUIsY0FBYyxZQUFZLENBQUM7QUFDM0IsY0FBYyxvQkFBb0IsQ0FBQztBQUNuQyxjQUFjLHVCQUF1QixDQUFDO0FBQ3RDLGNBQWMscUJBQXFCLENBQUM7QUFDcEMsY0FBYyxVQUFVLENBQUM7QUFDekIsY0FBYyxtQkFBbUIsQ0FBQztBQUNsQyxjQUFjLGFBQWEsQ0FBQztBQUM1QixjQUFjLG9CQUFvQixDQUFDO0FBQ25DLGNBQWMsaUJBQWlCLENBQUM7QUFDaEMsY0FBYyxpQkFBaUIsQ0FBQztBQUNoQyxjQUFjLGtCQUFrQixDQUFDO0FBQ2pDLGNBQWMsbUJBQW1CLENBQUM7QUFDbEMsY0FBYyxxQkFBcUIsQ0FBQztBQUNwQyxjQUFjLG1CQUFtQixDQUFDO0FBQ2xDLGNBQWMsc0JBQXNCLENBQUM7QUFDckMsY0FBYyxvQkFBb0IsQ0FBQyJ9
|
|
@@ -12,7 +12,7 @@ export interface IRouteSecurity extends TSmartProxyRouteSecurityBase {
|
|
|
12
12
|
rateLimit?: IRouteRateLimit | null;
|
|
13
13
|
challenge?: IRouteChallengeConfig | null;
|
|
14
14
|
}
|
|
15
|
-
export declare const apiTokenScopes: readonly ["*", "routes:read", "routes:write", "config:read", "stats:read", "logs:read", "config-events:read", "config-events:write", "security:read", "security:write", "emails:read", "emails:write", "certificates:read", "certificates:write", "tokens:read", "tokens:manage", "users:read", "users:manage", "source-profiles:read", "source-profiles:write", "target-profiles:read", "target-profiles:write", "targets:read", "targets:write", "dns-providers:read", "dns-providers:write", "domains:read", "domains:write", "dns-authority:read", "dns-authority:write", "dns-records:read", "dns-records:write", "acme-config:read", "acme-config:write", "email-domains:read", "email-domains:write", "remote-ingress:read", "remote-ingress:write", "vpn:read", "vpn:write", "radius:read", "radius:write", "gateway-clients:read", "gateway-clients:write", "workhosters:read", "workhosters:write"];
|
|
15
|
+
export declare const apiTokenScopes: readonly ["*", "routes:read", "routes:write", "config:read", "stats:read", "logs:read", "config-events:read", "config-events:write", "security:read", "security:write", "emails:read", "emails:write", "certificates:read", "certificates:write", "tokens:read", "tokens:manage", "users:read", "users:manage", "source-profiles:read", "source-profiles:write", "target-profiles:read", "target-profiles:write", "targets:read", "targets:write", "dns-providers:read", "dns-providers:write", "domains:read", "domains:write", "dns-authority:read", "dns-authority:write", "dns-records:read", "dns-records:write", "acme-config:read", "acme-config:write", "email-domains:read", "email-domains:write", "smtp-accounts:read", "smtp-accounts:write", "remote-ingress:read", "remote-ingress:write", "vpn:read", "vpn:write", "radius:read", "radius:write", "gateway-clients:read", "gateway-clients:write", "workhosters:read", "workhosters:write"];
|
|
16
16
|
export type TApiTokenScope = typeof apiTokenScopes[number];
|
|
17
17
|
export type TGatewayClientType = 'onebox' | 'cloudly' | 'custom';
|
|
18
18
|
export interface IApiTokenPolicy {
|
|
@@ -38,6 +38,8 @@ export const apiTokenScopes = [
|
|
|
38
38
|
'acme-config:write',
|
|
39
39
|
'email-domains:read',
|
|
40
40
|
'email-domains:write',
|
|
41
|
+
'smtp-accounts:read',
|
|
42
|
+
'smtp-accounts:write',
|
|
41
43
|
'remote-ingress:read',
|
|
42
44
|
'remote-ingress:write',
|
|
43
45
|
'vpn:read',
|
|
@@ -122,4 +124,4 @@ export function canonicalizeSourceRouteId(routeId) {
|
|
|
122
124
|
const sourceVariantIndex = routeId.indexOf(':source:');
|
|
123
125
|
return sourceVariantIndex === -1 ? routeId : routeId.slice(0, sourceVariantIndex);
|
|
124
126
|
}
|
|
125
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
127
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicm91dGUtbWFuYWdlbWVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3RzX2ludGVyZmFjZXMvZGF0YS9yb3V0ZS1tYW5hZ2VtZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXFCQSwrRUFBK0U7QUFDL0UsOEJBQThCO0FBQzlCLCtFQUErRTtBQUUvRSxNQUFNLENBQUMsTUFBTSxjQUFjLEdBQUc7SUFDNUIsR0FBRztJQUNILGFBQWE7SUFDYixjQUFjO0lBQ2QsYUFBYTtJQUNiLFlBQVk7SUFDWixXQUFXO0lBQ1gsb0JBQW9CO0lBQ3BCLHFCQUFxQjtJQUNyQixlQUFlO0lBQ2YsZ0JBQWdCO0lBQ2hCLGFBQWE7SUFDYixjQUFjO0lBQ2QsbUJBQW1CO0lBQ25CLG9CQUFvQjtJQUNwQixhQUFhO0lBQ2IsZUFBZTtJQUNmLFlBQVk7SUFDWixjQUFjO0lBQ2Qsc0JBQXNCO0lBQ3RCLHVCQUF1QjtJQUN2QixzQkFBc0I7SUFDdEIsdUJBQXVCO0lBQ3ZCLGNBQWM7SUFDZCxlQUFlO0lBQ2Ysb0JBQW9CO0lBQ3BCLHFCQUFxQjtJQUNyQixjQUFjO0lBQ2QsZUFBZTtJQUNmLG9CQUFvQjtJQUNwQixxQkFBcUI7SUFDckIsa0JBQWtCO0lBQ2xCLG1CQUFtQjtJQUNuQixrQkFBa0I7SUFDbEIsbUJBQW1CO0lBQ25CLG9CQUFvQjtJQUNwQixxQkFBcUI7SUFDckIsb0JBQW9CO0lBQ3BCLHFCQUFxQjtJQUNyQixxQkFBcUI7SUFDckIsc0JBQXNCO0lBQ3RCLFVBQVU7SUFDVixXQUFXO0lBQ1gsYUFBYTtJQUNiLGNBQWM7SUFDZCxzQkFBc0I7SUFDdEIsdUJBQXVCO0lBQ3ZCLGtCQUFrQjtJQUNsQixtQkFBbUI7Q0FDWCxDQUFDO0FBaUZYLE1BQU0sQ0FBQyxNQUFNLGdCQUFnQixHQUFHO0lBQzlCLGdCQUFnQjtJQUNoQixRQUFRO0lBQ1IsYUFBYTtJQUNiLGdCQUFnQjtJQUNoQixLQUFLO0lBQ0wsU0FBUztDQUNELENBQUM7QUFJWCxNQUFNLENBQUMsTUFBTSx5QkFBeUIsR0FBb0M7SUFDeEUsZ0JBQWdCLEVBQUUsZ0JBQWdCO0lBQ2xDLE1BQU0sRUFBRSxlQUFlO0lBQ3ZCLGFBQWEsRUFBRSxhQUFhO0lBQzVCLGdCQUFnQixFQUFFLGdCQUFnQjtJQUNsQyxHQUFHLEVBQUUsV0FBVztJQUNoQixPQUFPLEVBQUUsVUFBVTtDQUNwQixDQUFDO0FBRUYsTUFBTSxDQUFDLE1BQU0sMkJBQTJCLEdBQXNDO0lBQzVFLGdCQUFnQixFQUFFO1FBQ2hCLG9CQUFvQjtRQUNwQiwwQkFBMEI7UUFDMUIsMkJBQTJCO1FBQzNCLG1CQUFtQjtRQUNuQixxQkFBcUI7S0FDdEI7SUFDRCxNQUFNLEVBQUU7UUFDTixXQUFXO1FBQ1gsWUFBWTtRQUNaLGlCQUFpQjtRQUNqQixnQkFBZ0I7UUFDaEIsUUFBUTtRQUNSLFFBQVE7UUFDUixPQUFPO1FBQ1AsVUFBVTtRQUNWLGNBQWM7S0FDZjtJQUNELGFBQWEsRUFBRSxFQUFFO0lBQ2pCLGdCQUFnQixFQUFFO1FBQ2hCLFlBQVk7UUFDWixTQUFTO1FBQ1QsV0FBVztRQUNYLFFBQVE7UUFDUixVQUFVO1FBQ1YsU0FBUztRQUNULGdCQUFnQjtRQUNoQixZQUFZO1FBQ1osZUFBZTtRQUNmLFlBQVk7UUFDWixZQUFZO1FBQ1osZUFBZTtRQUNmLGFBQWE7UUFDYixZQUFZO1FBQ1osZUFBZTtRQUNmLGNBQWM7UUFDZCxlQUFlO0tBQ2hCO0lBQ0QsR0FBRyxFQUFFO1FBQ0gsWUFBWTtRQUNaLFlBQVk7S0FDYjtJQUNELE9BQU8sRUFBRTtRQUNQLGdCQUFnQjtRQUNoQiwwQkFBMEI7S0FDM0I7Q0FDRixDQUFDO0FBbURGLCtFQUErRTtBQUMvRSx1QkFBdUI7QUFDdkIsK0VBQStFO0FBRS9FLE1BQU0sQ0FBQyxNQUFNLGlCQUFpQixHQUFHLENBQUMsNEJBQTRCLENBQVUsQ0FBQztBQWdHekUsZ0ZBQWdGO0FBQ2hGLE1BQU0sVUFBVSx5QkFBeUIsQ0FBQyxPQUFlO0lBQ3ZELE1BQU0sa0JBQWtCLEdBQUcsT0FBTyxDQUFDLE9BQU8sQ0FBQyxVQUFVLENBQUMsQ0FBQztJQUN2RCxPQUFPLGtCQUFrQixLQUFLLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxPQUFPLENBQUMsQ0FBQyxDQUFDLE9BQU8sQ0FBQyxLQUFLLENBQUMsQ0FBQyxFQUFFLGtCQUFrQixDQUFDLENBQUM7QUFDcEYsQ0FBQyJ9
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Send AS who" scope. `addresses` are literal or local-part-wildcard address
|
|
3
|
+
* patterns (e.g. 'billing@example.com', '*@example.com' is expressed via
|
|
4
|
+
* `domains` instead); `domains` authorize every address of a domain.
|
|
5
|
+
* Both lists empty = unrestricted sender scope.
|
|
6
|
+
*/
|
|
7
|
+
export interface ISmtpAccountSenderScope {
|
|
8
|
+
addresses: string[];
|
|
9
|
+
domains: string[];
|
|
10
|
+
}
|
|
11
|
+
/** 'any' = unrestricted recipients; 'restricted' = only listed addresses/domains. */
|
|
12
|
+
export type TSmtpRecipientScopeMode = 'any' | 'restricted';
|
|
13
|
+
/** "Send TO who" scope. Lists are only enforced when mode is 'restricted'. */
|
|
14
|
+
export interface ISmtpAccountRecipientScope {
|
|
15
|
+
mode: TSmtpRecipientScopeMode;
|
|
16
|
+
addresses: string[];
|
|
17
|
+
domains: string[];
|
|
18
|
+
}
|
|
19
|
+
/** Per-account outbound mail policy applied to generated relay routes. */
|
|
20
|
+
export interface ISmtpAccountMailPolicy {
|
|
21
|
+
/** Sign outbound mail with the sender domain's active managed DKIM key. */
|
|
22
|
+
dkimSign: boolean;
|
|
23
|
+
/** SmartMTA delivery queue (default 'normal'). */
|
|
24
|
+
queue?: 'normal' | 'priority' | 'bulk';
|
|
25
|
+
}
|
|
26
|
+
/** Per-sender-domain outbound readiness as reported by EmailDomainManager. */
|
|
27
|
+
export interface ISmtpAccountDomainReadiness {
|
|
28
|
+
domain: string;
|
|
29
|
+
ready: boolean;
|
|
30
|
+
reason?: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Public representation of an SMTP submission account. Never includes the
|
|
34
|
+
* password or the stored SCRAM verifier.
|
|
35
|
+
*/
|
|
36
|
+
export interface ISmtpAccountInfo {
|
|
37
|
+
id: string;
|
|
38
|
+
username: string;
|
|
39
|
+
description: string;
|
|
40
|
+
enabled: boolean;
|
|
41
|
+
senderScope: ISmtpAccountSenderScope;
|
|
42
|
+
recipientScope: ISmtpAccountRecipientScope;
|
|
43
|
+
mailPolicy: ISmtpAccountMailPolicy;
|
|
44
|
+
createdAt: number;
|
|
45
|
+
updatedAt: number;
|
|
46
|
+
createdBy: string;
|
|
47
|
+
lastRotatedAt?: number;
|
|
48
|
+
/** Outbound readiness of each sender-scope domain (managed domains only). */
|
|
49
|
+
domainReadiness?: ISmtpAccountDomainReadiness[];
|
|
50
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// ============================================================================
|
|
2
|
+
// SMTP Account Data Types
|
|
3
|
+
// ============================================================================
|
|
4
|
+
//
|
|
5
|
+
// Operator-managed authenticated SMTP submission accounts. Wire types never
|
|
6
|
+
// carry secrets: passwords are machine-generated, shown exactly once at
|
|
7
|
+
// create/rotate time, and only a hashed SCRAM verifier is persisted.
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic210cC1hY2NvdW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vdHNfaW50ZXJmYWNlcy9kYXRhL3NtdHAtYWNjb3VudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSwrRUFBK0U7QUFDL0UsMEJBQTBCO0FBQzFCLCtFQUErRTtBQUMvRSxFQUFFO0FBQ0YsNEVBQTRFO0FBQzVFLHdFQUF3RTtBQUN4RSxxRUFBcUUifQ==
|
|
@@ -82,6 +82,19 @@ export interface ISecurityEvent {
|
|
|
82
82
|
domain?: string;
|
|
83
83
|
success?: boolean;
|
|
84
84
|
}
|
|
85
|
+
export type TAuthenticationSource = 'auto' | 'local' | 'idp.global';
|
|
86
|
+
export type TResolvedAuthenticationSource = Exclude<TAuthenticationSource, 'auto'>;
|
|
87
|
+
export type TAuthenticationFailureReason = 'invalidCredentials' | 'serviceUnavailable' | 'identityIssuanceFailed' | 'internalError';
|
|
88
|
+
export interface IAuthenticationEvent {
|
|
89
|
+
id: string;
|
|
90
|
+
timestamp: number;
|
|
91
|
+
username: string;
|
|
92
|
+
userId?: string;
|
|
93
|
+
success: boolean;
|
|
94
|
+
requestedAuthSource: TAuthenticationSource;
|
|
95
|
+
resolvedAuthSource?: TResolvedAuthenticationSource;
|
|
96
|
+
failureReason?: TAuthenticationFailureReason;
|
|
97
|
+
}
|
|
85
98
|
export interface ISecurityMetrics {
|
|
86
99
|
blockedIPs: string[];
|
|
87
100
|
reputationScores: {
|
|
@@ -91,6 +104,9 @@ export interface ISecurityMetrics {
|
|
|
91
104
|
malwareDetected: number;
|
|
92
105
|
phishingDetected: number;
|
|
93
106
|
authenticationFailures: number;
|
|
107
|
+
authenticationSuccesses: number;
|
|
108
|
+
authenticationWindowStart: number;
|
|
109
|
+
authenticationEvents?: IAuthenticationEvent[];
|
|
94
110
|
suspiciousActivities: number;
|
|
95
111
|
recentEvents?: ISecurityEvent[];
|
|
96
112
|
}
|
|
@@ -21,6 +21,7 @@ export * from './dns-records.js';
|
|
|
21
21
|
export * from './acme-config.js';
|
|
22
22
|
export * from './email-domains.js';
|
|
23
23
|
export * from './email-settings.js';
|
|
24
|
+
export * from './smtp-accounts.js';
|
|
24
25
|
export * from './realtime.js';
|
|
25
26
|
export * from './workhoster.js';
|
|
26
27
|
export * from './security-policy.js';
|
|
@@ -21,8 +21,9 @@ export * from './dns-records.js';
|
|
|
21
21
|
export * from './acme-config.js';
|
|
22
22
|
export * from './email-domains.js';
|
|
23
23
|
export * from './email-settings.js';
|
|
24
|
+
export * from './smtp-accounts.js';
|
|
24
25
|
export * from './realtime.js';
|
|
25
26
|
export * from './workhoster.js';
|
|
26
27
|
export * from './security-policy.js';
|
|
27
28
|
export * from './config-events.js';
|
|
28
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
29
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90c19pbnRlcmZhY2VzL3JlcXVlc3RzL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsWUFBWSxDQUFDO0FBQzNCLGNBQWMsYUFBYSxDQUFDO0FBQzVCLGNBQWMsV0FBVyxDQUFDO0FBQzFCLGNBQWMsWUFBWSxDQUFDO0FBQzNCLGNBQWMscUJBQXFCLENBQUM7QUFDcEMsY0FBYyxhQUFhLENBQUM7QUFDNUIsY0FBYyxnQkFBZ0IsQ0FBQztBQUMvQixjQUFjLGtCQUFrQixDQUFDO0FBQ2pDLGNBQWMsb0JBQW9CLENBQUM7QUFDbkMsY0FBYyx1QkFBdUIsQ0FBQztBQUN0QyxjQUFjLGlCQUFpQixDQUFDO0FBQ2hDLGNBQWMsVUFBVSxDQUFDO0FBQ3pCLGNBQWMsc0JBQXNCLENBQUM7QUFDckMsY0FBYyxzQkFBc0IsQ0FBQztBQUNyQyxjQUFjLHNCQUFzQixDQUFDO0FBQ3JDLGNBQWMsWUFBWSxDQUFDO0FBQzNCLGNBQWMsb0JBQW9CLENBQUM7QUFDbkMsY0FBYyxjQUFjLENBQUM7QUFDN0IsY0FBYyxvQkFBb0IsQ0FBQztBQUNuQyxjQUFjLGtCQUFrQixDQUFDO0FBQ2pDLGNBQWMsa0JBQWtCLENBQUM7QUFDakMsY0FBYyxvQkFBb0IsQ0FBQztBQUNuQyxjQUFjLHFCQUFxQixDQUFDO0FBQ3BDLGNBQWMsb0JBQW9CLENBQUM7QUFDbkMsY0FBYyxlQUFlLENBQUM7QUFDOUIsY0FBYyxpQkFBaUIsQ0FBQztBQUNoQyxjQUFjLHNCQUFzQixDQUFDO0FBQ3JDLGNBQWMsb0JBQW9CLENBQUMifQ==
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import * as plugins from '../plugins.js';
|
|
2
|
+
import type * as authInterfaces from '../data/auth.js';
|
|
3
|
+
import type { ISmtpAccountInfo, ISmtpAccountMailPolicy, ISmtpAccountRecipientScope, ISmtpAccountSenderScope } from '../data/smtp-account.js';
|
|
4
|
+
/**
|
|
5
|
+
* Shared mutation result. `warnings` carries non-blocking findings such as
|
|
6
|
+
* sender domains that are not managed email domains (warn-and-allow).
|
|
7
|
+
*/
|
|
8
|
+
export interface ISmtpAccountActionResult {
|
|
9
|
+
success: boolean;
|
|
10
|
+
message?: string;
|
|
11
|
+
code?: string;
|
|
12
|
+
warnings?: string[];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* List all SMTP submission accounts (never includes credentials).
|
|
16
|
+
*/
|
|
17
|
+
export interface IReq_GetSmtpAccounts extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_GetSmtpAccounts> {
|
|
18
|
+
method: 'getSmtpAccounts';
|
|
19
|
+
request: {
|
|
20
|
+
identity?: authInterfaces.IIdentity;
|
|
21
|
+
apiToken?: string;
|
|
22
|
+
};
|
|
23
|
+
response: {
|
|
24
|
+
accounts: ISmtpAccountInfo[];
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Create an SMTP submission account. The password is machine-generated and
|
|
29
|
+
* returned exactly once in this response; only a SCRAM verifier is persisted.
|
|
30
|
+
*/
|
|
31
|
+
export interface IReq_CreateSmtpAccount extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_CreateSmtpAccount> {
|
|
32
|
+
method: 'createSmtpAccount';
|
|
33
|
+
request: {
|
|
34
|
+
identity?: authInterfaces.IIdentity;
|
|
35
|
+
apiToken?: string;
|
|
36
|
+
username: string;
|
|
37
|
+
description?: string;
|
|
38
|
+
senderScope?: ISmtpAccountSenderScope;
|
|
39
|
+
recipientScope?: ISmtpAccountRecipientScope;
|
|
40
|
+
mailPolicy?: ISmtpAccountMailPolicy;
|
|
41
|
+
};
|
|
42
|
+
response: ISmtpAccountActionResult & {
|
|
43
|
+
account?: ISmtpAccountInfo;
|
|
44
|
+
/** Shown once; never retrievable again. */
|
|
45
|
+
password?: string;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Update an SMTP account's description, scopes, or mail policy.
|
|
50
|
+
*/
|
|
51
|
+
export interface IReq_UpdateSmtpAccount extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_UpdateSmtpAccount> {
|
|
52
|
+
method: 'updateSmtpAccount';
|
|
53
|
+
request: {
|
|
54
|
+
identity?: authInterfaces.IIdentity;
|
|
55
|
+
apiToken?: string;
|
|
56
|
+
id: string;
|
|
57
|
+
description?: string;
|
|
58
|
+
senderScope?: ISmtpAccountSenderScope;
|
|
59
|
+
recipientScope?: ISmtpAccountRecipientScope;
|
|
60
|
+
mailPolicy?: ISmtpAccountMailPolicy;
|
|
61
|
+
};
|
|
62
|
+
response: ISmtpAccountActionResult & {
|
|
63
|
+
account?: ISmtpAccountInfo;
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Enable or disable an SMTP account. Disabled accounts always fail
|
|
68
|
+
* authentication (and still shadow same-named legacy static users).
|
|
69
|
+
*/
|
|
70
|
+
export interface IReq_ToggleSmtpAccount extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_ToggleSmtpAccount> {
|
|
71
|
+
method: 'toggleSmtpAccount';
|
|
72
|
+
request: {
|
|
73
|
+
identity?: authInterfaces.IIdentity;
|
|
74
|
+
apiToken?: string;
|
|
75
|
+
id: string;
|
|
76
|
+
enabled: boolean;
|
|
77
|
+
};
|
|
78
|
+
response: ISmtpAccountActionResult & {
|
|
79
|
+
account?: ISmtpAccountInfo;
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Rotate an SMTP account's password. The new password is returned exactly
|
|
84
|
+
* once; the previous credential stops working immediately.
|
|
85
|
+
*/
|
|
86
|
+
export interface IReq_RotateSmtpAccountPassword extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_RotateSmtpAccountPassword> {
|
|
87
|
+
method: 'rotateSmtpAccountPassword';
|
|
88
|
+
request: {
|
|
89
|
+
identity?: authInterfaces.IIdentity;
|
|
90
|
+
apiToken?: string;
|
|
91
|
+
id: string;
|
|
92
|
+
};
|
|
93
|
+
response: ISmtpAccountActionResult & {
|
|
94
|
+
account?: ISmtpAccountInfo;
|
|
95
|
+
/** Shown once; never retrievable again. */
|
|
96
|
+
password?: string;
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Delete an SMTP account.
|
|
101
|
+
*/
|
|
102
|
+
export interface IReq_DeleteSmtpAccount extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_DeleteSmtpAccount> {
|
|
103
|
+
method: 'deleteSmtpAccount';
|
|
104
|
+
request: {
|
|
105
|
+
identity?: authInterfaces.IIdentity;
|
|
106
|
+
apiToken?: string;
|
|
107
|
+
id: string;
|
|
108
|
+
};
|
|
109
|
+
response: ISmtpAccountActionResult;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Remove a named legacy route from the persisted email server settings
|
|
113
|
+
* (EmailServerSettingsDoc.emailConfig.routes) — the retirement lever for
|
|
114
|
+
* legacy internal-relay routes once scoped SMTP accounts replace them.
|
|
115
|
+
* Applies through the standard email settings restart path.
|
|
116
|
+
*/
|
|
117
|
+
export interface IReq_RemoveLegacyEmailRoute extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_RemoveLegacyEmailRoute> {
|
|
118
|
+
method: 'removeLegacyEmailRoute';
|
|
119
|
+
request: {
|
|
120
|
+
identity?: authInterfaces.IIdentity;
|
|
121
|
+
apiToken?: string;
|
|
122
|
+
routeName: string;
|
|
123
|
+
};
|
|
124
|
+
response: ISmtpAccountActionResult;
|
|
125
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import * as plugins from '../plugins.js';
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic210cC1hY2NvdW50cy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3RzX2ludGVyZmFjZXMvcmVxdWVzdHMvc210cC1hY2NvdW50cy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssT0FBTyxNQUFNLGVBQWUsQ0FBQyJ9
|