@absolutejs/auth 0.27.0-beta.10 → 0.27.0-beta.11
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/dist/actions.d.ts +27 -0
- package/dist/index.d.ts +8 -3
- package/dist/index.js +9106 -8946
- package/dist/index.js.map +14 -10
- package/dist/oidc/config.d.ts +6 -0
- package/dist/oidc/routes.d.ts +3 -3
- package/dist/organizations/operations.d.ts +7 -0
- package/dist/vault/config.d.ts +20 -0
- package/dist/vault/inMemoryVaultStore.d.ts +2 -0
- package/dist/vault/postgresVaultStore.d.ts +100 -0
- package/dist/vault/types.d.ts +14 -0
- package/package.json +1 -1
package/dist/oidc/config.d.ts
CHANGED
|
@@ -6,6 +6,12 @@ export type OidcProviderConfig<UserType> = {
|
|
|
6
6
|
accessTokenTtlMs?: number;
|
|
7
7
|
authorizationCodeStore: AuthorizationCodeStore;
|
|
8
8
|
clientStore: OAuthClientStore;
|
|
9
|
+
getAccessTokenClaims?: (context: {
|
|
10
|
+
audience?: string;
|
|
11
|
+
clientId: string;
|
|
12
|
+
scopes: string[];
|
|
13
|
+
sub: string;
|
|
14
|
+
}) => Record<string, unknown> | Promise<Record<string, unknown>>;
|
|
9
15
|
getClaims?: (user: UserType) => Record<string, unknown>;
|
|
10
16
|
getGrantedScopes?: (context: {
|
|
11
17
|
client: {
|
package/dist/oidc/routes.d.ts
CHANGED
|
@@ -27,9 +27,9 @@ export declare const oidcProviderRoutes: <UserType>(config: OidcProviderConfig<U
|
|
|
27
27
|
body: unknown;
|
|
28
28
|
params: {};
|
|
29
29
|
query: {
|
|
30
|
-
nonce?: string | undefined;
|
|
31
30
|
client_id?: string | undefined;
|
|
32
31
|
scope?: string | undefined;
|
|
32
|
+
nonce?: string | undefined;
|
|
33
33
|
code_challenge?: string | undefined;
|
|
34
34
|
code_challenge_method?: string | undefined;
|
|
35
35
|
redirect_uri?: string | undefined;
|
|
@@ -55,10 +55,10 @@ export declare const oidcProviderRoutes: <UserType>(config: OidcProviderConfig<U
|
|
|
55
55
|
[x: string]: {
|
|
56
56
|
post: {
|
|
57
57
|
body: {
|
|
58
|
-
audience?: string | undefined;
|
|
59
|
-
resource?: string | undefined;
|
|
60
58
|
client_id?: string | undefined;
|
|
61
59
|
scope?: string | undefined;
|
|
60
|
+
audience?: string | undefined;
|
|
61
|
+
resource?: string | undefined;
|
|
62
62
|
refresh_token?: string | undefined;
|
|
63
63
|
client_secret?: string | undefined;
|
|
64
64
|
grant_type?: string | undefined;
|
|
@@ -5,6 +5,13 @@ export declare const acceptInvitation: ({ organizationStore, token, userId }: {
|
|
|
5
5
|
token: string;
|
|
6
6
|
userId: string;
|
|
7
7
|
}) => Promise<OrganizationMembership | undefined>;
|
|
8
|
+
export declare const autoAssignOrgsByEmail: ({ email, getOrgsForDomain, organizationStore, roles, userId }: {
|
|
9
|
+
email: string;
|
|
10
|
+
getOrgsForDomain: (domain: string) => Promise<OrganizationId[]> | OrganizationId[];
|
|
11
|
+
organizationStore: OrganizationStore;
|
|
12
|
+
roles?: string[];
|
|
13
|
+
userId: string;
|
|
14
|
+
}) => Promise<string[]>;
|
|
8
15
|
export declare const createOrganization: ({ metadata, name, organizationStore, ownerRoles, ownerUserId }: {
|
|
9
16
|
metadata?: Record<string, unknown>;
|
|
10
17
|
name: string;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type SecretCipher } from '../compliance/cipher';
|
|
2
|
+
import type { VaultStore } from './types';
|
|
3
|
+
export type Vault = {
|
|
4
|
+
delete: (ownerId: string, name: string) => Promise<void>;
|
|
5
|
+
get: (ownerId: string, name: string) => Promise<string | undefined>;
|
|
6
|
+
list: (ownerId: string) => Promise<string[]>;
|
|
7
|
+
put: (ownerId: string, name: string, value: string) => Promise<void>;
|
|
8
|
+
};
|
|
9
|
+
export declare const createVault: ({ cipher, store }: {
|
|
10
|
+
cipher: SecretCipher;
|
|
11
|
+
store: VaultStore;
|
|
12
|
+
}) => Vault;
|
|
13
|
+
export type VaultKeyRotationResult = {
|
|
14
|
+
rotated: number;
|
|
15
|
+
};
|
|
16
|
+
export declare const rotateVaultKey: ({ newKey, oldKey, store }: {
|
|
17
|
+
newKey: string;
|
|
18
|
+
oldKey: string;
|
|
19
|
+
store: VaultStore;
|
|
20
|
+
}) => Promise<VaultKeyRotationResult>;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { type AnyPgDatabase } from '../stores/postgres';
|
|
2
|
+
import type { VaultStore } from './types';
|
|
3
|
+
export declare const vaultEntriesTable: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
4
|
+
name: "auth_vault_entries";
|
|
5
|
+
schema: undefined;
|
|
6
|
+
columns: {
|
|
7
|
+
created_at_ms: import("drizzle-orm/pg-core").PgColumn<{
|
|
8
|
+
name: "created_at_ms";
|
|
9
|
+
tableName: "auth_vault_entries";
|
|
10
|
+
dataType: "number";
|
|
11
|
+
columnType: "PgBigInt53";
|
|
12
|
+
data: number;
|
|
13
|
+
driverParam: string | number;
|
|
14
|
+
notNull: true;
|
|
15
|
+
hasDefault: false;
|
|
16
|
+
isPrimaryKey: false;
|
|
17
|
+
isAutoincrement: false;
|
|
18
|
+
hasRuntimeDefault: false;
|
|
19
|
+
enumValues: undefined;
|
|
20
|
+
baseColumn: never;
|
|
21
|
+
identity: undefined;
|
|
22
|
+
generated: undefined;
|
|
23
|
+
}, {}, {}>;
|
|
24
|
+
encrypted_value: import("drizzle-orm/pg-core").PgColumn<{
|
|
25
|
+
name: "encrypted_value";
|
|
26
|
+
tableName: "auth_vault_entries";
|
|
27
|
+
dataType: "string";
|
|
28
|
+
columnType: "PgText";
|
|
29
|
+
data: string;
|
|
30
|
+
driverParam: string;
|
|
31
|
+
notNull: true;
|
|
32
|
+
hasDefault: false;
|
|
33
|
+
isPrimaryKey: false;
|
|
34
|
+
isAutoincrement: false;
|
|
35
|
+
hasRuntimeDefault: false;
|
|
36
|
+
enumValues: [string, ...string[]];
|
|
37
|
+
baseColumn: never;
|
|
38
|
+
identity: undefined;
|
|
39
|
+
generated: undefined;
|
|
40
|
+
}, {}, {}>;
|
|
41
|
+
name: import("drizzle-orm/pg-core").PgColumn<{
|
|
42
|
+
name: "name";
|
|
43
|
+
tableName: "auth_vault_entries";
|
|
44
|
+
dataType: "string";
|
|
45
|
+
columnType: "PgVarchar";
|
|
46
|
+
data: string;
|
|
47
|
+
driverParam: string;
|
|
48
|
+
notNull: true;
|
|
49
|
+
hasDefault: false;
|
|
50
|
+
isPrimaryKey: false;
|
|
51
|
+
isAutoincrement: false;
|
|
52
|
+
hasRuntimeDefault: false;
|
|
53
|
+
enumValues: [string, ...string[]];
|
|
54
|
+
baseColumn: never;
|
|
55
|
+
identity: undefined;
|
|
56
|
+
generated: undefined;
|
|
57
|
+
}, {}, {
|
|
58
|
+
length: 255;
|
|
59
|
+
}>;
|
|
60
|
+
owner_id: import("drizzle-orm/pg-core").PgColumn<{
|
|
61
|
+
name: "owner_id";
|
|
62
|
+
tableName: "auth_vault_entries";
|
|
63
|
+
dataType: "string";
|
|
64
|
+
columnType: "PgVarchar";
|
|
65
|
+
data: string;
|
|
66
|
+
driverParam: string;
|
|
67
|
+
notNull: true;
|
|
68
|
+
hasDefault: false;
|
|
69
|
+
isPrimaryKey: false;
|
|
70
|
+
isAutoincrement: false;
|
|
71
|
+
hasRuntimeDefault: false;
|
|
72
|
+
enumValues: [string, ...string[]];
|
|
73
|
+
baseColumn: never;
|
|
74
|
+
identity: undefined;
|
|
75
|
+
generated: undefined;
|
|
76
|
+
}, {}, {
|
|
77
|
+
length: 255;
|
|
78
|
+
}>;
|
|
79
|
+
updated_at_ms: import("drizzle-orm/pg-core").PgColumn<{
|
|
80
|
+
name: "updated_at_ms";
|
|
81
|
+
tableName: "auth_vault_entries";
|
|
82
|
+
dataType: "number";
|
|
83
|
+
columnType: "PgBigInt53";
|
|
84
|
+
data: number;
|
|
85
|
+
driverParam: string | number;
|
|
86
|
+
notNull: true;
|
|
87
|
+
hasDefault: false;
|
|
88
|
+
isPrimaryKey: false;
|
|
89
|
+
isAutoincrement: false;
|
|
90
|
+
hasRuntimeDefault: false;
|
|
91
|
+
enumValues: undefined;
|
|
92
|
+
baseColumn: never;
|
|
93
|
+
identity: undefined;
|
|
94
|
+
generated: undefined;
|
|
95
|
+
}, {}, {}>;
|
|
96
|
+
};
|
|
97
|
+
dialect: "pg";
|
|
98
|
+
}>;
|
|
99
|
+
export declare const createNeonVaultStore: (databaseUrl: string) => VaultStore;
|
|
100
|
+
export declare const createPostgresVaultStore: (db: AnyPgDatabase) => VaultStore;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type VaultEntry = {
|
|
2
|
+
createdAt: number;
|
|
3
|
+
encryptedValue: string;
|
|
4
|
+
name: string;
|
|
5
|
+
ownerId: string;
|
|
6
|
+
updatedAt: number;
|
|
7
|
+
};
|
|
8
|
+
export type VaultStore = {
|
|
9
|
+
deleteEntry: (ownerId: string, name: string) => Promise<void>;
|
|
10
|
+
getEntry: (ownerId: string, name: string) => Promise<VaultEntry | undefined>;
|
|
11
|
+
listAllEntries: () => Promise<VaultEntry[]>;
|
|
12
|
+
listEntries: (ownerId: string) => Promise<VaultEntry[]>;
|
|
13
|
+
saveEntry: (entry: VaultEntry) => Promise<void>;
|
|
14
|
+
};
|
package/package.json
CHANGED