-
Notifications
You must be signed in to change notification settings - Fork 937
/
Copy pathhanko.user_import.json
295 lines (295 loc) · 9.77 KB
/
hanko.user_import.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/teamhanko/hanko/backend/cmd/user/import-or-export-list",
"$ref": "#/$defs/ImportOrExportList",
"$defs": {
"Emails": {
"items": {
"$ref": "#/$defs/ImportOrExportEmail"
},
"type": "array",
"description": "Emails Array of email addresses"
},
"ImportOTPSecret": {
"properties": {
"secret": {
"type": "string",
"description": "Secret of the TOTP credential. TOTP credential must be generated for a period of 30 seconds and SHA1 hash algorithm."
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "CreatedAt optional timestamp when the otp secret was created. Will be set to the import date if not provided."
},
"updated_at": {
"type": "string",
"format": "date-time",
"description": "UpdatedAt optional timestamp of the last update to the otp secret. Will be set to the import date if not provided."
}
},
"additionalProperties": false,
"type": "object",
"required": [
"secret"
]
},
"ImportOrExportEmail": {
"properties": {
"address": {
"type": "string",
"format": "email",
"description": "Address Valid email address"
},
"is_primary": {
"type": "boolean",
"description": "IsPrimary indicates if this is the primary email of the users. In the Emails array there has to be exactly one primary email."
},
"is_verified": {
"type": "boolean",
"description": "IsVerified indicates if the email address was previously verified."
}
},
"additionalProperties": false,
"type": "object",
"required": [
"address",
"is_primary",
"is_verified"
],
"title": "ImportEmail",
"description": "ImportOrExportEmail The import/export format for a user's email"
},
"ImportOrExportEntry": {
"properties": {
"user_id": {
"type": "string",
"description": "UserID optional uuid.v4. If not provided a new one will be generated for the user"
},
"emails": {
"$ref": "#/$defs/Emails",
"type": "array",
"minItems": 1,
"description": "Emails optional list of emails"
},
"username": {
"type": "string",
"description": "Username optional username of the user"
},
"webauthn_credentials": {
"$ref": "#/$defs/ImportWebauthnCredentials",
"description": "WebauthnCredentials optional list of WebAuthn credentials of a user. Includes passkeys and MFA credentials."
},
"password": {
"$ref": "#/$defs/ImportPasswordCredential",
"description": "Password optional password."
},
"otp_secret": {
"$ref": "#/$defs/ImportOTPSecret",
"description": "OTPSecret optional TOTP secret for MFA."
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "CreatedAt optional timestamp of the users' creation. Will be set to the import date if not provided."
},
"updated_at": {
"type": "string",
"format": "date-time",
"description": "UpdatedAt optional timestamp of the last update to the user. Will be set to the import date if not provided."
}
},
"additionalProperties": false,
"type": "object",
"required": [
"emails",
"password",
"otp_secret"
],
"title": "ImportEntry",
"description": "ImportOrExportEntry represents a user to be imported/export to the Hanko database"
},
"ImportOrExportList": {
"items": {
"$ref": "#/$defs/ImportOrExportEntry"
},
"type": "array",
"description": "ImportOrExportList a list of ImportEntries",
"examples": [
[
{
"user_id": "a9ae6bc8-d829-43de-b672-f50230833877",
"emails": [
{
"address": "[email protected]",
"is_primary": true,
"is_verified": true
},
{
"address": "[email protected]",
"is_primary": false,
"is_verified": false
}
],
"password": null,
"otp_secret": null,
"created_at": "2024-08-17T12:05:15.651387237Z",
"updated_at": "2024-08-17T12:05:15.651387237Z"
},
{
"user_id": "2f0649cf-c71e-48a5-92c3-210addb80281",
"emails": [
{
"address": "[email protected]",
"is_primary": true,
"is_verified": true
},
{
"address": "[email protected]",
"is_primary": false,
"is_verified": false
}
],
"password": null,
"otp_secret": null,
"created_at": "2024-08-17T12:05:15.651387237Z",
"updated_at": "2024-08-17T12:05:15.651387237Z"
}
],
[
{
"emails": null,
"username": "example",
"password": {
"password": "$2a$12$mFbud0mLsD/q.WG7/9pNQemlAHs3H4o8zAv44gsUF1v1awsdqTh7.",
"created_at": "2024-08-17T12:05:15.651387237Z",
"updated_at": "2024-08-17T12:05:15.651387237Z"
},
"otp_secret": null
}
]
]
},
"ImportPasswordCredential": {
"properties": {
"password": {
"type": "string",
"description": "Password hash of the password in bcrypt format."
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "CreatedAt optional timestamp when the password was created. Will be set to the import date if not provided."
},
"updated_at": {
"type": "string",
"format": "date-time",
"description": "UpdatedAt optional timestamp of the last update to the password. Will be set to the import date if not provided."
}
},
"additionalProperties": false,
"type": "object",
"required": [
"password"
]
},
"ImportWebauthnCredential": {
"properties": {
"id": {
"type": "string",
"description": "ID of the WebAuthn credential."
},
"name": {
"type": "string",
"description": "Optional Name of the WebAuthn credential."
},
"public_key": {
"type": "string",
"description": "The PublicKey of the credential."
},
"attestation_type": {
"type": "string",
"description": "The AttestationType the credential was created with."
},
"aaguid": {
"$ref": "#/$defs/UUID",
"description": "Optional AAGUID of the authenticator on which the credential was created on."
},
"sign_count": {
"type": "integer",
"description": "Optional SignCount of the WebAuthn credential."
},
"last_used_at": {
"type": "string",
"format": "date-time",
"description": "LastUsedAt optional timestamp when the WebAuthn credential was last used."
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "CreatedAt optional timestamp of the WebAuthn credentials' creation. Will be set to the import date if not provided."
},
"updated_at": {
"type": "string",
"format": "date-time",
"description": "UpdatedAt optional timestamp of the last update to the WebAuthn credential. Will be set to the import date if not provided."
},
"transports": {
"items": {
"type": "string"
},
"type": "array",
"description": "Optional list of supported Transports by the authenticator."
},
"backup_eligible": {
"type": "boolean",
"description": "BackupEligible flag indicates if the WebAuthn credential can be backed up (e.g. in Apple KeyChain, ...). If the information is not available set it to false."
},
"backup_state": {
"type": "boolean",
"description": "BackupState flag indicates if the WebAuthn credential is backed up (e.g. in Apple KeyChain, ...). If the information is not available set it to false."
},
"mfa_only": {
"type": "boolean",
"description": "MFAOnly flag indicates if the WebAuthn credential can only be used in combination with another login factor (e.g. password, ...)."
},
"user_handle": {
"type": "string",
"description": "UserHandle optional user id which was used to create the credential with.\nPopulate only when user id was not an uuid v4 and the WebAuthn credential is not an MFAOnly credential."
}
},
"additionalProperties": false,
"type": "object",
"required": [
"id",
"name",
"public_key",
"attestation_type",
"aaguid",
"sign_count",
"last_used_at",
"created_at",
"updated_at",
"transports",
"backup_eligible",
"backup_state",
"mfa_only",
"user_handle"
]
},
"ImportWebauthnCredentials": {
"items": {
"$ref": "#/$defs/ImportWebauthnCredential"
},
"type": "array"
},
"UUID": {
"items": {
"type": "integer"
},
"type": "array",
"maxItems": 16,
"minItems": 16
}
},
"title": "User import"
}