ts-mailcow-api 1.3.0 → 1.5.0

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/README.md CHANGED
@@ -92,6 +92,7 @@ at a typed interface documented in the
92
92
  | `domains` | Domains |
93
93
  | `fail2Ban` | Fail2Ban configuration |
94
94
  | `forwardingHosts` | Forwarding hosts |
95
+ | `identityProvider` | External IdP (Keycloak/LDAP/OIDC) |
95
96
  | `logs` | ACME, API, dovecot, postfix, ... |
96
97
  | `mailbox` | Mailboxes (and ACL, pushover, ...)|
97
98
  | `oauth2` | OAuth2 clients |
package/dist/client.d.ts CHANGED
@@ -23,6 +23,7 @@ import { TlsPolicyMapEndpoints } from './endpoints/tls-policy-map-endpoints';
23
23
  import { DkimEndpoints } from './endpoints/dkim-endpoints';
24
24
  import { DomainAdminEndpoints } from './endpoints/domain-admin-endpoints';
25
25
  import { RoutingEndpoints } from './endpoints/routing-endpoints';
26
+ import { IdentityProviderEndpoints } from './endpoints/identity-provider-endpoints';
26
27
  /**
27
28
  * Class containing all the logic to interface with the Mailcow API in TypeScript.
28
29
  * @external
@@ -174,5 +175,12 @@ declare class MailcowClient {
174
175
  * @external
175
176
  */
176
177
  routing: RoutingEndpoints;
178
+ /**
179
+ * Endpoint for configuring the external Identity Provider (Keycloak,
180
+ * LDAP, or a generic OIDC provider).
181
+ * See {@link IdentityProviderEndpoints}
182
+ * @external
183
+ */
184
+ identityProvider: IdentityProviderEndpoints;
177
185
  }
178
186
  export default MailcowClient;
package/dist/client.js CHANGED
@@ -24,6 +24,7 @@ const tls_policy_map_endpoints_1 = require("./endpoints/tls-policy-map-endpoints
24
24
  const dkim_endpoints_1 = require("./endpoints/dkim-endpoints");
25
25
  const domain_admin_endpoints_1 = require("./endpoints/domain-admin-endpoints");
26
26
  const routing_endpoints_1 = require("./endpoints/routing-endpoints");
27
+ const identity_provider_endpoints_1 = require("./endpoints/identity-provider-endpoints");
27
28
  /**
28
29
  * Class containing all the logic to interface with the Mailcow API in TypeScript.
29
30
  * @external
@@ -186,6 +187,13 @@ class MailcowClient {
186
187
  * @external
187
188
  */
188
189
  routing = (0, routing_endpoints_1.routingEndpoints)(this);
190
+ /**
191
+ * Endpoint for configuring the external Identity Provider (Keycloak,
192
+ * LDAP, or a generic OIDC provider).
193
+ * See {@link IdentityProviderEndpoints}
194
+ * @external
195
+ */
196
+ identityProvider = (0, identity_provider_endpoints_1.identityProviderEndpoints)(this);
189
197
  }
190
198
  exports.default = MailcowClient;
191
199
  //# sourceMappingURL=client.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAGH,mEAAgF;AAChF,uEAAsF;AACtF,mEAAkF;AAClF,uDAA+C;AAC/C,iEAA6E;AAC7E,qEAAmF;AACnF,2EAA4F;AAC5F,6DAAuE;AACvE,uFAA8G;AAC9G,uEAAsF;AACtF,mEAAgF;AAChF,uEAAsF;AACtF,iFAAmG;AACnG,2EAA4F;AAC5F,yEAA2F;AAC3F,mEAAgF;AAChF,+EAAgG;AAChG,mFAAoG;AACpG,+DAA0E;AAC1E,+EAAgG;AAChG,qEAAmF;AAEnF;;;GAGG;AACH,MAAM,aAAa;IACjB;;;OAGG;IACM,QAAQ,CAAS;IAE1B;;;OAGG;IACM,OAAO,CAAS;IAEzB;;;OAGG;IACH,YAAY,CAAqB;IAEjC;;;;;OAKG;IACH,YAAY,QAAgB,EAAE,OAAe,EAAE,kBAAuC;QACpF,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC/F,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAEvB,wCAAwC;QACxC,IAAI,CAAC,YAAY,GAAG;YAClB,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IAAI,CAAC,CAAC;IAEnE;;;;OAIG;IACI,UAAU,GAAwB,IAAA,yCAAmB,EAAC,IAAI,CAAC,CAAC;IAEnE;;;;OAIG;IACI,MAAM,GAAoB,IAAA,kCAAe,EAAC,IAAI,CAAC,CAAC;IAEvD;;;;OAIG;IACI,YAAY,GAAyB,IAAA,6CAAoB,EAAC,IAAI,CAAC,CAAC;IAEvE;;;;OAIG;IACI,aAAa,GAA0B,IAAA,gDAAqB,EAAC,IAAI,CAAC,CAAC;IAE1E;;;;OAIG;IACI,IAAI,GAAkB,IAAA,8BAAa,EAAC,IAAI,CAAC,CAAC;IAEjD;;;;OAIG;IACI,YAAY,GAAyB,IAAA,6CAAoB,EAAC,IAAI,CAAC,CAAC;IAEvE;;;;OAIG;IACI,OAAO,GAAqB,IAAA,oCAAgB,EAAC,IAAI,CAAC,CAAC;IAE1D;;;;;OAKG;IACI,gBAAgB,GAA8B,IAAA,uDAAyB,EAAC,IAAI,CAAC,CAAC;CACtF;AAED,kBAAe,aAAa,CAAC"}
