@dfns/sdk 0.1.0-alpha.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/baseAuthApi.d.ts +53 -0
- package/baseAuthApi.js +39 -0
- package/codegen/ApiKeys/ApiKeysClient.d.ts +10 -0
- package/codegen/ApiKeys/ApiKeysClient.js +56 -0
- package/codegen/ApiKeys/DelegatedApiKeysClient.d.ts +13 -0
- package/codegen/ApiKeys/DelegatedApiKeysClient.js +88 -0
- package/codegen/ApiKeys/index.d.ts +3 -0
- package/codegen/ApiKeys/index.js +19 -0
- package/codegen/ApiKeys/types.d.ts +16 -0
- package/codegen/ApiKeys/types.js +2 -0
- package/codegen/Assets/AssetsClient.d.ts +14 -0
- package/codegen/Assets/AssetsClient.js +105 -0
- package/codegen/Assets/DelegatedAssetsClient.d.ts +18 -0
- package/codegen/Assets/DelegatedAssetsClient.js +152 -0
- package/codegen/Assets/index.d.ts +3 -0
- package/codegen/Assets/index.js +19 -0
- package/codegen/Assets/types.d.ts +39 -0
- package/codegen/Assets/types.js +2 -0
- package/codegen/Auth/AuthClient.d.ts +62 -0
- package/codegen/Auth/AuthClient.js +667 -0
- package/codegen/Auth/DelegatedAuthClient.d.ts +98 -0
- package/codegen/Auth/DelegatedAuthClient.js +1223 -0
- package/codegen/Auth/index.d.ts +3 -0
- package/codegen/Auth/index.js +19 -0
- package/codegen/Auth/types.d.ts +243 -0
- package/codegen/Auth/types.js +2 -0
- package/codegen/Callbacks/CallbacksClient.d.ts +12 -0
- package/codegen/Callbacks/CallbacksClient.js +78 -0
- package/codegen/Callbacks/DelegatedCallbacksClient.d.ts +15 -0
- package/codegen/Callbacks/DelegatedCallbacksClient.js +110 -0
- package/codegen/Callbacks/index.d.ts +3 -0
- package/codegen/Callbacks/index.js +19 -0
- package/codegen/Callbacks/types.d.ts +23 -0
- package/codegen/Callbacks/types.js +2 -0
- package/codegen/Permissions/DelegatedPermissionsClient.d.ts +28 -0
- package/codegen/Permissions/DelegatedPermissionsClient.js +297 -0
- package/codegen/Permissions/PermissionsClient.d.ts +19 -0
- package/codegen/Permissions/PermissionsClient.js +169 -0
- package/codegen/Permissions/index.d.ts +3 -0
- package/codegen/Permissions/index.js +19 -0
- package/codegen/Permissions/types.d.ts +71 -0
- package/codegen/Permissions/types.js +2 -0
- package/codegen/PolicyExecution/DelegatedPolicyExecutionClient.d.ts +11 -0
- package/codegen/PolicyExecution/DelegatedPolicyExecutionClient.js +62 -0
- package/codegen/PolicyExecution/PolicyExecutionClient.d.ts +9 -0
- package/codegen/PolicyExecution/PolicyExecutionClient.js +46 -0
- package/codegen/PolicyExecution/index.d.ts +3 -0
- package/codegen/PolicyExecution/index.js +19 -0
- package/codegen/PolicyExecution/types.d.ts +16 -0
- package/codegen/PolicyExecution/types.js +2 -0
- package/codegen/PolicyManagement/DelegatedPolicyManagementClient.d.ts +31 -0
- package/codegen/PolicyManagement/DelegatedPolicyManagementClient.js +324 -0
- package/codegen/PolicyManagement/PolicyManagementClient.d.ts +21 -0
- package/codegen/PolicyManagement/PolicyManagementClient.js +185 -0
- package/codegen/PolicyManagement/index.d.ts +3 -0
- package/codegen/PolicyManagement/index.js +19 -0
- package/codegen/PolicyManagement/types.d.ts +91 -0
- package/codegen/PolicyManagement/types.js +2 -0
- package/codegen/PublicKeys/DelegatedPublicKeysClient.d.ts +21 -0
- package/codegen/PublicKeys/DelegatedPublicKeysClient.js +191 -0
- package/codegen/PublicKeys/PublicKeysClient.d.ts +16 -0
- package/codegen/PublicKeys/PublicKeysClient.js +130 -0
- package/codegen/PublicKeys/index.d.ts +3 -0
- package/codegen/PublicKeys/index.js +19 -0
- package/codegen/PublicKeys/types.d.ts +51 -0
- package/codegen/PublicKeys/types.js +2 -0
- package/codegen/Wallets/DelegatedWalletsClient.d.ts +26 -0
- package/codegen/Wallets/DelegatedWalletsClient.js +249 -0
- package/codegen/Wallets/WalletsClient.d.ts +21 -0
- package/codegen/Wallets/WalletsClient.js +188 -0
- package/codegen/Wallets/index.d.ts +3 -0
- package/codegen/Wallets/index.js +19 -0
- package/codegen/Wallets/types.d.ts +87 -0
- package/codegen/Wallets/types.js +2 -0
- package/codegen/datamodel/ApiKeys/errors.d.ts +6 -0
- package/codegen/datamodel/ApiKeys/errors.js +15 -0
- package/codegen/datamodel/ApiKeys/index.d.ts +3 -0
- package/codegen/datamodel/ApiKeys/index.js +19 -0
- package/codegen/datamodel/ApiKeys/responses.d.ts +25 -0
- package/codegen/datamodel/ApiKeys/responses.js +2 -0
- package/codegen/datamodel/ApiKeys/types.d.ts +32 -0
- package/codegen/datamodel/ApiKeys/types.js +11 -0
- package/codegen/datamodel/Assets/errors.d.ts +11 -0
- package/codegen/datamodel/Assets/errors.js +17 -0
- package/codegen/datamodel/Assets/index.d.ts +3 -0
- package/codegen/datamodel/Assets/index.js +19 -0
- package/codegen/datamodel/Assets/responses.d.ts +45 -0
- package/codegen/datamodel/Assets/responses.js +2 -0
- package/codegen/datamodel/Assets/types.d.ts +225 -0
- package/codegen/datamodel/Assets/types.js +75 -0
- package/codegen/datamodel/Auth/index.d.ts +2 -0
- package/codegen/datamodel/Auth/index.js +18 -0
- package/codegen/datamodel/Auth/responses.d.ts +348 -0
- package/codegen/datamodel/Auth/responses.js +2 -0
- package/codegen/datamodel/Auth/types.d.ts +610 -0
- package/codegen/datamodel/Auth/types.js +127 -0
- package/codegen/datamodel/Callbacks/index.d.ts +2 -0
- package/codegen/datamodel/Callbacks/index.js +18 -0
- package/codegen/datamodel/Callbacks/responses.d.ts +36 -0
- package/codegen/datamodel/Callbacks/responses.js +2 -0
- package/codegen/datamodel/Callbacks/types.d.ts +43 -0
- package/codegen/datamodel/Callbacks/types.js +39 -0
- package/codegen/datamodel/Foundations/errors.d.ts +121 -0
- package/codegen/datamodel/Foundations/errors.js +169 -0
- package/codegen/datamodel/Foundations/index.d.ts +2 -0
- package/codegen/datamodel/Foundations/index.js +18 -0
- package/codegen/datamodel/Foundations/types.d.ts +9754 -0
- package/codegen/datamodel/Foundations/types.js +57741 -0
- package/codegen/datamodel/Permissions/index.d.ts +2 -0
- package/codegen/datamodel/Permissions/index.js +18 -0
- package/codegen/datamodel/Permissions/responses.d.ts +75 -0
- package/codegen/datamodel/Permissions/responses.js +2 -0
- package/codegen/datamodel/Permissions/types.d.ts +106 -0
- package/codegen/datamodel/Permissions/types.js +65 -0
- package/codegen/datamodel/PolicyExecution/errors.d.ts +11 -0
- package/codegen/datamodel/PolicyExecution/errors.js +17 -0
- package/codegen/datamodel/PolicyExecution/index.d.ts +3 -0
- package/codegen/datamodel/PolicyExecution/index.js +19 -0
- package/codegen/datamodel/PolicyExecution/responses.d.ts +17 -0
- package/codegen/datamodel/PolicyExecution/responses.js +2 -0
- package/codegen/datamodel/PolicyExecution/types.d.ts +45 -0
- package/codegen/datamodel/PolicyExecution/types.js +15 -0
- package/codegen/datamodel/PolicyManagement/index.d.ts +2 -0
- package/codegen/datamodel/PolicyManagement/index.js +18 -0
- package/codegen/datamodel/PolicyManagement/responses.d.ts +83 -0
- package/codegen/datamodel/PolicyManagement/responses.js +2 -0
- package/codegen/datamodel/PolicyManagement/types.d.ts +252 -0
- package/codegen/datamodel/PolicyManagement/types.js +81 -0
- package/codegen/datamodel/PublicKeys/index.d.ts +2 -0
- package/codegen/datamodel/PublicKeys/index.js +18 -0
- package/codegen/datamodel/PublicKeys/responses.d.ts +56 -0
- package/codegen/datamodel/PublicKeys/responses.js +2 -0
- package/codegen/datamodel/PublicKeys/types.d.ts +222 -0
- package/codegen/datamodel/PublicKeys/types.js +59 -0
- package/codegen/datamodel/Wallets/index.d.ts +2 -0
- package/codegen/datamodel/Wallets/index.js +18 -0
- package/codegen/datamodel/Wallets/responses.d.ts +77 -0
- package/codegen/datamodel/Wallets/responses.js +2 -0
- package/codegen/datamodel/Wallets/types.d.ts +261 -0
- package/codegen/datamodel/Wallets/types.js +89 -0
- package/dfnsApiClient.d.ts +27 -0
- package/dfnsApiClient.js +45 -0
- package/dfnsAuthenticator.d.ts +11 -0
- package/dfnsAuthenticator.js +18 -0
- package/dfnsDelegatedApiClient.d.ts +24 -0
- package/dfnsDelegatedApiClient.js +41 -0
- package/dfnsError.d.ts +5 -0
- package/dfnsError.js +11 -0
- package/index.d.ts +3 -0
- package/index.js +19 -0
- package/package.json +11 -0
- package/signer.d.ts +47 -0
- package/signer.js +2 -0
- package/utils/base64.d.ts +3 -0
- package/utils/base64.js +20 -0
- package/utils/fetch.d.ts +12 -0
- package/utils/fetch.js +89 -0
- package/utils/nonce.d.ts +1 -0
- package/utils/nonce.js +12 -0
- package/utils/url.d.ts +4 -0
- package/utils/url.js +15 -0
|
@@ -0,0 +1,610 @@
|
|
|
1
|
+
import { Email, EntityId, IntegerPositiveStrict, IsoDatetime, Username } from '../Foundations';
|
|
2
|
+
export type Application = {
|
|
3
|
+
appId: EntityId;
|
|
4
|
+
apiToken?: Jwt;
|
|
5
|
+
};
|
|
6
|
+
export type GenericSuccessMessage = {
|
|
7
|
+
message: string;
|
|
8
|
+
};
|
|
9
|
+
export type UserRegistration = {
|
|
10
|
+
credential: UserCredentialInformation;
|
|
11
|
+
user: UserRegistrationInformation;
|
|
12
|
+
};
|
|
13
|
+
export type UserRegistrationChallenge = {
|
|
14
|
+
temporaryAuthenticationToken: Jwt;
|
|
15
|
+
rp: RelyingParty;
|
|
16
|
+
user: AuthenticationUserInformation;
|
|
17
|
+
supportedCredentialKinds: SupportedCredentialKinds;
|
|
18
|
+
otpUrl: string;
|
|
19
|
+
challenge: string;
|
|
20
|
+
authenticatorSelection: AuthenticatorSelection;
|
|
21
|
+
attestation: AuthenticatorAttestationOptions;
|
|
22
|
+
pubKeyCredParams: PubKeyCredParams[];
|
|
23
|
+
excludeCredentials: AllowCredential[];
|
|
24
|
+
};
|
|
25
|
+
export type UserLoginChallenge = {
|
|
26
|
+
supportedCredentialKinds: SupportedCredentials[];
|
|
27
|
+
challenge: string;
|
|
28
|
+
challengeIdentifier: Jwt;
|
|
29
|
+
externalAuthenticationUrl: string;
|
|
30
|
+
allowCredentials: AllowCredentials;
|
|
31
|
+
};
|
|
32
|
+
export type UserLogin = {
|
|
33
|
+
token: Jwt;
|
|
34
|
+
};
|
|
35
|
+
export type UserActionSignature = {
|
|
36
|
+
userAction: string;
|
|
37
|
+
};
|
|
38
|
+
export type AccessTokenInfoWithPublicKey = {
|
|
39
|
+
accessToken?: Jwt;
|
|
40
|
+
dateCreated: IsoDatetime;
|
|
41
|
+
credId: string;
|
|
42
|
+
isActive: boolean;
|
|
43
|
+
kind: AccessTokenKind;
|
|
44
|
+
linkedUserId: EntityId;
|
|
45
|
+
linkedAppId: string;
|
|
46
|
+
name: string;
|
|
47
|
+
orgId: EntityId;
|
|
48
|
+
permissionAssignments: PermissionAssignmentInfo[];
|
|
49
|
+
publicKey: string;
|
|
50
|
+
tokenId: EntityId;
|
|
51
|
+
};
|
|
52
|
+
export type UserInfo = {
|
|
53
|
+
username: string;
|
|
54
|
+
userId: EntityId;
|
|
55
|
+
kind: UserAuthKind;
|
|
56
|
+
credentialUuid: EntityId;
|
|
57
|
+
orgId: EntityId;
|
|
58
|
+
permissions?: string[];
|
|
59
|
+
scopes?: string[];
|
|
60
|
+
isActive: boolean;
|
|
61
|
+
isServiceAccount: boolean;
|
|
62
|
+
isRegistered: boolean;
|
|
63
|
+
permissionAssignments: PermissionAssignmentInfo[];
|
|
64
|
+
};
|
|
65
|
+
export type UserAccessTokenInformation = {
|
|
66
|
+
userInfo: UserInfo;
|
|
67
|
+
accessTokens: AccessTokenInfoWithPublicKey[];
|
|
68
|
+
};
|
|
69
|
+
export type AppInfoWithPublicKey = {
|
|
70
|
+
appId: EntityId;
|
|
71
|
+
kind: ApplicationKind;
|
|
72
|
+
orgId: EntityId;
|
|
73
|
+
expectedRpId: string;
|
|
74
|
+
name: string;
|
|
75
|
+
isActive: boolean;
|
|
76
|
+
expectedOrigin: string;
|
|
77
|
+
permissionAssignments: PermissionAssignmentInfo[];
|
|
78
|
+
accessTokens: AccessTokenInfoWithPublicKey[];
|
|
79
|
+
};
|
|
80
|
+
export type CredentialInfo = {
|
|
81
|
+
credentialId: string;
|
|
82
|
+
credentialUuid: EntityId;
|
|
83
|
+
dateCreated: IsoDatetime;
|
|
84
|
+
isActive: boolean;
|
|
85
|
+
kind: CredentialKind;
|
|
86
|
+
name: string;
|
|
87
|
+
publicKey?: string;
|
|
88
|
+
relyingPartyId: string;
|
|
89
|
+
origin: string;
|
|
90
|
+
};
|
|
91
|
+
export type AvailableOrg = {
|
|
92
|
+
/**
|
|
93
|
+
* The ID of the organization.
|
|
94
|
+
*/
|
|
95
|
+
orgId: EntityId;
|
|
96
|
+
/**
|
|
97
|
+
* The ID of an application that can be used to log into the given org.
|
|
98
|
+
*/
|
|
99
|
+
appId: EntityId;
|
|
100
|
+
};
|
|
101
|
+
export type UserRecoveryChallenge = {
|
|
102
|
+
temporaryAuthenticationToken: Jwt;
|
|
103
|
+
rp: RelyingParty;
|
|
104
|
+
user: AuthenticationUserInformation;
|
|
105
|
+
supportedCredentialKinds: SupportedCredentialKinds;
|
|
106
|
+
otpUrl: string;
|
|
107
|
+
challenge: string;
|
|
108
|
+
authenticatorSelection: AuthenticatorSelection;
|
|
109
|
+
attestation: AuthenticatorAttestationOptions;
|
|
110
|
+
pubKeyCredParams: PubKeyCredParams[];
|
|
111
|
+
excludeCredentials: AllowCredential[];
|
|
112
|
+
allowedRecoveryCredentials: AllowRecoveryCredential[];
|
|
113
|
+
};
|
|
114
|
+
export type UserRegistrationBase = {
|
|
115
|
+
temporaryAuthenticationToken: Jwt;
|
|
116
|
+
rp: RelyingParty;
|
|
117
|
+
user: AuthenticationUserInformation;
|
|
118
|
+
};
|
|
119
|
+
export type Fido2Options = {
|
|
120
|
+
temporaryAuthenticationToken: Jwt;
|
|
121
|
+
rp: RelyingParty;
|
|
122
|
+
user: AuthenticationUserInformation;
|
|
123
|
+
kind: CredentialKind.Fido2;
|
|
124
|
+
challenge: string;
|
|
125
|
+
excludeCredentials: ExcludeCredentials[];
|
|
126
|
+
authenticatorSelection: AuthenticatorSelection;
|
|
127
|
+
/**
|
|
128
|
+
* Tells the authenticator that it needs to identify itself to the server, so that the server can verify the device is secure.
|
|
129
|
+
*
|
|
130
|
+
* none: Tells the authenticator that it does not need to provide an attestation document.
|
|
131
|
+
*
|
|
132
|
+
* indirect: Tells the authenticator, that it needs to provide attestation information, but it doesn't need to provide any identifying information about the device.
|
|
133
|
+
*
|
|
134
|
+
* direct: Tells the authenticator, that it needs to provide attestation information, including information to identify the device.
|
|
135
|
+
*
|
|
136
|
+
* enterprise: Tells the authenticator, that it should use enterprise certificates configured on the device for the credentials. For example, smart cards can be supported on Fido2 devices if an enterprise certificate is registered on the device.
|
|
137
|
+
*/
|
|
138
|
+
attestation: AuthenticatorAttestationOptions;
|
|
139
|
+
pubKeyCredParams: PubKeyCredParams[];
|
|
140
|
+
};
|
|
141
|
+
export type PublicKeyOptions = {
|
|
142
|
+
temporaryAuthenticationToken: Jwt;
|
|
143
|
+
rp: RelyingParty;
|
|
144
|
+
user: AuthenticationUserInformation;
|
|
145
|
+
kind: CredentialKind.Key;
|
|
146
|
+
challenge: string;
|
|
147
|
+
pubKeyCredParams: PubKeyCredParams[];
|
|
148
|
+
attestation: AuthenticatorAttestationOptions;
|
|
149
|
+
};
|
|
150
|
+
export type AllowCredential = {
|
|
151
|
+
/**
|
|
152
|
+
* Must be 'public-key'
|
|
153
|
+
*/
|
|
154
|
+
type: string;
|
|
155
|
+
id: string;
|
|
156
|
+
transports?: string;
|
|
157
|
+
};
|
|
158
|
+
export type RelyingParty = {
|
|
159
|
+
id: string;
|
|
160
|
+
name: string;
|
|
161
|
+
};
|
|
162
|
+
export type AuthenticationUserInformation = {
|
|
163
|
+
id: EntityId;
|
|
164
|
+
displayName: string;
|
|
165
|
+
name: string;
|
|
166
|
+
};
|
|
167
|
+
export type PubKeyCredParams = {
|
|
168
|
+
/**
|
|
169
|
+
* Must be 'public-key'
|
|
170
|
+
*/
|
|
171
|
+
type: string;
|
|
172
|
+
alg: number;
|
|
173
|
+
};
|
|
174
|
+
export type AuthenticatorSelection = {
|
|
175
|
+
/**
|
|
176
|
+
* If not given, any authenticator type can be used.
|
|
177
|
+
*
|
|
178
|
+
* platform: Authenticator must be built into the system. For example, Windows Hello or Apple Touch ID use a TPM that are integrated into the system.
|
|
179
|
+
*
|
|
180
|
+
* cross-platform: Authenticator must be able to move between systems. For example, a yubikey is a USB device that can be plugged into any system.
|
|
181
|
+
*/
|
|
182
|
+
authenticatorAttachment?: string;
|
|
183
|
+
/**
|
|
184
|
+
* discouraged: This tells the authenticator to not use resident keys.
|
|
185
|
+
*
|
|
186
|
+
* preferred: This tells the authenticator that resident keys should be used if available.
|
|
187
|
+
*
|
|
188
|
+
* required: This tells the authenticator that a resident key is required.
|
|
189
|
+
*/
|
|
190
|
+
residentKey: AuthenticatorRequirementOptions;
|
|
191
|
+
requireResidentKey: boolean;
|
|
192
|
+
/**
|
|
193
|
+
* Required: Tells the authenticator that the user needs to verify they are in possession of the authenticator device. This usually means the user is prompted for a pin, passcode, or to complete a biometric challenge.
|
|
194
|
+
*
|
|
195
|
+
* Preferred: Tells the authenticator that the user should be asked to verify they are in possession of the authenticator device. This usually means the user is prompted for a pin, passcode, or to complete a biometric challenge.
|
|
196
|
+
* If the user has recently verified their possession the device may choose not to ask the user to verify again.
|
|
197
|
+
*
|
|
198
|
+
* Discouraged: Tells the authenticator that the user should not be prompted for possession. This is generally only used when WebAuthn is a second factor.
|
|
199
|
+
*/
|
|
200
|
+
userVerification: AuthenticatorRequirementOptions;
|
|
201
|
+
};
|
|
202
|
+
export type ExcludeCredentials = {
|
|
203
|
+
/**
|
|
204
|
+
* Must be 'public-key'
|
|
205
|
+
*/
|
|
206
|
+
type: string;
|
|
207
|
+
id: string;
|
|
208
|
+
transports: FidoCredentialsTransportKind;
|
|
209
|
+
};
|
|
210
|
+
export type UserCredentialInformation = {
|
|
211
|
+
uuid: EntityId;
|
|
212
|
+
kind: CredentialKind;
|
|
213
|
+
name: string;
|
|
214
|
+
};
|
|
215
|
+
export type UserRegistrationInformation = {
|
|
216
|
+
id: EntityId;
|
|
217
|
+
username: string;
|
|
218
|
+
orgId: EntityId;
|
|
219
|
+
};
|
|
220
|
+
export type AuthenticateUserPasswordInput = {
|
|
221
|
+
kind: CredentialKind.Password;
|
|
222
|
+
password: string;
|
|
223
|
+
};
|
|
224
|
+
export type AuthenticateUserFido2Input = {
|
|
225
|
+
kind: CredentialKind.Fido2;
|
|
226
|
+
credentialAssertion: Fido2CredentialAssertion;
|
|
227
|
+
};
|
|
228
|
+
export type Fido2CredentialAssertion = {
|
|
229
|
+
credId: string;
|
|
230
|
+
clientData: string;
|
|
231
|
+
authenticatorData: string;
|
|
232
|
+
signature: string;
|
|
233
|
+
userHandle: string;
|
|
234
|
+
};
|
|
235
|
+
export type KeyCredentialAssertion = {
|
|
236
|
+
credId: string;
|
|
237
|
+
clientData: string;
|
|
238
|
+
signature: string;
|
|
239
|
+
};
|
|
240
|
+
export type AuthenticateUserKeyInput = {
|
|
241
|
+
kind: CredentialKind.Key;
|
|
242
|
+
credentialAssertion: KeyCredentialAssertion;
|
|
243
|
+
};
|
|
244
|
+
export type SupportedCredentialKinds = {
|
|
245
|
+
firstFactor: CredentialKind[];
|
|
246
|
+
secondFactor: CredentialKind[];
|
|
247
|
+
};
|
|
248
|
+
export type RegistrationConfirmationFido2 = {
|
|
249
|
+
credentialKind: CredentialKind.Fido2;
|
|
250
|
+
credentialInfo: CredentialAssertion;
|
|
251
|
+
};
|
|
252
|
+
export type RegistrationConfirmationKey = {
|
|
253
|
+
credentialKind: CredentialKind.Key;
|
|
254
|
+
credentialInfo: CredentialAssertion;
|
|
255
|
+
};
|
|
256
|
+
export type RegistrationConfirmationRecoveryKey = {
|
|
257
|
+
encryptedPrivateKey?: string;
|
|
258
|
+
credentialInfo: CredentialAssertion;
|
|
259
|
+
credentialKind: CredentialKind.RecoveryKey;
|
|
260
|
+
};
|
|
261
|
+
export type CredentialAssertion = {
|
|
262
|
+
credId: string;
|
|
263
|
+
clientData: string;
|
|
264
|
+
attestationData: string;
|
|
265
|
+
};
|
|
266
|
+
export type RegistrationConfirmationPassword = {
|
|
267
|
+
credentialKind: CredentialKind.Password;
|
|
268
|
+
credentialInfo: PasswordCredentialInformation;
|
|
269
|
+
};
|
|
270
|
+
export type PasswordCredentialInformation = {
|
|
271
|
+
password: string;
|
|
272
|
+
};
|
|
273
|
+
export type RegistrationConfirmationTotp = {
|
|
274
|
+
credentialKind: CredentialKind.Totp;
|
|
275
|
+
credentialInfo: TotpCredentialInformation;
|
|
276
|
+
};
|
|
277
|
+
export type TotpCredentialInformation = {
|
|
278
|
+
otpCode: string;
|
|
279
|
+
};
|
|
280
|
+
export type AllowCredentials = {
|
|
281
|
+
webauthn: AllowCredential[];
|
|
282
|
+
key: AllowCredential[];
|
|
283
|
+
};
|
|
284
|
+
export type SupportedCredentials = {
|
|
285
|
+
kind: CredentialKind;
|
|
286
|
+
factor: CredentialFactor;
|
|
287
|
+
requiresSecondFactor: boolean;
|
|
288
|
+
};
|
|
289
|
+
export type AuthenticateUserTotpInput = {
|
|
290
|
+
kind: CredentialKind.Totp;
|
|
291
|
+
otpCode: string;
|
|
292
|
+
};
|
|
293
|
+
export type TotpCredential = {
|
|
294
|
+
temporaryAuthenticationToken: Jwt;
|
|
295
|
+
rp: RelyingParty;
|
|
296
|
+
user: AuthenticationUserInformation;
|
|
297
|
+
kind: CredentialKind.Totp;
|
|
298
|
+
otpUrl: string;
|
|
299
|
+
};
|
|
300
|
+
export type PasswordCredential = {
|
|
301
|
+
temporaryAuthenticationToken: Jwt;
|
|
302
|
+
rp: RelyingParty;
|
|
303
|
+
user: AuthenticationUserInformation;
|
|
304
|
+
kind: CredentialKind.Password;
|
|
305
|
+
};
|
|
306
|
+
export type CreateUserCredentialInputBase = {
|
|
307
|
+
challengeIdentifier: Jwt;
|
|
308
|
+
credentialName: string;
|
|
309
|
+
};
|
|
310
|
+
export type CreateUserCredentialTotpInput = {
|
|
311
|
+
challengeIdentifier: Jwt;
|
|
312
|
+
credentialName: string;
|
|
313
|
+
credentialKind: CredentialKind.Totp;
|
|
314
|
+
credentialInfo: TotpCredentialInformation;
|
|
315
|
+
};
|
|
316
|
+
export type CreateUserCredentialPasswordInput = {
|
|
317
|
+
credentialKind: CredentialKind.Password;
|
|
318
|
+
credentialInfo: PasswordCredentialInformation;
|
|
319
|
+
challengeIdentifier: Jwt;
|
|
320
|
+
credentialName: string;
|
|
321
|
+
};
|
|
322
|
+
export type CreateUserCredentialPublicKeyInput = {
|
|
323
|
+
challengeIdentifier: Jwt;
|
|
324
|
+
credentialName: string;
|
|
325
|
+
credentialKind: CredentialKind.Key;
|
|
326
|
+
credentialInfo: CredentialAssertion;
|
|
327
|
+
};
|
|
328
|
+
export type CreateUserCredentialFido2Input = {
|
|
329
|
+
credentialKind: CredentialKind.Fido2;
|
|
330
|
+
credentialInfo: CredentialAssertion;
|
|
331
|
+
challengeIdentifier: Jwt;
|
|
332
|
+
credentialName: string;
|
|
333
|
+
};
|
|
334
|
+
export type HttpRequestInformation = {
|
|
335
|
+
method: string;
|
|
336
|
+
scheme: string;
|
|
337
|
+
authority: string;
|
|
338
|
+
path: string;
|
|
339
|
+
};
|
|
340
|
+
export type LegacyAuthAttestation = {
|
|
341
|
+
token: Jwt;
|
|
342
|
+
decodedToken: DecodedJwt;
|
|
343
|
+
authIdentity: AuthIdentity;
|
|
344
|
+
};
|
|
345
|
+
export type OrgEmployeeIdentity = {
|
|
346
|
+
kind: AuthIdentityKind.OrgEmployeeIdentity;
|
|
347
|
+
orgId: EntityId;
|
|
348
|
+
employeeId: EntityId;
|
|
349
|
+
username: Username;
|
|
350
|
+
scope: string;
|
|
351
|
+
permissions: string[];
|
|
352
|
+
};
|
|
353
|
+
export type OrgApiKeyIdentity = {
|
|
354
|
+
kind: AuthIdentityKind.OrgApiKeyIdentity;
|
|
355
|
+
orgId: EntityId;
|
|
356
|
+
apiKeyId: EntityId;
|
|
357
|
+
scope: string;
|
|
358
|
+
permissions: string[];
|
|
359
|
+
};
|
|
360
|
+
export type DfnsStaffIdentity = {
|
|
361
|
+
kind: AuthIdentityKind.DfnsStaffIdentity;
|
|
362
|
+
orgId: EntityId;
|
|
363
|
+
employeeId: EntityId;
|
|
364
|
+
username: Username;
|
|
365
|
+
scope: string;
|
|
366
|
+
permissions: string[];
|
|
367
|
+
};
|
|
368
|
+
export type DfnsServiceIdentity = {
|
|
369
|
+
kind: AuthIdentityKind.DfnsService;
|
|
370
|
+
serviceName: string;
|
|
371
|
+
};
|
|
372
|
+
export type AuthV2SignedAuthAttestation = {
|
|
373
|
+
authBlock: AuthBlock;
|
|
374
|
+
};
|
|
375
|
+
export type JwtHeader = {
|
|
376
|
+
alg?: string;
|
|
377
|
+
b64?: boolean;
|
|
378
|
+
kid?: string;
|
|
379
|
+
typ?: string;
|
|
380
|
+
};
|
|
381
|
+
export type DecodedJwt = {
|
|
382
|
+
payload: JwtPayload;
|
|
383
|
+
header: JwtHeader;
|
|
384
|
+
};
|
|
385
|
+
export type AuthBlock = {
|
|
386
|
+
request: Jwt;
|
|
387
|
+
auth: Jwt;
|
|
388
|
+
};
|
|
389
|
+
export type CreateUserCredentialRecoveryKeyInput = {
|
|
390
|
+
encryptedPrivateKey?: string;
|
|
391
|
+
credentialInfo: CredentialAssertion;
|
|
392
|
+
credentialKind: CredentialKind.RecoveryKey;
|
|
393
|
+
challengeIdentifier: Jwt;
|
|
394
|
+
credentialName: string;
|
|
395
|
+
};
|
|
396
|
+
export type PermissionAssignmentInfo = {
|
|
397
|
+
permissionName: string;
|
|
398
|
+
permissionId: EntityId;
|
|
399
|
+
assignmentId: EntityId;
|
|
400
|
+
operations?: string[];
|
|
401
|
+
};
|
|
402
|
+
export type AllowRecoveryCredential = {
|
|
403
|
+
id: string;
|
|
404
|
+
encryptedRecoveryKey: string;
|
|
405
|
+
};
|
|
406
|
+
export type RecoverUserInput = {
|
|
407
|
+
kind: CredentialKind.RecoveryKey;
|
|
408
|
+
credentialAssertion: KeyCredentialAssertion;
|
|
409
|
+
};
|
|
410
|
+
export type UserRecoveryCredentials = {
|
|
411
|
+
firstFactorCredential: RegistrationFirstFactor;
|
|
412
|
+
secondFactorCredential?: RegistrationSecondFactor;
|
|
413
|
+
recoveryCredential?: RegistrationConfirmationRecoveryKey;
|
|
414
|
+
};
|
|
415
|
+
export type Jwt = string;
|
|
416
|
+
export type JwtPayload = Record<string, unknown>;
|
|
417
|
+
export type CreateUserActionSignatureChallengeInput = {
|
|
418
|
+
/**
|
|
419
|
+
* Human readable explanation of the activity, so that person can understand what is being signed.
|
|
420
|
+
*/
|
|
421
|
+
userActionPayload: string;
|
|
422
|
+
userActionHttpMethod: string;
|
|
423
|
+
userActionHttpPath: string;
|
|
424
|
+
userActionServerKind?: ServerKind;
|
|
425
|
+
};
|
|
426
|
+
export type CreateDelegatedUserLoginInput = {
|
|
427
|
+
username: string;
|
|
428
|
+
};
|
|
429
|
+
export type CreateUserInput = {
|
|
430
|
+
email: string;
|
|
431
|
+
kind: UserAuthKind;
|
|
432
|
+
publicKey?: string;
|
|
433
|
+
externalId?: string;
|
|
434
|
+
};
|
|
435
|
+
export type CreateUserRegistrationChallengeInput = {
|
|
436
|
+
username: string;
|
|
437
|
+
registrationCode: string;
|
|
438
|
+
orgId: EntityId;
|
|
439
|
+
};
|
|
440
|
+
export type CreateUserRegistrationInput = {
|
|
441
|
+
firstFactorCredential: RegistrationFirstFactor;
|
|
442
|
+
secondFactorCredential?: RegistrationSecondFactor;
|
|
443
|
+
recoveryCredential?: RegistrationConfirmationRecoveryKey;
|
|
444
|
+
};
|
|
445
|
+
export type CreateUserLoginChallengeInput = {
|
|
446
|
+
username: string;
|
|
447
|
+
orgId: EntityId;
|
|
448
|
+
};
|
|
449
|
+
export type CreateUserLoginInput = {
|
|
450
|
+
challengeIdentifier: Jwt;
|
|
451
|
+
firstFactor: AuthenticateUserFirstFactor;
|
|
452
|
+
secondFactor?: AuthenticateUserSecondFactor;
|
|
453
|
+
};
|
|
454
|
+
export type CreateUserCredentialChallengeInput = {
|
|
455
|
+
kind: CredentialKind;
|
|
456
|
+
};
|
|
457
|
+
export type ActivateCredentialInput = {
|
|
458
|
+
credentialUuid: EntityId;
|
|
459
|
+
};
|
|
460
|
+
export type CreateSignedAuthAttestationInput = {
|
|
461
|
+
body?: string;
|
|
462
|
+
headers: Record<string, string>;
|
|
463
|
+
isBase64Encoded: boolean;
|
|
464
|
+
http: HttpRequestInformation;
|
|
465
|
+
};
|
|
466
|
+
export type CreateCodeLoginChallengeInput = {
|
|
467
|
+
code: string;
|
|
468
|
+
};
|
|
469
|
+
export type CreateUserLoginFromCodeInput = {
|
|
470
|
+
challengeIdentifier: Jwt;
|
|
471
|
+
};
|
|
472
|
+
export type CreateOrgOwnerInput = {
|
|
473
|
+
email: Email;
|
|
474
|
+
publicKey?: string;
|
|
475
|
+
orgId: EntityId;
|
|
476
|
+
authBlock: AuthBlock;
|
|
477
|
+
};
|
|
478
|
+
export type CreateAvailableOrgListInput = {
|
|
479
|
+
/**
|
|
480
|
+
* The username of the user that is logging into the system.
|
|
481
|
+
*/
|
|
482
|
+
username: Username;
|
|
483
|
+
/**
|
|
484
|
+
* If specified, the API will return only the matching application for the given org ID. This would be used when the user has already given the org they want to log into, but the caller doesn't know the Auth V2 Application ID to use.
|
|
485
|
+
*/
|
|
486
|
+
orgId?: EntityId;
|
|
487
|
+
/**
|
|
488
|
+
* A list of permission names that the caller will be using in their application.
|
|
489
|
+
*
|
|
490
|
+
* If the list is not empty, the API will attempt to find an Auth V2 Application that has the majority of the permissions provided.
|
|
491
|
+
*
|
|
492
|
+
* If the list is empty or not provided, the API will select the Auth V2 Application with the largest set of permissions.
|
|
493
|
+
*/
|
|
494
|
+
permissions?: string[];
|
|
495
|
+
/**
|
|
496
|
+
* The origin (scheme, hostname, and port) of the server where the request is originating. For example: https://dashboard.dfns.io
|
|
497
|
+
*
|
|
498
|
+
* The API will only return orgs that have a Auth V2 Application with a matching origin.
|
|
499
|
+
*/
|
|
500
|
+
origin: string;
|
|
501
|
+
};
|
|
502
|
+
export type CreateAccessTokenInput = {
|
|
503
|
+
daysValid?: IntegerPositiveStrict;
|
|
504
|
+
name: string;
|
|
505
|
+
permissionId?: EntityId;
|
|
506
|
+
publicKey: string;
|
|
507
|
+
externalId?: string;
|
|
508
|
+
};
|
|
509
|
+
export type UpdateAccessTokenInput = {
|
|
510
|
+
name?: string;
|
|
511
|
+
externalId?: string;
|
|
512
|
+
};
|
|
513
|
+
export type UpdateUserInput = {
|
|
514
|
+
externalId?: string;
|
|
515
|
+
publicKey?: string;
|
|
516
|
+
};
|
|
517
|
+
export type UpdateApplicationInput = {
|
|
518
|
+
externalId?: string;
|
|
519
|
+
name?: string;
|
|
520
|
+
};
|
|
521
|
+
export type CreateApplicationInput = {
|
|
522
|
+
name: string;
|
|
523
|
+
relyingPartyId: string;
|
|
524
|
+
origin: string;
|
|
525
|
+
permissionId?: EntityId;
|
|
526
|
+
kind: ApplicationKind;
|
|
527
|
+
daysValid?: IntegerPositiveStrict;
|
|
528
|
+
publicKey?: string;
|
|
529
|
+
externalId?: string;
|
|
530
|
+
};
|
|
531
|
+
export type CreateUserRecoveryInput = {
|
|
532
|
+
recovery: RecoverUserInput;
|
|
533
|
+
newCredentials: UserRecoveryCredentials;
|
|
534
|
+
};
|
|
535
|
+
export type CreateUserRecoveryChallengeInput = {
|
|
536
|
+
username: string;
|
|
537
|
+
verificationCode: string;
|
|
538
|
+
orgId: EntityId;
|
|
539
|
+
credentialId: string;
|
|
540
|
+
};
|
|
541
|
+
export type CreateUserCredentialInput = CreateUserCredentialTotpInput | CreateUserCredentialPasswordInput | CreateUserCredentialPublicKeyInput | CreateUserCredentialFido2Input | CreateUserCredentialRecoveryKeyInput;
|
|
542
|
+
export type UserCredentialChallenge = Fido2Options | PublicKeyOptions | TotpCredential | PasswordCredential;
|
|
543
|
+
export type SignedAuthAttestation = LegacyAuthAttestation | AuthV2SignedAuthAttestation;
|
|
544
|
+
export type RegistrationFirstFactor = RegistrationConfirmationFido2 | RegistrationConfirmationKey | RegistrationConfirmationPassword;
|
|
545
|
+
export type RegistrationSecondFactor = RegistrationConfirmationFido2 | RegistrationConfirmationKey | RegistrationConfirmationTotp;
|
|
546
|
+
export type AuthenticateUserFirstFactor = AuthenticateUserPasswordInput | AuthenticateUserFido2Input | AuthenticateUserKeyInput;
|
|
547
|
+
export type AuthenticateUserSecondFactor = AuthenticateUserFido2Input | AuthenticateUserKeyInput | AuthenticateUserTotpInput;
|
|
548
|
+
export type AuthIdentity = OrgEmployeeIdentity | OrgApiKeyIdentity | DfnsStaffIdentity | DfnsServiceIdentity;
|
|
549
|
+
export declare enum CredentialKind {
|
|
550
|
+
Fido2 = "Fido2",
|
|
551
|
+
Key = "Key",
|
|
552
|
+
Password = "Password",
|
|
553
|
+
Totp = "Totp",
|
|
554
|
+
RecoveryKey = "RecoveryKey"
|
|
555
|
+
}
|
|
556
|
+
export declare enum UserKind {
|
|
557
|
+
CustomerEmployee = "CustomerEmployee",
|
|
558
|
+
DfnsStaff = "DfnsStaff",
|
|
559
|
+
EndUser = "EndUser",
|
|
560
|
+
Pat = "Pat",
|
|
561
|
+
Application = "Application",
|
|
562
|
+
ServiceAccount = "ServiceAccount"
|
|
563
|
+
}
|
|
564
|
+
export declare enum AuthenticatorRequirementOptions {
|
|
565
|
+
required = "required",
|
|
566
|
+
preferred = "preferred",
|
|
567
|
+
discouraged = "discouraged"
|
|
568
|
+
}
|
|
569
|
+
export declare enum AuthenticatorAttestationOptions {
|
|
570
|
+
none = "none",
|
|
571
|
+
indirect = "indirect",
|
|
572
|
+
direct = "direct",
|
|
573
|
+
enterprise = "enterprise"
|
|
574
|
+
}
|
|
575
|
+
export declare enum ApplicationKind {
|
|
576
|
+
ServerSideApplication = "ServerSideApplication",
|
|
577
|
+
ClientSideApplication = "ClientSideApplication"
|
|
578
|
+
}
|
|
579
|
+
export declare enum FidoCredentialsTransportKind {
|
|
580
|
+
usb = "usb",
|
|
581
|
+
nfc = "nfc",
|
|
582
|
+
ble = "ble",
|
|
583
|
+
internal = "internal",
|
|
584
|
+
hybrid = "hybrid"
|
|
585
|
+
}
|
|
586
|
+
export declare enum CredentialFactor {
|
|
587
|
+
first = "first",
|
|
588
|
+
second = "second",
|
|
589
|
+
either = "either"
|
|
590
|
+
}
|
|
591
|
+
export declare enum ServerKind {
|
|
592
|
+
Api = "Api",
|
|
593
|
+
Staff = "Staff"
|
|
594
|
+
}
|
|
595
|
+
export declare enum AccessTokenKind {
|
|
596
|
+
ServiceAccount = "ServiceAccount",
|
|
597
|
+
Pat = "Pat",
|
|
598
|
+
Application = "Application"
|
|
599
|
+
}
|
|
600
|
+
export declare enum UserAuthKind {
|
|
601
|
+
EndUser = "EndUser",
|
|
602
|
+
CustomerEmployee = "CustomerEmployee",
|
|
603
|
+
DfnsStaff = "DfnsStaff"
|
|
604
|
+
}
|
|
605
|
+
export declare enum AuthIdentityKind {
|
|
606
|
+
DfnsStaffIdentity = "DfnsStaffIdentity",
|
|
607
|
+
OrgEmployeeIdentity = "OrgEmployeeIdentity",
|
|
608
|
+
OrgApiKeyIdentity = "OrgApiKeyIdentity",
|
|
609
|
+
DfnsService = "DfnsService"
|
|
610
|
+
}
|