@happyvertical/directory 0.101.2 → 0.102.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.
@@ -1,4 +1,16 @@
1
- import { AwsAccessKey, AwsAccount, AwsAccountCreationStatus, AwsAccountCreationWaitOptions, AwsAccountParent, AwsAssumeRoleInput, AwsDirectoryAdapter, AwsIamRole, AwsIamUser, AwsOptions, AwsOrganizationalUnit, AwsTemporaryCredentials, CreateAwsAccountInput, CreateAwsIamUserInput, CreateAwsOuInput, CreateGroupInput, CreateUserInput, DirectoryGroup, DirectoryUser, EnsureAwsAccountInput, EnsureAwsIamRoleInput, EnsureAwsOuInput, PutAwsIamRolePolicyInput, UpdateGroupInput, UpdateUserInput } from '../shared/types.js';
1
+ /**
2
+ * AWS directory adapter
3
+ *
4
+ * Implements AwsDirectoryAdapter using AWS SDK v3 for Organizations and IAM.
5
+ * Provides user/group CRUD (mapped to IAM), membership management,
6
+ * organizational unit operations, account management, and access key operations.
7
+ *
8
+ * Caveats:
9
+ * - Account creation is asynchronous; use getAccountCreationStatus to poll.
10
+ * - AWS accounts cannot be truly deleted via the API.
11
+ * - IAM CreateUser does not set passwords (use CreateLoginProfile separately).
12
+ */
13
+ import type { AwsAccessKey, AwsAccount, AwsAccountCreationStatus, AwsAccountCreationWaitOptions, AwsAccountParent, AwsAssumeRoleInput, AwsDirectoryAdapter, AwsIamRole, AwsIamUser, AwsOptions, AwsOrganizationalUnit, AwsTemporaryCredentials, CreateAwsAccountInput, CreateAwsIamUserInput, CreateAwsOuInput, CreateGroupInput, CreateUserInput, DirectoryGroup, DirectoryUser, EnsureAwsAccountInput, EnsureAwsIamRoleInput, EnsureAwsOuInput, PutAwsIamRolePolicyInput, UpdateGroupInput, UpdateUserInput } from '../shared/types.js';
2
14
  export declare class AwsAdapter implements AwsDirectoryAdapter {
3
15
  readonly options: AwsOptions;
4
16
  private readonly orgs;
@@ -1,4 +1,11 @@
1
- import { CreateGroupInput, CreateOAuth2ClientInput, CreateUserInput, CredentialResetIntent, DirectoryGroup, DirectoryUser, KanidmDirectoryAdapter, KanidmOptions, OAuth2Client, UpdateGroupInput, UpdateOAuth2ClientInput, UpdateUserInput } from '../shared/types.js';
1
+ /**
2
+ * Kanidm directory adapter
3
+ *
4
+ * Implements KanidmDirectoryAdapter using the Kanidm REST API v1.
5
+ * Provides user/group CRUD, membership management, and OAuth2 client operations.
6
+ * Uses native fetch with AbortSignal.timeout() for all HTTP requests.
7
+ */
8
+ import type { CreateGroupInput, CreateOAuth2ClientInput, CreateUserInput, CredentialResetIntent, DirectoryGroup, DirectoryUser, KanidmDirectoryAdapter, KanidmOptions, OAuth2Client, UpdateGroupInput, UpdateOAuth2ClientInput, UpdateUserInput } from '../shared/types.js';
2
9
  export declare class KanidmAdapter implements KanidmDirectoryAdapter {
3
10
  private readonly options;
4
11
  private readonly baseUrl;
@@ -1,4 +1,17 @@
1
- import { CreateGroupInput, CreatePgDatabaseInput, CreatePgRoleInput, CreateUserInput, DirectoryGroup, DirectoryUser, PgDatabase, PgRole, PostgresDirectoryAdapter, PostgresOptions, UpdateGroupInput, UpdateUserInput } from '../shared/types.js';
1
+ /**
2
+ * PostgreSQL directory adapter for @happyvertical/directory
3
+ *
4
+ * Maps PostgreSQL roles and databases to the DirectoryAdapter interface.
5
+ * Uses the CNPG cluster admin role for provisioning operations.
6
+ *
7
+ * Concept mapping:
8
+ * - DirectoryUser -> PostgreSQL role WITH LOGIN
9
+ * - DirectoryGroup -> PostgreSQL role WITHOUT LOGIN (NOLOGIN)
10
+ * - Membership -> GRANT role TO role
11
+ * - PgDatabase -> PostgreSQL database
12
+ * - PgRole -> PostgreSQL role (any)
13
+ */
14
+ import type { CreateGroupInput, CreatePgDatabaseInput, CreatePgRoleInput, CreateUserInput, DirectoryGroup, DirectoryUser, PgDatabase, PgRole, PostgresDirectoryAdapter, PostgresOptions, UpdateGroupInput, UpdateUserInput } from '../shared/types.js';
2
15
  export declare class PostgresAdapter implements PostgresDirectoryAdapter {
3
16
  private options;
4
17
  private client;
@@ -1,4 +1,11 @@
1
- import { CreateDkimKeyInput, CreateGroupInput, CreateMailboxInput, CreateMailDomainInput, CreateUserInput, DirectoryGroup, DirectoryUser, DkimKey, DnsRecord, EnsureMailboxInput, EnsureMailboxResult, Mailbox, MailDomain, StalwartDirectoryAdapter, StalwartOptions, UpdateGroupInput, UpdateMailboxInput, UpdateUserInput } from '../shared/types.js';
1
+ /**
2
+ * Stalwart mail server directory adapter
3
+ *
4
+ * Implements StalwartDirectoryAdapter using the Stalwart REST API
5
+ * with HTTP Basic authentication. Manages users, groups, domains,
6
+ * DKIM keys, DNS records, and mailboxes via the principals API.
7
+ */
8
+ import type { CreateDkimKeyInput, CreateGroupInput, CreateMailboxInput, CreateMailDomainInput, CreateUserInput, DirectoryGroup, DirectoryUser, DkimKey, DnsRecord, EnsureMailboxInput, EnsureMailboxResult, Mailbox, MailDomain, StalwartDirectoryAdapter, StalwartOptions, UpdateGroupInput, UpdateMailboxInput, UpdateUserInput } from '../shared/types.js';
2
9
  export declare class StalwartAdapter implements StalwartDirectoryAdapter {
3
10
  private readonly options;
4
11
  private readonly authHeader;
@@ -1,4 +1,7 @@
1
- import { AwsDirectoryAdapter, AwsOptions, DirectoryAdapter, GetDirectoryAdapterOptions, KanidmDirectoryAdapter, KanidmOptions, PostgresDirectoryAdapter, PostgresOptions, StalwartDirectoryAdapter, StalwartOptions } from './types.js';
1
+ /**
2
+ * Factory functions and type guards for @happyvertical/directory package
3
+ */
4
+ import type { AwsDirectoryAdapter, AwsOptions, DirectoryAdapter, GetDirectoryAdapterOptions, KanidmDirectoryAdapter, KanidmOptions, PostgresDirectoryAdapter, PostgresOptions, StalwartDirectoryAdapter, StalwartOptions } from './types.js';
2
5
  export declare function isKanidmOptions(opts: GetDirectoryAdapterOptions): opts is KanidmOptions;
3
6
  export declare function isStalwartOptions(opts: GetDirectoryAdapterOptions): opts is StalwartOptions;
4
7
  export declare function isPostgresOptions(opts: GetDirectoryAdapterOptions): opts is PostgresOptions;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@happyvertical/directory",
3
- "version": "0.101.2",
3
+ "version": "0.102.2",
4
4
  "description": "Unified directory services with adapter-based architecture (Kanidm, Stalwart, PostgreSQL, AWS)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -24,7 +24,7 @@
24
24
  "access": "public"
25
25
  },
26
26
  "dependencies": {
27
- "@happyvertical/utils": "0.101.2",
27
+ "@happyvertical/utils": "0.102.2",
28
28
  "@aws-sdk/client-iam": "^3.1034.0",
29
29
  "@aws-sdk/client-organizations": "^3.1034.0",
30
30
  "@aws-sdk/client-sts": "^3.1034.0",