@@ -0,0 +1,27 @@
1
+ import MailcowClient from '../index';
2
+ import { IdentityProviderAttributes, MailcowResponse } from '../types';
3
+ /**
4
+ * Interface for the external Identity Provider endpoint.
5
+ *
6
+ * Mailcow has a single global identity-provider configuration -- there
7
+ * is no add or delete, only edit -- so this group exposes a single
8
+ * method.
9
+ */
10
+ export interface IdentityProviderEndpoints {
11
+ /**
12
+ * Configure (or reconfigure) the external Identity Provider used for
13
+ * Mailcow login. Pass the attributes for one of the supported
14
+ * `authsource` values; the wrapper supplies the required
15
+ * `items: ['identity-provider']` envelope.
16
+ *
17
+ * @param attr - The identity-provider attributes to apply.
18
+ */
19
+ edit(attr: IdentityProviderAttributes): Promise<MailcowResponse>;
20
+ }
21
+ /**
22
+ * Binder function between the MailcowClient class and the
23
+ * IdentityProviderEndpoints.
24
+ * @param bind - The MailcowClient to bind.
25
+ * @internal
26
+ */
27
+ export declare function identityProviderEndpoints(bind: MailcowClient): IdentityProviderEndpoints;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.identityProviderEndpoints = identityProviderEndpoints;
4
+ const IDENTITY_PROVIDER_ENDPOINTS = {
5
+ EDIT: 'edit/identity-provider',
6
+ };
7
+ /**
8
+ * Binder function between the MailcowClient class and the
9
+ * IdentityProviderEndpoints.
10
+ * @param bind - The MailcowClient to bind.
11
+ * @internal
12
+ */
13
+ function identityProviderEndpoints(bind) {
14
+ return {
15
+ edit(attr) {
16
+ return bind.requestFactory.post(IDENTITY_PROVIDER_ENDPOINTS.EDIT, {
17
+ attr,
18
+ items: ['identity-provider'],
19
+ });
20
+ },
21
+ };
22
+ }
23
+ //# sourceMappingURL=identity-provider-endpoints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identity-provider-endpoints.js","sourceRoot":"","sources":["../../src/endpoints/identity-provider-endpoints.ts"],"names":[],"mappings":";;AAgCA,8DASC;AAnBD,MAAM,2BAA2B,GAAG;IAClC,IAAI,EAAE,wBAAwB;CAC/B,CAAC;AAEF;;;;;GAKG;AACH,SAAgB,yBAAyB,CAAC,IAAmB;IAC3D,OAAO;QACL,IAAI,CAAC,IAAgC;YACnC,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAA+C,2BAA2B,CAAC,IAAI,EAAE;gBAC9G,IAAI;gBACJ,KAAK,EAAE,CAAC,mBAAmB,CAAC;aAC7B,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC"}
package/dist/types.d.ts CHANGED
@@ -1393,10 +1393,7 @@ export type GetRecipientMapResponse = RecipientMap[];
1393
1393
  * Error class used for exception handling.
1394
1394
  */
1395
1395
  export declare class MailcowException extends Error {
1396
- /**
1397
- * The error message provided by Mailcow.
1398
- */
1399
- message: string;
1396
+ constructor(message?: string, options?: ErrorOptions);
1400
1397
  }
1401
1398
  /**
1402
1399
  * Fail2Ban edit request.
@@ -2249,6 +2246,213 @@ export interface TransportMap {
2249
2246
  */
2250
2247
  username: string;
2251
2248
  }
