add: implement shortlink
This commit is contained in:
50
test/http/shortlink-flow.http
Normal file
50
test/http/shortlink-flow.http
Normal file
@@ -0,0 +1,50 @@
|
||||
### Shortlink Authentication Test File
|
||||
@baseUrl = http://localhost:5555
|
||||
@adminToken = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiMSIsImVtYWlsIjoiYWRtaW4iLCJyb2xlIjoiZXhwZXJ0aXNlX2RvY3RvciIsInVzZXJfbmFtZSI6IkFkbWluIFVzZXIiLCJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiaG9tZV91cmwiOiIvIiwic3R1ZHlfbGlzdCI6ImVuYWJsZWQiLCJleHAiOjE3NDcyMDY5NTAsImlhdCI6MTc0NzEyMDU1MH0.M3fhlKB8MX-NxGdEgnaA9-AhMXnXjUjRsWYOBXntJe4
|
||||
|
||||
### 0. Login as Admin and take the token
|
||||
POST http://localhost:5555/auth/login
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"email": "admin",
|
||||
"password": "admin"
|
||||
}
|
||||
|
||||
|
||||
### 1. Generate Short Link (Admin/Expertise Doctor Only)
|
||||
POST {{baseUrl}}/generate-link
|
||||
Content-Type: application/json
|
||||
Authorization: Bearer {{adminToken}}
|
||||
|
||||
{
|
||||
"patient_id": "MR00000359",
|
||||
"study_uid": "1.2.826.0.1.3680043.9.7307.1.202503196393.01",
|
||||
"dob": "2001-10-07",
|
||||
"expires_in": 48
|
||||
}
|
||||
|
||||
### 2. Authenticate with Short Link and DOB
|
||||
# Use the short_token from the response of request #1
|
||||
POST {{baseUrl}}/auth/shortlink
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"short_token": "oP-tLWeu",
|
||||
"dob": "2001-10-07"
|
||||
}
|
||||
|
||||
### 3. Try authentication with incorrect DOB
|
||||
POST {{baseUrl}}/auth/shortlink
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"short_token": "erB5xT5S",
|
||||
"dob": "1985-04-16"
|
||||
}
|
||||
|
||||
### 4. Access DICOM data with the JWT from successful shortlink auth
|
||||
# Replace with token from successful auth in request #2
|
||||
GET {{baseUrl}}/dicomWeb/studies/1.2.826.0.1.3680043.9.7307.1.202503196393.01
|
||||
Content-Type: application/json
|
||||
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoic2hvcnRsaW5rX3NsXzgzZGNmNzQ1NGYwZiIsImVtYWlsIjoicGF0aWVudF9zbF84M2RjZjc0NTRmMGZAc2hvcnRsaW5rLmxvY2FsIiwicm9sZSI6InBhdGllbnQiLCJ1c2VyX25hbWUiOiJQYXRpZW50IiwidG9rZW5fdHlwZSI6ImFjY2VzcyIsInBhdGllbnRfaWQiOiJNUjAwMDAwMzU5IiwicGF0aWVudF9uYW1lIjoiUGF0aWVudCIsInN0dWR5X2l1aWRzIjpbIjEuMi44MjYuMC4xLjM2ODAwNDMuOS43MzA3LjEuMjAyNTAzMTk2MzkzLjAxIl0sImhvbWVfdXJsIjoidmlld2VyP1N0dWR5SW5zdGFuY2VVSURzPTEuMi44MjYuMC4xLjM2ODAwNDMuOS43MzA3LjEuMjAyNTAzMTk2MzkzLjAxIiwic3R1ZHlfbGlzdCI6ImRpc2FibGVkIiwiZXhwIjoxNzQ3MjA3MDI4LCJpYXQiOjE3NDcxMjA2Mjh9.RMGF9ParYAmOXbJqd0DP2kl0X6O0n8j_LI6FF9el4qM
|
||||
Reference in New Issue
Block a user