125 lines
3.1 KiB
JSON
125 lines
3.1 KiB
JSON
|
|
{
|
||
|
|
"name": "Auth API Flow Test",
|
||
|
|
"description": "인증 API 전체 플로우 테스트 - 로그인, 프로필 조회, 토큰 갱신, 로그아웃",
|
||
|
|
"version": "1.0",
|
||
|
|
"config": {
|
||
|
|
"baseUrl": "",
|
||
|
|
"timeout": 30000,
|
||
|
|
"stopOnFailure": true
|
||
|
|
},
|
||
|
|
"variables": {
|
||
|
|
"user_id": "{{$env.FLOW_TESTER_USER_ID}}",
|
||
|
|
"user_pwd": "{{$env.FLOW_TESTER_USER_PWD}}"
|
||
|
|
},
|
||
|
|
"steps": [
|
||
|
|
{
|
||
|
|
"id": "login",
|
||
|
|
"name": "1. 로그인",
|
||
|
|
"description": "access_token, refresh_token 획득",
|
||
|
|
"method": "POST",
|
||
|
|
"endpoint": "/login",
|
||
|
|
"body": {
|
||
|
|
"user_id": "{{user_id}}",
|
||
|
|
"user_pwd": "{{user_pwd}}"
|
||
|
|
},
|
||
|
|
"expect": {
|
||
|
|
"status": [200],
|
||
|
|
"jsonPath": {
|
||
|
|
"$.access_token": "@isString",
|
||
|
|
"$.refresh_token": "@isString"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"extract": {
|
||
|
|
"access_token": "$.access_token",
|
||
|
|
"refresh_token": "$.refresh_token"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"id": "get_profile",
|
||
|
|
"name": "2. 프로필 조회",
|
||
|
|
"description": "access_token으로 현재 사용자 정보 조회",
|
||
|
|
"method": "GET",
|
||
|
|
"endpoint": "/users/me",
|
||
|
|
"headers": {
|
||
|
|
"Authorization": "Bearer {{login.access_token}}"
|
||
|
|
},
|
||
|
|
"expect": {
|
||
|
|
"status": [200],
|
||
|
|
"jsonPath": {
|
||
|
|
"$.success": true,
|
||
|
|
"$.data.id": "@isNumber"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"extract": {
|
||
|
|
"user_id": "$.data.id",
|
||
|
|
"user_name": "$.data.name"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"id": "refresh_token",
|
||
|
|
"name": "3. 토큰 갱신",
|
||
|
|
"description": "refresh_token으로 새 access_token 발급",
|
||
|
|
"method": "POST",
|
||
|
|
"endpoint": "/refresh",
|
||
|
|
"body": {
|
||
|
|
"refresh_token": "{{login.refresh_token}}"
|
||
|
|
},
|
||
|
|
"expect": {
|
||
|
|
"status": [200],
|
||
|
|
"jsonPath": {
|
||
|
|
"$.access_token": "@isString"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"extract": {
|
||
|
|
"new_access_token": "$.access_token"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"id": "verify_new_token",
|
||
|
|
"name": "4. 새 토큰으로 프로필 조회",
|
||
|
|
"description": "갱신된 토큰으로 API 호출 가능 확인",
|
||
|
|
"method": "GET",
|
||
|
|
"endpoint": "/users/me",
|
||
|
|
"headers": {
|
||
|
|
"Authorization": "Bearer {{refresh_token.new_access_token}}"
|
||
|
|
},
|
||
|
|
"expect": {
|
||
|
|
"status": [200],
|
||
|
|
"jsonPath": {
|
||
|
|
"$.success": true
|
||
|
|
}
|
||
|
|
}
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"id": "logout",
|
||
|
|
"name": "5. 로그아웃",
|
||
|
|
"description": "새 access_token으로 로그아웃",
|
||
|
|
"method": "POST",
|
||
|
|
"endpoint": "/logout",
|
||
|
|
"headers": {
|
||
|
|
"Authorization": "Bearer {{refresh_token.new_access_token}}"
|
||
|
|
},
|
||
|
|
"expect": {
|
||
|
|
"status": [200],
|
||
|
|
"jsonPath": {
|
||
|
|
"$.success": true
|
||
|
|
}
|
||
|
|
}
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"id": "verify_logout",
|
||
|
|
"name": "6. 로그아웃 확인",
|
||
|
|
"description": "로그아웃 후 토큰 무효화 확인",
|
||
|
|
"method": "GET",
|
||
|
|
"endpoint": "/users/me",
|
||
|
|
"headers": {
|
||
|
|
"Authorization": "Bearer {{refresh_token.new_access_token}}"
|
||
|
|
},
|
||
|
|
"expect": {
|
||
|
|
"status": [401]
|
||
|
|
},
|
||
|
|
"continueOnFailure": true
|
||
|
|
}
|
||
|
|
]
|
||
|
|
}
|