2249
+ /**
2250
+ * Identity Provider authentication source.
2251
+ *
2252
+ * Mailcow's external authentication backends. `mailcow` (the built-in
2253
+ * local password database) is not configurable via this endpoint and is
2254
+ * therefore not part of this union.
2255
+ */
2256
+ export type IdentityProviderAuthsource = 'ldap' | 'keycloak' | 'generic-oidc';
2257
+ /**
2258
+ * Attributes shared across every identity-provider configuration,
2259
+ * regardless of which auth source it targets.
2260
+ */
2261
+ export interface BaseIdentityProviderAttributes {
2262
+ /**
2263
+ * If no matching attribute mapping exists for a user, the default template
2264
+ * is used when creating the mailbox (not on update). Mailcow expects the
2265
+ * template name as configured under "Mailbox templates".
2266
+ */
2267
+ default_template?: string;
2268
+ /**
2269
+ * Attribute values used to match a mailbox template. Each element pairs
2270
+ * positionally with `templates` -- the n-th `mappers` entry selects the
2271
+ * n-th `templates` entry.
2272
+ */
2273
+ mappers?: string[];
2274
+ /**
2275
+ * Mailbox template names. See `mappers` for how the two arrays are
2276
+ * correlated.
2277
+ */
2278
+ templates?: string[];
2279
+ /**
2280
+ * Skip TLS certificate validation when contacting the auth source.
2281
+ * @defaultValue false
2282
+ */
2283
+ ignore_ssl_error?: boolean;
2284
+ /**
2285
+ * Whether Mailcow should periodically pull every user from the auth
2286
+ * source. Defaults to `false`; combine with `sync_interval` and
2287
+ * `import_users` to enable scheduled syncs.
2288
+ * @defaultValue false
2289
+ */
2290
+ periodic_sync?: boolean;
2291
+ /**
2292
+ * Whether new users discovered during a sync should be imported into
2293
+ * Mailcow as mailboxes.
2294
+ * @defaultValue false
2295
+ */
2296
+ import_users?: boolean;
2297
+ /**
2298
+ * Interval, in minutes, between periodic syncs.
2299
+ * @defaultValue 15
2300
+ */
2301
+ sync_interval?: number;
2302
+ }
2303
+ /**
2304
+ * Identity provider attributes for an external Keycloak server.
2305
+ */
2306
+ export interface KeycloakIdentityProviderAttributes extends BaseIdentityProviderAttributes {
2307
+ authsource: 'keycloak';
2308
+ /**
2309
+ * Base URL of the Keycloak server (no trailing slash needed).
2310
+ */
2311
+ server_url: string;
2312
+ /**
2313
+ * Keycloak realm where the Mailcow client is configured.
2314
+ */
2315
+ realm: string;
2316
+ /**
2317
+ * Client ID of the Mailcow OIDC client inside the realm.
2318
+ */
2319
+ client_id: string;
2320
+ /**
2321
+ * Client secret paired with `client_id`. Sent back from Mailcow as
2322
+ * `"*"` once configured.
2323
+ */
2324
+ client_secret: string;
2325
+ /**
2326
+ * Primary redirect URL configured for the Mailcow client in Keycloak.
2327
+ */
2328
+ redirect_url: string;
2329
+ /**
2330
+ * Additional accepted redirect URLs.
2331
+ */
2332
+ redirect_url_extra?: string[];
2333
+ /**
2334
+ * Keycloak version (for example `26.1.3`). Mailcow uses this to pick
2335
+ * the right admin API shape internally.
2336
+ */
2337
+ version: string;
2338
+ /**
2339
+ * Validate user passwords via the Keycloak admin REST API instead of
2340
+ * relying only on the Authorization Code Flow. Required for IMAP/SMTP
2341
+ * to keep working when Keycloak is the source of truth for passwords.
2342
+ * @defaultValue false
2343
+ */
2344
+ mailpassword_flow?: boolean;
2345
+ }
2346
+ /**
2347
+ * Identity provider attributes for an external LDAP / Active Directory
2348
+ * server.
2349
+ */
2350
+ export interface LdapIdentityProviderAttributes extends BaseIdentityProviderAttributes {
2351
+ authsource: 'ldap';
2352
+ /**
2353
+ * Hostname (or comma-separated list of hostnames for fallback) of the
2354
+ * LDAP server.
2355
+ */
2356
+ host: string;
2357
+ /**
2358
+ * LDAP port as a string.
2359
+ */
2360
+ port: string;
2361
+ /**
2362
+ * Use LDAPS. If `port` is 389 it is forced to 636.
2363
+ * @defaultValue false
2364
+ */
2365
+ use_ssl?: boolean;
2366
+ /**
2367
+ * Use StartTLS. Mutually exclusive with `use_ssl`; preferred over SSL.
2368
+ * @defaultValue false
2369
+ */
2370
+ use_tls?: boolean;
2371
+ /**
2372
+ * Base DN under which user searches are performed.
2373
+ */
2374
+ basedn: string;
2375
+ /**
2376
+ * LDAP attribute used to identify users at login.
2377
+ * @defaultValue 'mail'
2378
+ */
2379
+ username_field?: string;
2380
+ /**
2381
+ * Optional LDAP search filter to limit who may authenticate.
2382
+ */
2383
+ filter?: string;
2384
+ /**
2385
+ * LDAP attribute whose value Mailcow maps to a mailbox template via
2386
+ * `mappers` / `templates`.
2387
+ */
2388
+ attribute_field: string;
2389
+ /**
2390
+ * Bind DN used to perform user searches.
2391
+ */
2392
+ binddn: string;
2393
+ /**
2394
+ * Password for `binddn`.
2395
+ */
2396
+ bindpass: string;
2397
+ }
2398
+ /**
2399
+ * Identity provider attributes for an arbitrary OIDC provider that is
2400
+ * not Keycloak (Authentik, Auth0, Okta, ...).
2401
+ */
2402
+ export interface GenericOidcIdentityProviderAttributes extends BaseIdentityProviderAttributes {
2403
+ authsource: 'generic-oidc';
2404
+ /**
2405
+ * Authorization endpoint URL.
2406
+ */
2407
+ authorize_url: string;
2408
+ /**
2409
+ * Token endpoint URL.
2410
+ */
2411
+ token_url: string;
2412
+ /**
2413
+ * Userinfo endpoint URL.
2414
+ */
2415
+ userinfo_url: string;
2416
+ /**
2417
+ * Client ID issued by the OIDC provider.
2418
+ */
2419
+ client_id: string;
2420
+ /**
2421
+ * Client secret issued by the OIDC provider.
2422
+ */
2423
+ client_secret: string;
2424
+ /**
2425
+ * Primary redirect URL registered with the provider.
2426
+ */
2427
+ redirect_url: string;
2428
+ /**
2429
+ * Additional accepted redirect URLs.
2430
+ */
2431
+ redirect_url_extra?: string[];
2432
+ /**
2433
+ * Space-separated list of OIDC scopes requested at login.
2434
+ * @defaultValue 'openid profile email mailcow_template'
2435
+ */
2436
+ client_scopes?: string;
2437
+ }
2438
+ /**
2439
+ * Discriminated union of every supported identity-provider
2440
+ * configuration. The `authsource` field is the discriminant.
2441
+ */
2442
+ export type IdentityProviderAttributes = KeycloakIdentityProviderAttributes | LdapIdentityProviderAttributes | GenericOidcIdentityProviderAttributes;
2443
+ /**
2444
+ * Wire-level body of the `edit/identity-provider` request. The wrapper
2445
+ * builds this for you from {@link IdentityProviderAttributes}, but it
2446
+ * is exported in case callers need to construct it manually.
2447
+ *
2448
+ * `items` is always `['identity-provider']` -- the array type is used
2449
+ * (rather than a fixed tuple) so callers do not have to use a `const`
2450
+ * assertion to satisfy this interface.
2451
+ */
2452
+ export interface IdentityProviderEditRequest {
2453
+ attr: IdentityProviderAttributes;
2454
+ items: 'identity-provider'[];
2455
+ }
2252
2456
  /**
2253
2457
  * Interface for a general Mailcow API response.
2254
2458
  *
package/dist/types.js CHANGED
@@ -5,10 +5,10 @@ exports.MailcowException = void 0;
5
5
  * Error class used for exception handling.
6
6
  */
