-
Notifications
You must be signed in to change notification settings - Fork 3
feat: Add bulk import APIs #90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
9614107
feat: Add bulk import APIs
anku255 0aa771c
fix: PR changes
anku255 8382362
fix: PR changes
anku255 fd7a725
fix: update path for deleteBulkImportUsers
anku255 2553c0c
fix: update api docs to latest implementation
tamassoltesz 57ee6da
Merge branch '5.3' into feat/bulk-import
porcellus 0dd7f36
chore: fix merge issues
porcellus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,7 +7,7 @@ info: | |
|
|
||
| Those that do not have `<tenantId>` in the path will enforce that the API is called from `public` tenant only. | ||
|
|
||
| version: 5.0.0 | ||
| version: 5.1.0 | ||
| title: Core Driver Interface | ||
| contact: | ||
| email: [email protected] | ||
|
|
@@ -25,6 +25,8 @@ tags: | |
| - name: Dashboard Recipe | ||
| - name: Totp Recipe | ||
| - name: Account Linking Recipe | ||
| - name: JWT Recipe | ||
| - name: Bulk Import | ||
|
|
||
| paths: | ||
| /appid-<appId>/recipe/accountlinking/user/primary/check: | ||
|
|
@@ -2062,11 +2064,9 @@ paths: | |
| email: | ||
| $ref: '#/components/schemas/email' | ||
| passwordHash: | ||
| type: string | ||
| example: "passwordHash" | ||
| $ref: '#/components/schemas/passwordHash' | ||
| hashingAlgorithm: | ||
| type: string | ||
| enum: ["argon2", "bcrypt", "firebase_scrypt"] | ||
| $ref: '#/components/schemas/hashingAlgorithm' | ||
|
|
||
|
|
||
| responses: | ||
|
|
@@ -5950,6 +5950,167 @@ paths: | |
| '500': | ||
| $ref: '#/components/responses/500' | ||
|
|
||
| /appid-<appId>/bulk-import/users: | ||
| get: | ||
| tags: | ||
| - Bulk Import | ||
| operationId: getBulkImportUsers | ||
| description: | | ||
| Paginated API to get bulk import users | ||
| parameters: | ||
| - $ref: '#/components/parameters/api-key' | ||
| - $ref: '#/components/parameters/cdi-version' | ||
| - $ref: '#/components/parameters/paginationToken' | ||
| - $ref: '#/components/parameters/limit' | ||
| - $ref: '#/components/parameters/bulkImportUserStatus' | ||
|
|
||
| responses: | ||
| '200': | ||
| description: Paginated Bulk Import Users | ||
| content: | ||
| application/json: | ||
| schema: | ||
| type: object | ||
| properties: | ||
| status: | ||
| $ref: '#/components/schemas/statusOK' | ||
| users: | ||
| type: array | ||
| items: | ||
| $ref: '#/components/schemas/bulkImportUserResponse' | ||
| nextPaginationToken: | ||
| $ref: '#/components/schemas/paginationToken' | ||
| '400': | ||
| $ref: '#/components/responses/400' | ||
|
|
||
| '401': | ||
| $ref: '#/components/responses/401' | ||
|
|
||
| '404': | ||
| $ref: '#/components/responses/404' | ||
|
|
||
| '500': | ||
| $ref: '#/components/responses/500' | ||
|
|
||
| post: | ||
| tags: | ||
| - Bulk Import | ||
| operationId: addBulkImportUsers | ||
| description: | | ||
| Add users for bulk import. Maximum 10000 users can be added in one request. | ||
| parameters: | ||
| - $ref: '#/components/parameters/api-key' | ||
| - $ref: '#/components/parameters/cdi-version' | ||
| requestBody: | ||
| content: | ||
| application/json: | ||
| schema: | ||
| type: object | ||
| properties: | ||
| users: | ||
| type: array | ||
| items: | ||
| $ref: '#/components/schemas/bulkImportUser' | ||
| required: | ||
| - users | ||
| responses: | ||
| '200': | ||
| description: Bulk Import Users added successfully | ||
| content: | ||
| application/json: | ||
| schema: | ||
| type: object | ||
| properties: | ||
| status: | ||
| $ref: '#/components/schemas/statusOK' | ||
| '400': | ||
| description: One or more users have invalid schema | ||
| content: | ||
| application/json: | ||
| schema: | ||
| type: object | ||
| properties: | ||
| error: | ||
| type: string | ||
| example: "Data has missing or invalid fields. Please check the users field for more details." | ||
| users: | ||
| type: array | ||
| items: | ||
| type: object | ||
| properties: | ||
| index: | ||
| type: number | ||
| example: 0 | ||
| description: "Index of the user in the users array that has invalid schema" | ||
| errors: | ||
| type: array | ||
| items: | ||
| type: string | ||
| description: "List of errors for the user" | ||
| example: "Invalid recipeId for loginMethod. Pass one of emailpassword, thirdparty or, passwordless!" | ||
|
|
||
| '401': | ||
| $ref: '#/components/responses/401' | ||
|
|
||
| '404': | ||
| $ref: '#/components/responses/404' | ||
|
|
||
| '500': | ||
| $ref: '#/components/responses/500' | ||
|
|
||
| delete: | ||
| tags: | ||
| - Bulk Import | ||
| operationId: deleteBulkImportUsers | ||
| description: | | ||
| Delete bulk import users by id. Multiple ids can be passed in the request body. | ||
| parameters: | ||
| - $ref: '#/components/parameters/api-key' | ||
| - $ref: '#/components/parameters/cdi-version' | ||
| requestBody: | ||
| content: | ||
| application/json: | ||
| schema: | ||
| type: object | ||
| properties: | ||
| ids: | ||
| type: array | ||
| description: List of bulk import user ids to be deleted | ||
| items: | ||
| $ref: '#/components/schemas/bulkImportUserId' | ||
| required: | ||
| - ids | ||
| responses: | ||
| '200': | ||
| description: Bulk Import Users deleted successfully | ||
| content: | ||
| application/json: | ||
| schema: | ||
| type: object | ||
| properties: | ||
| deletedIds: | ||
| type: array | ||
| description: List of ids that were successfully deleted | ||
| items: | ||
| $ref: '#/components/schemas/bulkImportUserId' | ||
| invalidIds: | ||
| type: array | ||
| description: List of ids that were invalid | ||
| items: | ||
| $ref: '#/components/schemas/bulkImportUserId' | ||
| example: [] | ||
|
|
||
| '400': | ||
| $ref: '#/components/responses/400' | ||
|
|
||
| '401': | ||
| $ref: '#/components/responses/401' | ||
|
|
||
| '404': | ||
| $ref: '#/components/responses/404' | ||
|
|
||
| '500': | ||
| $ref: '#/components/responses/500' | ||
|
|
||
| components: | ||
| parameters: | ||
|
|
@@ -6144,6 +6305,11 @@ components: | |
| type: string | ||
| example: val1,val2,val3.. | ||
|
|
||
| bulkImportUserStatus: | ||
| name: status | ||
| in: query | ||
| schema: | ||
| $ref: '#/components/schemas/bulkImportUserStatus' | ||
|
|
||
| responses: | ||
| 500: | ||
|
|
@@ -6701,3 +6867,148 @@ components: | |
| $ref: '#/components/schemas/requiredSecondaryFactors' | ||
| coreConfig: | ||
| type: object | ||
|
|
||
| passwordHash: | ||
| type: string | ||
| example: "$argon2d$v=19$m=12,t=3,p=1$aGI4enNvMmd0Zm0wMDAwMA$r6p7qbr6HD+8CD7sBi4HVw" | ||
| hashingAlgorithm: | ||
| type: string | ||
| enum: ["argon2", "bcrypt", "firebase_scrypt"] | ||
|
|
||
| bulkImportUserId: | ||
| type: string | ||
| example: "fa7a0841-b533-4478-9253-0fde890c576" | ||
|
|
||
| bulkImportUserStatus: | ||
| type: string | ||
| enum: ["NEW", "PROCESSING", "FAILED"] | ||
|
|
||
| bulkImportUserRole: | ||
| type: object | ||
| properties: | ||
| role: | ||
| $ref: '#/components/schemas/role' | ||
| tenantIds: | ||
| type: array | ||
| items: | ||
| $ref: '#/components/schemas/tenantId' | ||
| required: | ||
| - role | ||
| - tenantIds | ||
|
|
||
| bulkImportTotpDevice: | ||
| type: object | ||
| properties: | ||
| secretKey: | ||
| type: string | ||
| example: "2PRXZWZAYYDAWCD" | ||
| skew: | ||
| type: number | ||
| example: 0 | ||
| period: | ||
| type: number | ||
| example: 30 | ||
| deviceName: | ||
| type: string | ||
| example: "My Authy App" | ||
| required: | ||
| - secretKey | ||
|
|
||
| bulkImportUserLoginMethodFields: | ||
| type: object | ||
| properties: | ||
| tenantIds: | ||
| type: array | ||
| description: List of tenant IDs this login method is associated with | ||
| items: | ||
| $ref: '#/components/schemas/tenantId' | ||
| isVerified: | ||
| type: boolean | ||
| description: Indicates whether the email is verified | ||
| isPrimary: | ||
| type: boolean | ||
| description: Indicates whether the login method is the primary login method | ||
| timeJoinedInMSSinceEpoch: | ||
| type: integer | ||
| description: Time joined in milliseconds since the epoch | ||
|
|
||
| bulkImportUserEmailPasswordLoginMethod: | ||
| allOf: | ||
| - $ref: '#/components/schemas/bulkImportUserLoginMethodFields' | ||
| - type: object | ||
| properties: | ||
| email: | ||
| $ref: '#/components/schemas/email' | ||
| passwordHash: | ||
| $ref: '#/components/schemas/passwordHash' | ||
| hashingAlgorithm: | ||
| $ref: '#/components/schemas/hashingAlgorithm' | ||
| required: | ||
| - passwordHash | ||
| - hashingAlgorithm | ||
|
|
||
| bulkImportUserThirdPartyLoginMethod: | ||
| allOf: | ||
| - $ref: '#/components/schemas/bulkImportUserLoginMethodFields' | ||
| - type: object | ||
| properties: | ||
| thirdPartyId: | ||
| $ref: '#/components/schemas/thirdPartyId' | ||
| thirdPartyUserId: | ||
| $ref: '#/components/schemas/thirdPartyUserId' | ||
| required: | ||
| - thirdPartyId | ||
| - thirdPartyUserId | ||
|
|
||
| bulkImportUserPasswordlessLoginMethod: | ||
| allOf: | ||
| - $ref: '#/components/schemas/bulkImportUserLoginMethodFields' | ||
| - type: object | ||
| properties: | ||
| email: | ||
| $ref: '#/components/schemas/email' | ||
| phoneNumber: | ||
| $ref: '#/components/schemas/phoneNumber' | ||
| oneOf: | ||
| - required: ["email"] | ||
| - required: ["phoneNumber"] | ||
anku255 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| bulkImportUser: | ||
| type: object | ||
| properties: | ||
| externalUserId: | ||
| $ref: '#/components/schemas/userId' | ||
| userMetadata: | ||
| type: array | ||
| items: | ||
| $ref: '#/components/schemas/userMetadata' | ||
| userRoles: | ||
| type: array | ||
| items: | ||
| $ref: '#/components/schemas/bulkImportUserRole' | ||
| totpDevices: | ||
| type: array | ||
| items: | ||
| $ref: '#/components/schemas/bulkImportTotpDevice' | ||
| loginMethods: | ||
| type: array | ||
| items: | ||
| anyOf: | ||
| - $ref: '#/components/schemas/bulkImportUserEmailPasswordLoginMethod' | ||
| - $ref: '#/components/schemas/bulkImportUserThirdPartyLoginMethod' | ||
| - $ref: '#/components/schemas/bulkImportUserPasswordlessLoginMethod' | ||
|
|
||
| bulkImportUserResponse: | ||
| properties: | ||
| id: | ||
| $ref: '#/components/schemas/bulkImportUserId' | ||
| status: | ||
| $ref: '#/components/schemas/bulkImportUserStatus' | ||
| createdAt: | ||
| $ref: '#/components/schemas/timeJoined' | ||
| updatedAt: | ||
| $ref: '#/components/schemas/timeJoined' | ||
| allOf: | ||
| - $ref: '#/components/schemas/bulkImportUser' | ||
| - type: object | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.