From f3af6dcb659ccc07879bc1c28106a81394f88656 Mon Sep 17 00:00:00 2001 From: shreya-mishra Date: Wed, 17 May 2023 01:48:53 +0530 Subject: [PATCH 01/17] created the api contract of POST api call where we were authenticating user by user-id and device info --- qr-code-auth/README.md | 52 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 qr-code-auth/README.md diff --git a/qr-code-auth/README.md b/qr-code-auth/README.md new file mode 100644 index 0000000..8e1de25 --- /dev/null +++ b/qr-code-auth/README.md @@ -0,0 +1,52 @@ +# QrCodeAuth + +## Requests + +1. POST + +`/qr-code-auth?user-id=${user-id}&device-info={deviceInfo}` + +Description: Authenticates the user by verifying the user ID and device information. + +#### Request Body: + +``` +{ + "user_id": "", + "device_info": "" +} +``` + +#### Responses: + +``` +{ + "statusCode": 201, + "userDeviceInfoData: { + "user_id": "9", + "device_info": "window" + }, + "message": "User Device Info added successfully!" +} +``` + +``` +{ + "statusCode": 404, + "message": "Api not found." +} +``` + +``` +{ + "statusCode": 500, + "message": "Internal server error." +} +``` + + + + + + + From bee1b53d21824de078985a7e0fe729fbc4524d96 Mon Sep 17 00:00:00 2001 From: shreya-mishra Date: Sat, 3 Jun 2023 21:24:17 +0530 Subject: [PATCH 02/17] resolved comments --- qr-code-auth/README.md | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/qr-code-auth/README.md b/qr-code-auth/README.md index 8e1de25..798bb97 100644 --- a/qr-code-auth/README.md +++ b/qr-code-auth/README.md @@ -8,16 +8,24 @@ Description: Authenticates the user by verifying the user ID and device information. -#### Request Body: - -``` -{ +- **Params** + None +- **Query** + None + +- **Body** + ``` + { "user_id": "", "device_info": "" -} + } ``` +- **Headers** + None +- **Cookie** + None -#### Responses: +#### Success Response: ``` { @@ -29,7 +37,7 @@ Description: Authenticates the user by verifying the user ID and device informat "message": "User Device Info added successfully!" } ``` - +#### Error Responses ``` { "statusCode": 404, @@ -43,6 +51,14 @@ Description: Authenticates the user by verifying the user ID and device informat "message": "Internal server error." } ``` +``` +{ + "statusCode": 400, + "message": "Bad Request" +} +``` + + From a0c2d50dbe303da9693be6b96e41877df77fc80f Mon Sep 17 00:00:00 2001 From: shreya-mishra Date: Sat, 3 Jun 2023 21:25:27 +0530 Subject: [PATCH 03/17] extra lines are removed --- qr-code-auth/README.md | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/qr-code-auth/README.md b/qr-code-auth/README.md index 798bb97..f15f196 100644 --- a/qr-code-auth/README.md +++ b/qr-code-auth/README.md @@ -56,13 +56,4 @@ Description: Authenticates the user by verifying the user ID and device informat "statusCode": 400, "message": "Bad Request" } -``` - - - - - - - - - +``` \ No newline at end of file From 09bbd12ef85d000f95c5b086a1a7b91df8718035 Mon Sep 17 00:00:00 2001 From: Randhir Kumar Singh <97341921+heyrandhir@users.noreply.github.com> Date: Sun, 4 Jun 2023 07:33:14 +0530 Subject: [PATCH 04/17] readme md for qr-code-auth route --- qr-code-auth/README.md | 310 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 310 insertions(+) create mode 100644 qr-code-auth/README.md diff --git a/qr-code-auth/README.md b/qr-code-auth/README.md new file mode 100644 index 0000000..0ced9f2 --- /dev/null +++ b/qr-code-auth/README.md @@ -0,0 +1,310 @@ +# Collection - QrCodeAuth + +## API Endpoints + +| Route | Description | +| :--------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------: | +| [POST /qr-code-auth](#post-qr-code-auth) | Creates a new authentication document. | +| [GET /qr-code-auth](#get-qr-code-auth) | Retrieves all the authentication document belonging to a specified user | +| [PATCH /qr-code-auth](#patch-qr-code-authuser_iduser_idis_authorizedis_authorized) | Updates the is_authorized field of an existing qr-code-auth document for the specified user. | + +## POST /qr-code-auth + + Creates a new qr-code-auth document. + +- **Params** + None +- **Query** + None +- **Body** + - Attributes + - **user_id** (required, string): Specifies the user ID associated with the authentication document. + - **device_info** (required, string): Specifies the device information associated with the authentication authentication. + - **is_authorized** (required, boolean): Indicates whether the authentication document is authorized or not. + - **access_token** (required, string): Specifies the access token associated with the authentication document. +- **Headers** + - Content-Type: application/json +- **Cookie** + - rds-session: `` +- **Success Response:** + - **Code:** 201 + - **Content:** + ```json + { + "message": "String", + "data": { + "user_id": "String", + "device_info": "String", + "is_authorized": "Boolean", + "access_token": "String" + } + } + ``` +- **Error Response:** + + - **Code:** 400 + + - **Content:** + ```json + { + "message": "Bad Request" + } + ``` + + - **Code:** 401 + - **Content:** + ```json + { + "statusCode": 401, + "error": "Unauthorized", + "message": "Unauthenticated User." + } + ``` + - **Code:** 404 + - **Content:** + ```json + { + "message": "User with id <:user_id> does not exist." + } + ``` + - **Code:** 409 + - **Content:** + ```json + { + "message": "The authentication document has already been created" + } + ``` + - **Code:** 500 + - **Content:** + ```json + { + "message": "The server has encountered an unexpected error. Please contact the administrator for more information." + } + ``` + +- **Example for user authentication document creation request:** + POST /qr-code-auth
+ Content-Type: application/json
+ Request-Body:
+ + ```json + { + "user_id": "SooJK37gzjIZfFNH0tlL", + "device_info": "t5k77PHnuDSrgEzvMJAj", + "is_authorized": true, + "access_token": "NLFSj7Kz30oHgolfIZtJ" + } + ``` + + Response : + Status 201
+ Content-Type: application/json
+ + ```json + { + "data": { + "user_id": "SooJK37gzjIZfFNH0tlL", + "device_info": "t5k77PHnuDSrgEzvMJAj", + "is_authorized": true, + "access_token": "NLFSj7Kz30oHgolfIZtJ" + }, + "message": "authentication document created successfully." + } + ``` + +## GET /qr-code-auth + +Retrieves THE authentication document. + +- **Params** + None +- **Query** + + - user_id : Specifies the ID of the User whose authentication document will be retrieved + +- **Body** + None +- **Headers** + None +- **Cookie** + None +- **Success Response:** + + - **Code:** 200 + + - **Content:** + + ```json + { + "message": "String", + "count": "Number", + "data": [ + { + "user_id": "String", + "device_info": "String", + "is_authorized": "Boolean", + "access_token": "String" + } + ] + } + ``` + +- **Error Response:** + + - **Code:** 400 + + - **Content:** + ```json + { + "message": "Bad Request" + } + ``` + + - **Code:** 404 + - **Content:** + ```json + { + "message": "User with id <:id> does not exist." + } + ``` + - **Code:** 500 + - **Content:** + ```json + { + "message": "The server has encountered an unexpected error. Please contact the administrator for more information." + } + ``` + +- **Example:** + GET /qr-code-auth?user_id=SooJK37gzjIZfFNH0tlL
+ Status: 200 OK
+ ```json + { + "message": "Authentication document retrieved successfully.", + "count": 2, + "data": [ + { + "user_id": "SooJK37gzjIZfFNH0tlL", + "device_info": "t5k77PHnuDSrgEzvMJAj", + "is_authorized": true, + "access_token": "NLFSj7Kz30oHgolfIZtJ" + }, + { + "user_id": "SooJK37gzjIZfFNH0tlL", + "device_info": "en7nlNnpfqoqodcmtMeZ", + "is_authorized": false, + "access_token": "GTB4UUtlKwGemRN2lwBp11" + } + ] + } + ``` + GET /qr-code-auth?user_id=invalidUserId
+ Status: 404 Not Found
+ ```json + { + "message": "No Authentication authentication found." + } + ``` + GET /qr-code-auth?taskId=GTB4UUtlKwGemRN2lwBp11
+ Status: 400 Bad Request + ```json + { + "statusCode": 400, + "error": "Bad Request", + "message": "invalid query parameters passed" + } + ``` + GET /?user_id=GTB4UUtlKwGemRN2lwBp11 + Status: 500 Internal Server Error + ```json + { + "message": "The server has encountered an unexpected error. Please contact the administrator for more information." + } + ``` + +Sure, here's the updated API contract for the PATCH call: + +## PATCH /qr-code-auth/user_id/{user_id}/is_authorized/{is_authorized} + +Updates the is_authorized field of an existing qr-code-auth document for the specified user. + +- **Params** + - **user_id** (required, string): Specifies the user ID associated with the authentication document. + - **is_authorized** (required, boolean): Specifies whether the authentication document is authorized or not. +- **Query** + None +- **Headers** + Content-Type: application/json +- **Cookie** + rds-session: `` +- **Success Response:** + - **Code:** 200 + - **Content:** + ```json + { + "message": "String", + "data": { + "user_id": "String", + "device_info": "String", + "is_authorized": "Boolean", + "access_token": "String" + } + } + ``` +- **Error Response:** + + - **Code:** 400 + + - **Content:** + ```json + { + "message": "Bad Request" + } + ``` + + - **Code:** 401 + - **Content:** + ```json + { + "statusCode": 401, + "error": "Unauthorized", + "message": "Unauthenticated User." + } + ``` + - **Code:** 404 + - **Content:** + ```json + { + "message": "Document not found" + } + ``` + - **Code:** 500 + - **Content:** + ```json + { + "message": "The server has encountered an unexpected error. Please contact the administrator for more information." + } + ``` + +- **Example for updating an existing authentication document:** + PATCH /qr-code-auth/user_id/SooJK37gzjIZfFNH0tlL/is_authorized/true
+ Content-Type: application/json
+ Request-Body:
+ + None + + Response : + Status 200 OK
+ Content-Type: application/json
+ + ```json + { + "data": { + "user_id": "SooJK37gzjIZfFNH0tlL", + "device_info": "t5k77PHnuDSrgEzvMJAj", + "is_authorized": true, + "access_token": "NLFSj7Kz30oHgolfIZtJ" + }, + "message": "Authentication document for user SooJK37gzjIZfFNH0tlL updated successfully." + } + ``` From dda102e8f0398b0031fe4f6d7540135c82581c02 Mon Sep 17 00:00:00 2001 From: Randhir Kumar Singh <97341921+heyrandhir@users.noreply.github.com> Date: Tue, 6 Jun 2023 06:46:10 +0530 Subject: [PATCH 05/17] modify the GET Response --- qr-code-auth/README.md | 38 +++++++++++++------------------------- 1 file changed, 13 insertions(+), 25 deletions(-) diff --git a/qr-code-auth/README.md b/qr-code-auth/README.md index 9fe5991..5d579a5 100644 --- a/qr-code-auth/README.md +++ b/qr-code-auth/README.md @@ -137,15 +137,12 @@ Retrieves THE authentication document. ```json { "message": "String", - "count": "Number", - "data": [ - { - "user_id": "String", - "device_info": "String", - "is_authorized": "Boolean", - "access_token": "String" - } - ] + "data": { + "user_id": "String", + "device_info": "String", + "is_authorized": "Boolean", + "access_token": "String" + } } ``` @@ -181,21 +178,12 @@ Retrieves THE authentication document. ```json { "message": "Authentication document retrieved successfully.", - "count": 2, - "data": [ - { - "user_id": "SooJK37gzjIZfFNH0tlL", - "device_info": "t5k77PHnuDSrgEzvMJAj", - "is_authorized": true, - "access_token": "NLFSj7Kz30oHgolfIZtJ" - }, - { - "user_id": "SooJK37gzjIZfFNH0tlL", - "device_info": "en7nlNnpfqoqodcmtMeZ", - "is_authorized": false, - "access_token": "GTB4UUtlKwGemRN2lwBp11" - } - ] + "data": { + "user_id": "SooJK37gzjIZfFNH0tlL", + "device_info": "t5k77PHnuDSrgEzvMJAj", + "is_authorized": true, + "access_token": "NLFSj7Kz30oHgolfIZtJ" + } } ``` GET /qr-code-auth?user_id=invalidUserId
@@ -307,4 +295,4 @@ Updates the is_authorized field of an existing qr-code-auth document for the spe }, "message": "Authentication document for user SooJK37gzjIZfFNH0tlL updated successfully." } - ``` \ No newline at end of file + ``` From b7cd2fb060a7b10b9c34f98b10ed95a2ad2c5fbe Mon Sep 17 00:00:00 2001 From: Randhir Kumar Singh <97341921+heyrandhir@users.noreply.github.com> Date: Tue, 6 Jun 2023 06:56:55 +0530 Subject: [PATCH 06/17] remove user_id from req body and path params --- qr-code-auth/README.md | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/qr-code-auth/README.md b/qr-code-auth/README.md index 5d579a5..557d6e4 100644 --- a/qr-code-auth/README.md +++ b/qr-code-auth/README.md @@ -18,7 +18,6 @@ None - **Body** - Attributes - - **user_id** (required, string): Specifies the user ID associated with the authentication document. - **device_info** (required, string): Specifies the device information associated with the authentication authentication. - **is_authorized** (required, boolean): Indicates whether the authentication document is authorized or not. - **access_token** (required, string): Specifies the access token associated with the authentication document. @@ -60,13 +59,6 @@ "message": "Unauthenticated User." } ``` - - **Code:** 404 - - **Content:** - ```json - { - "message": "User with id <:user_id> does not exist." - } - ``` - **Code:** 409 - **Content:** ```json @@ -89,7 +81,6 @@ ```json { - "user_id": "SooJK37gzjIZfFNH0tlL", "device_info": "t5k77PHnuDSrgEzvMJAj", "is_authorized": true, "access_token": "NLFSj7Kz30oHgolfIZtJ" @@ -212,12 +203,11 @@ Retrieves THE authentication document. Sure, here's the updated API contract for the PATCH call: -## PATCH /qr-code-auth/user_id/{user_id}/is_authorized/{is_authorized} +## PATCH /qr-code-auth/is_authorized/{is_authorized} Updates the is_authorized field of an existing qr-code-auth document for the specified user. - **Params** - - **user_id** (required, string): Specifies the user ID associated with the authentication document. - **is_authorized** (required, boolean): Specifies whether the authentication document is authorized or not. - **Query** None @@ -275,12 +265,10 @@ Updates the is_authorized field of an existing qr-code-auth document for the spe ``` - **Example for updating an existing authentication document:** - PATCH /qr-code-auth/user_id/SooJK37gzjIZfFNH0tlL/is_authorized/true
+ PATCH /qr-code-auth/is_authorized/true
Content-Type: application/json
Request-Body:
- None - Response : Status 200 OK
Content-Type: application/json
From d887ad3d7f01d5d2028b5ed833ed5e722f6fc7ea Mon Sep 17 00:00:00 2001 From: Randhir Kumar Singh <97341921+heyrandhir@users.noreply.github.com> Date: Wed, 7 Jun 2023 06:05:17 +0530 Subject: [PATCH 07/17] updated as per discussion with @sakshambhatt & @shreya-mishra --- qr-code-auth/README.md | 35 +++++++++++++---------------------- 1 file changed, 13 insertions(+), 22 deletions(-) diff --git a/qr-code-auth/README.md b/qr-code-auth/README.md index 557d6e4..13302f5 100644 --- a/qr-code-auth/README.md +++ b/qr-code-auth/README.md @@ -18,13 +18,12 @@ None - **Body** - Attributes + - **user_id** (required, string): Specifies the user id for the document. - **device_info** (required, string): Specifies the device information associated with the authentication authentication. - - **is_authorized** (required, boolean): Indicates whether the authentication document is authorized or not. - - **access_token** (required, string): Specifies the access token associated with the authentication document. - **Headers** - Content-Type: application/json - **Cookie** - - rds-session: `` + None - **Success Response:** - **Code:** 201 - **Content:** @@ -34,7 +33,7 @@ "data": { "user_id": "String", "device_info": "String", - "is_authorized": "Boolean", + "is_authorized": "String", "access_token": "String" } } @@ -50,22 +49,15 @@ } ``` - - **Code:** 401 - - **Content:** - ```json - { - "statusCode": 401, - "error": "Unauthorized", - "message": "Unauthenticated User." - } - ``` - **Code:** 409 + - **Content:** ```json { "message": "The authentication document has already been created" } ``` + - **Code:** 500 - **Content:** ```json @@ -82,8 +74,7 @@ ```json { "device_info": "t5k77PHnuDSrgEzvMJAj", - "is_authorized": true, - "access_token": "NLFSj7Kz30oHgolfIZtJ" + "user_id": "NLFSj7Kz30oHgolfIZtJ" } ``` @@ -96,8 +87,8 @@ "data": { "user_id": "SooJK37gzjIZfFNH0tlL", "device_info": "t5k77PHnuDSrgEzvMJAj", - "is_authorized": true, - "access_token": "NLFSj7Kz30oHgolfIZtJ" + "is_authorized": "", + "access_token": "" }, "message": "authentication document created successfully." } @@ -131,7 +122,7 @@ Retrieves THE authentication document. "data": { "user_id": "String", "device_info": "String", - "is_authorized": "Boolean", + "is_authorized": "String", "access_token": "String" } } @@ -172,8 +163,8 @@ Retrieves THE authentication document. "data": { "user_id": "SooJK37gzjIZfFNH0tlL", "device_info": "t5k77PHnuDSrgEzvMJAj", - "is_authorized": true, - "access_token": "NLFSj7Kz30oHgolfIZtJ" + "is_authorized": "", + "access_token": "" } } ``` @@ -224,7 +215,7 @@ Updates the is_authorized field of an existing qr-code-auth document for the spe "data": { "user_id": "String", "device_info": "String", - "is_authorized": "Boolean", + "is_authorized": "String", "access_token": "String" } } @@ -278,7 +269,7 @@ Updates the is_authorized field of an existing qr-code-auth document for the spe "data": { "user_id": "SooJK37gzjIZfFNH0tlL", "device_info": "t5k77PHnuDSrgEzvMJAj", - "is_authorized": true, + "is_authorized": "yes", "access_token": "NLFSj7Kz30oHgolfIZtJ" }, "message": "Authentication document for user SooJK37gzjIZfFNH0tlL updated successfully." From 6c24bee74d81ec2987bfadb6e974dc6f83f13476 Mon Sep 17 00:00:00 2001 From: Randhir Kumar Singh <97341921+heyrandhir@users.noreply.github.com> Date: Thu, 8 Jun 2023 09:07:29 +0530 Subject: [PATCH 08/17] typo fix --- qr-code-auth/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qr-code-auth/README.md b/qr-code-auth/README.md index 13302f5..59c6f68 100644 --- a/qr-code-auth/README.md +++ b/qr-code-auth/README.md @@ -19,7 +19,7 @@ - **Body** - Attributes - **user_id** (required, string): Specifies the user id for the document. - - **device_info** (required, string): Specifies the device information associated with the authentication authentication. + - **device_info** (required, string): Specifies the device information associated with the authentication. - **Headers** - Content-Type: application/json - **Cookie** From abc52c9502a729fc2151e3860b4a3af1855ef916 Mon Sep 17 00:00:00 2001 From: Randhir Kumar Singh <97341921+heyrandhir@users.noreply.github.com> Date: Thu, 8 Jun 2023 22:27:32 +0530 Subject: [PATCH 09/17] changes is_authorized to authorization_status with the possible enum values --- qr-code-auth/README.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/qr-code-auth/README.md b/qr-code-auth/README.md index 59c6f68..3c94879 100644 --- a/qr-code-auth/README.md +++ b/qr-code-auth/README.md @@ -6,7 +6,7 @@ | :--------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------: | | [POST /qr-code-auth](#post-qr-code-auth) | Creates a new authentication document. | | [GET /qr-code-auth](#get-qr-code-auth) | Retrieves all the authentication document belonging to a specified user | -| [PATCH /qr-code-auth](#patch-qr-code-authuser_iduser_idis_authorizedis_authorized) | Updates the is_authorized field of an existing qr-code-auth document for the specified user. | +| [PATCH /qr-code-auth](#patch-qr-code-authauthorization_statusauthorization_status) | Updates the authorization_status field of an existing qr-code-auth document for the specified user. | ## POST /qr-code-auth @@ -33,7 +33,7 @@ "data": { "user_id": "String", "device_info": "String", - "is_authorized": "String", + "authorization_status": "String", "access_token": "String" } } @@ -87,7 +87,7 @@ "data": { "user_id": "SooJK37gzjIZfFNH0tlL", "device_info": "t5k77PHnuDSrgEzvMJAj", - "is_authorized": "", + "authorization_status": "NOT_INIT", "access_token": "" }, "message": "authentication document created successfully." @@ -122,7 +122,7 @@ Retrieves THE authentication document. "data": { "user_id": "String", "device_info": "String", - "is_authorized": "String", + "authorization_status": "String", "access_token": "String" } } @@ -163,7 +163,7 @@ Retrieves THE authentication document. "data": { "user_id": "SooJK37gzjIZfFNH0tlL", "device_info": "t5k77PHnuDSrgEzvMJAj", - "is_authorized": "", + "authorization_status": "NOT_INIT", "access_token": "" } } @@ -194,12 +194,12 @@ Retrieves THE authentication document. Sure, here's the updated API contract for the PATCH call: -## PATCH /qr-code-auth/is_authorized/{is_authorized} +## PATCH /qr-code-auth/authorization_status/{authorization_status} -Updates the is_authorized field of an existing qr-code-auth document for the specified user. +Updates the authorization_status field of an existing qr-code-auth document for the specified user. - **Params** - - **is_authorized** (required, boolean): Specifies whether the authentication document is authorized or not. + - **authorization_status** (required, string): Specifies the authorization status of the user. The possible values are "NOT_INIT" , "AUTHORIZED" , "REJECTED". The default value will be "NOT_INIT" - **Query** None - **Headers** @@ -215,7 +215,7 @@ Updates the is_authorized field of an existing qr-code-auth document for the spe "data": { "user_id": "String", "device_info": "String", - "is_authorized": "String", + "authorization_status": "String", "access_token": "String" } } @@ -256,7 +256,7 @@ Updates the is_authorized field of an existing qr-code-auth document for the spe ``` - **Example for updating an existing authentication document:** - PATCH /qr-code-auth/is_authorized/true
+ PATCH /qr-code-auth/authorization_status/AUTHORIZED
Content-Type: application/json
Request-Body:
None @@ -269,7 +269,7 @@ Updates the is_authorized field of an existing qr-code-auth document for the spe "data": { "user_id": "SooJK37gzjIZfFNH0tlL", "device_info": "t5k77PHnuDSrgEzvMJAj", - "is_authorized": "yes", + "authorization_status": "AUTHORIZED", "access_token": "NLFSj7Kz30oHgolfIZtJ" }, "message": "Authentication document for user SooJK37gzjIZfFNH0tlL updated successfully." From 973667479452eede237f67bf2ec4dcff28709dfd Mon Sep 17 00:00:00 2001 From: Randhir Kumar Singh <97341921+heyrandhir@users.noreply.github.com> Date: Sun, 11 Jun 2023 15:18:34 +0530 Subject: [PATCH 10/17] resolve comments by @isVivek99 on the PR --- qr-code-auth/README.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/qr-code-auth/README.md b/qr-code-auth/README.md index 3c94879..2962b32 100644 --- a/qr-code-auth/README.md +++ b/qr-code-auth/README.md @@ -4,11 +4,11 @@ | Route | Description | | :--------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------: | -| [POST /qr-code-auth](#post-qr-code-auth) | Creates a new authentication document. | -| [GET /qr-code-auth](#get-qr-code-auth) | Retrieves all the authentication document belonging to a specified user | -| [PATCH /qr-code-auth](#patch-qr-code-authauthorization_statusauthorization_status) | Updates the authorization_status field of an existing qr-code-auth document for the specified user. | +| [POST /auth/qr-code-auth](#post-authqr-code-auth) | Creates a new authentication document. | +| [GET /auth/qr-code-auth](#get-authqr-code-auth) | Retrieves all the authentication document belonging to a specified user | +| [PATCH /auth/qr-code-auth](#patch-authqr-code-authauthorization_statusauthorization_status) | Updates the authorization_status field of an existing qr-code-auth document for the specified user. | -## POST /qr-code-auth +## POST /auth/qr-code-auth Creates a new qr-code-auth document. @@ -67,7 +67,7 @@ ``` - **Example for user authentication document creation request:** - POST /qr-code-auth
+ POST /auth/qr-code-auth
Content-Type: application/json
Request-Body:
@@ -94,7 +94,7 @@ } ``` -## GET /qr-code-auth +## GET /auth/qr-code-auth Retrieves THE authentication document. @@ -155,7 +155,7 @@ Retrieves THE authentication document. ``` - **Example:** - GET /qr-code-auth?user_id=SooJK37gzjIZfFNH0tlL
+ GET /auth/qr-code-auth?user_id=SooJK37gzjIZfFNH0tlL
Status: 200 OK
```json { @@ -168,14 +168,14 @@ Retrieves THE authentication document. } } ``` - GET /qr-code-auth?user_id=invalidUserId
+ GET /auth/qr-code-auth?user_id=invalidUserId
Status: 404 Not Found
```json { "message": "No Authentication authentication found." } ``` - GET /qr-code-auth?taskId=GTB4UUtlKwGemRN2lwBp11
+ GET /auth/qr-code-auth?taskId=GTB4UUtlKwGemRN2lwBp11
Status: 400 Bad Request ```json { @@ -194,7 +194,7 @@ Retrieves THE authentication document. Sure, here's the updated API contract for the PATCH call: -## PATCH /qr-code-auth/authorization_status/{authorization_status} +## PATCH /auth/qr-code-auth/authorization_status/{authorization_status} Updates the authorization_status field of an existing qr-code-auth document for the specified user. @@ -256,7 +256,7 @@ Updates the authorization_status field of an existing qr-code-auth document for ``` - **Example for updating an existing authentication document:** - PATCH /qr-code-auth/authorization_status/AUTHORIZED
+ PATCH /auth/qr-code-auth/authorization_status/AUTHORIZED
Content-Type: application/json
Request-Body:
None From 9f4b4de0fbf9276eecc77614f53c57484ac794e1 Mon Sep 17 00:00:00 2001 From: Randhir Kumar Singh <97341921+heyrandhir@users.noreply.github.com> Date: Sun, 11 Jun 2023 22:41:03 +0530 Subject: [PATCH 11/17] remove the unwanted line --- qr-code-auth/README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/qr-code-auth/README.md b/qr-code-auth/README.md index 2962b32..aa45879 100644 --- a/qr-code-auth/README.md +++ b/qr-code-auth/README.md @@ -192,8 +192,6 @@ Retrieves THE authentication document. } ``` -Sure, here's the updated API contract for the PATCH call: - ## PATCH /auth/qr-code-auth/authorization_status/{authorization_status} Updates the authorization_status field of an existing qr-code-auth document for the specified user. From c4a1658b2cff3500bbf985a960b59afa3040bd1b Mon Sep 17 00:00:00 2001 From: shreya-mishra Date: Fri, 16 Jun 2023 20:43:23 +0530 Subject: [PATCH 12/17] updated the device_id as discussed --- qr-code-auth/README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qr-code-auth/README.md b/qr-code-auth/README.md index aa45879..6e6bf24 100644 --- a/qr-code-auth/README.md +++ b/qr-code-auth/README.md @@ -104,6 +104,7 @@ Retrieves THE authentication document. - user_id : Specifies the ID of the User whose authentication document will be retrieved + - device_id : Specifies the ID of the User' device whose device id will be unique. - **Body** None - **Headers** @@ -121,6 +122,7 @@ Retrieves THE authentication document. "message": "String", "data": { "user_id": "String", + "device_id": "String", "device_info": "String", "authorization_status": "String", "access_token": "String" @@ -155,7 +157,7 @@ Retrieves THE authentication document. ``` - **Example:** - GET /auth/qr-code-auth?user_id=SooJK37gzjIZfFNH0tlL
+ GET /auth/qr-code-auth?user_id=SooJK37gzjIZfFNH0tlL&device_id=3ioui23u29sjkdnsjkndsk
Status: 200 OK
```json { @@ -163,6 +165,7 @@ Retrieves THE authentication document. "data": { "user_id": "SooJK37gzjIZfFNH0tlL", "device_info": "t5k77PHnuDSrgEzvMJAj", + "device_id":"3ioui23u29sjkdnsjkndsk", "authorization_status": "NOT_INIT", "access_token": "" } From 501c5d5cbdc4dce733e7ab6bafb268186c741926 Mon Sep 17 00:00:00 2001 From: shreya-mishra Date: Fri, 16 Jun 2023 20:52:01 +0530 Subject: [PATCH 13/17] added other params as well --- qr-code-auth/README.md | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/qr-code-auth/README.md b/qr-code-auth/README.md index 6e6bf24..8060c36 100644 --- a/qr-code-auth/README.md +++ b/qr-code-auth/README.md @@ -171,14 +171,14 @@ Retrieves THE authentication document. } } ``` - GET /auth/qr-code-auth?user_id=invalidUserId
+ GET /auth/qr-code-auth?user_id=invalidUserId&device_id=3ioui23u29sjkdnsjkndsk
Status: 404 Not Found
```json { "message": "No Authentication authentication found." } ``` - GET /auth/qr-code-auth?taskId=GTB4UUtlKwGemRN2lwBp11
+ GET /auth/qr-code-auth?taskId=GTB4UUtlKwGemRN2lwBp11&device_id=3ioui23u29sjkdnsjkndsk
Status: 400 Bad Request ```json { @@ -187,7 +187,30 @@ Retrieves THE authentication document. "message": "invalid query parameters passed" } ``` - GET /?user_id=GTB4UUtlKwGemRN2lwBp11 + GET /?user_id=GTB4UUtlKwGemRN2lwBp11&device_id=3ioui23u29sjkdnsjkndsk + Status: 500 Internal Server Error + ```json + { + "message": "The server has encountered an unexpected error. Please contact the administrator for more information." + } + ``` + GET /auth/qr-code-auth?user_id=GTB4UUtlKwGemRN2lwBp11&device_id=InvalidUserData
+ Status: 404 Not Found
+ ```json + { + "message": "No Authentication authentication found." + } + ``` + GET /auth/qr-code-auth?user_id=GTB4UUtlKwGemRN2lwBp11&mobileId=3ioui23u29sjkdnsjkndsk
+ Status: 400 Bad Request + ```json + { + "statusCode": 400, + "error": "Bad Request", + "message": "invalid query parameters passed" + } + ``` + GET /?user_id=GTB4UUtlKwGemRN2lwBp11&device_id=3ioui23u29sjkdnsjkndsk Status: 500 Internal Server Error ```json { From 2ae08eacec857731fde1d8dffcfd0c30b6957baf Mon Sep 17 00:00:00 2001 From: shreya-mishra Date: Sat, 17 Jun 2023 05:33:03 +0530 Subject: [PATCH 14/17] resolved the comment --- qr-code-auth/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qr-code-auth/README.md b/qr-code-auth/README.md index 8060c36..1919bf7 100644 --- a/qr-code-auth/README.md +++ b/qr-code-auth/README.md @@ -175,7 +175,7 @@ Retrieves THE authentication document. Status: 404 Not Found
```json { - "message": "No Authentication authentication found." + "message": "No Authentication found." } ``` GET /auth/qr-code-auth?taskId=GTB4UUtlKwGemRN2lwBp11&device_id=3ioui23u29sjkdnsjkndsk
@@ -198,7 +198,7 @@ Retrieves THE authentication document. Status: 404 Not Found
```json { - "message": "No Authentication authentication found." + "message": "No Authentication found." } ``` GET /auth/qr-code-auth?user_id=GTB4UUtlKwGemRN2lwBp11&mobileId=3ioui23u29sjkdnsjkndsk
From d1b1d7a8b0a634f6821e3f6df759643a7cca8083 Mon Sep 17 00:00:00 2001 From: shreya-mishra Date: Sat, 17 Jun 2023 16:49:08 +0530 Subject: [PATCH 15/17] remove access tokens with other calls --- qr-code-auth/README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/qr-code-auth/README.md b/qr-code-auth/README.md index 1919bf7..e5995aa 100644 --- a/qr-code-auth/README.md +++ b/qr-code-auth/README.md @@ -34,7 +34,6 @@ "user_id": "String", "device_info": "String", "authorization_status": "String", - "access_token": "String" } } ``` @@ -88,7 +87,6 @@ "user_id": "SooJK37gzjIZfFNH0tlL", "device_info": "t5k77PHnuDSrgEzvMJAj", "authorization_status": "NOT_INIT", - "access_token": "" }, "message": "authentication document created successfully." } @@ -240,7 +238,6 @@ Updates the authorization_status field of an existing qr-code-auth document for "user_id": "String", "device_info": "String", "authorization_status": "String", - "access_token": "String" } } ``` @@ -294,7 +291,6 @@ Updates the authorization_status field of an existing qr-code-auth document for "user_id": "SooJK37gzjIZfFNH0tlL", "device_info": "t5k77PHnuDSrgEzvMJAj", "authorization_status": "AUTHORIZED", - "access_token": "NLFSj7Kz30oHgolfIZtJ" }, "message": "Authentication document for user SooJK37gzjIZfFNH0tlL updated successfully." } From 338a016ee253e8e949c58a533fe59d5c8a628645 Mon Sep 17 00:00:00 2001 From: shreya-mishra Date: Sun, 18 Jun 2023 08:39:39 +0530 Subject: [PATCH 16/17] resolved the comments as discussed --- qr-code-auth/README.md | 40 ++++++++++------------------------------ 1 file changed, 10 insertions(+), 30 deletions(-) diff --git a/qr-code-auth/README.md b/qr-code-auth/README.md index e5995aa..728cfe6 100644 --- a/qr-code-auth/README.md +++ b/qr-code-auth/README.md @@ -20,6 +20,8 @@ - Attributes - **user_id** (required, string): Specifies the user id for the document. - **device_info** (required, string): Specifies the device information associated with the authentication. + - **device_id** : Specifies the ID of the User' device whose device id will be unique. + - **Headers** - Content-Type: application/json - **Cookie** @@ -33,6 +35,7 @@ "data": { "user_id": "String", "device_info": "String", + "device_id": "String", "authorization_status": "String", } } @@ -73,7 +76,8 @@ ```json { "device_info": "t5k77PHnuDSrgEzvMJAj", - "user_id": "NLFSj7Kz30oHgolfIZtJ" + "user_id": "NLFSj7Kz30oHgolfIZtJ", + "device_id": "sdkdjASdjdsfns3kdj" } ``` @@ -86,6 +90,7 @@ "data": { "user_id": "SooJK37gzjIZfFNH0tlL", "device_info": "t5k77PHnuDSrgEzvMJAj", + "device_id": "sdkdjASdjdsfns3kdj", "authorization_status": "NOT_INIT", }, "message": "authentication document created successfully." @@ -99,9 +104,6 @@ Retrieves THE authentication document. - **Params** None - **Query** - - - user_id : Specifies the ID of the User whose authentication document will be retrieved - - device_id : Specifies the ID of the User' device whose device id will be unique. - **Body** None @@ -119,7 +121,6 @@ Retrieves THE authentication document. { "message": "String", "data": { - "user_id": "String", "device_id": "String", "device_info": "String", "authorization_status": "String", @@ -155,7 +156,7 @@ Retrieves THE authentication document. ``` - **Example:** - GET /auth/qr-code-auth?user_id=SooJK37gzjIZfFNH0tlL&device_id=3ioui23u29sjkdnsjkndsk
+ GET /auth/qr-code-auth?device_id=3ioui23u29sjkdnsjkndsk
Status: 200 OK
```json { @@ -169,30 +170,9 @@ Retrieves THE authentication document. } } ``` - GET /auth/qr-code-auth?user_id=invalidUserId&device_id=3ioui23u29sjkdnsjkndsk
- Status: 404 Not Found
- ```json - { - "message": "No Authentication found." - } - ``` - GET /auth/qr-code-auth?taskId=GTB4UUtlKwGemRN2lwBp11&device_id=3ioui23u29sjkdnsjkndsk
- Status: 400 Bad Request - ```json - { - "statusCode": 400, - "error": "Bad Request", - "message": "invalid query parameters passed" - } - ``` - GET /?user_id=GTB4UUtlKwGemRN2lwBp11&device_id=3ioui23u29sjkdnsjkndsk - Status: 500 Internal Server Error - ```json - { - "message": "The server has encountered an unexpected error. Please contact the administrator for more information." - } + ``` - GET /auth/qr-code-auth?user_id=GTB4UUtlKwGemRN2lwBp11&device_id=InvalidUserData
+ GET /auth/qr-code-auth?device_id=InvalidUserData
Status: 404 Not Found
```json { @@ -208,7 +188,7 @@ Retrieves THE authentication document. "message": "invalid query parameters passed" } ``` - GET /?user_id=GTB4UUtlKwGemRN2lwBp11&device_id=3ioui23u29sjkdnsjkndsk + GET /?device_id=3ioui23u29sjkdnsjkndsk Status: 500 Internal Server Error ```json { From 60c75694b9eaa5f7da8b34066eac98aeb6430da6 Mon Sep 17 00:00:00 2001 From: shreya-mishra Date: Sun, 18 Jun 2023 08:53:28 +0530 Subject: [PATCH 17/17] added user_id in get --- qr-code-auth/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/qr-code-auth/README.md b/qr-code-auth/README.md index 728cfe6..1133ceb 100644 --- a/qr-code-auth/README.md +++ b/qr-code-auth/README.md @@ -121,6 +121,7 @@ Retrieves THE authentication document. { "message": "String", "data": { + "user_id": "String", "device_id": "String", "device_info": "String", "authorization_status": "String",