7
7
  class MailcowException extends Error {
8
- /**
9
- * The error message provided by Mailcow.
10
- */
11
- message;
8
+ constructor(message, options) {
9
+ super(message, options);
10
+ this.name = 'MailcowException';
11
+ }
12
12
  }
13
13
  exports.MailcowException = MailcowException;
14
14
  //# sourceMappingURL=types.js.map
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AA07CA;;GAEG;AACH,MAAa,gBAAiB,SAAQ,KAAK;IACzC;;OAEG;IACH,OAAO,CAAS;CACjB;AALD,4CAKC"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AA07CA;;GAEG;AACH,MAAa,gBAAiB,SAAQ,KAAK;IACzC,YAAY,OAAgB,EAAE,OAAsB;QAClD,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;IACjC,CAAC;CACF;AALD,4CAKC"}
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "ts-mailcow-api",
3
- "version": "1.3.0",
3
+ "version": "1.5.0",
4
4
  "description": "TypeScript wrapper for the mailcow API.",
5
5
  "scripts": {
6
6
  "test": "ts-mocha \"test/**/*.test.ts\"",
7
+ "test:smoke": "MAILCOW_E2E=1 ts-mocha test/smoke.test.ts",
7
8
  "lint": "eslint src",
8
9
  "lint:fix": "eslint src --fix",
9
10
  "format": "prettier --ignore-path .gitignore --check ./src/",