{
  "name": "인증 플로우 테스트",
  "description": "로그인, 프로필 조회, 토큰 갱신, 로그아웃 플로우를 테스트합니다.",
  "version": "1.0",
  "config": {
    "apiKey": "42Jfwc6EaRQ04GNRmLR5kzJp5UudSOzGGqjmdk1a",
    "baseUrl": "https://api.sam.kr/api/v1",
    "timeout": 30000,
    "stopOnFailure": true
  },
  "variables": {
    "user_id": "codebridgex",
    "user_pwd": "code1234"
  },
  "steps": [
    {
      "id": "login",
      "name": "로그인",
      "method": "POST",
      "endpoint": "/login",
      "body": {
        "user_id": "{{variables.user_id}}",
        "user_pwd": "{{variables.user_pwd}}"
      },
      "extract": {
        "accessToken": "$.access_token",
        "refreshToken": "$.refresh_token"
      },
      "expect": {
        "status": [200],
        "jsonPath": {
          "$.access_token": "@isString"
        }
      }
    },
    {
      "id": "get_profile",
      "name": "프로필 조회",
      "method": "GET",
      "endpoint": "/users/me",
      "headers": {
        "Authorization": "Bearer {{login.accessToken}}"
      },
      "dependsOn": ["login"],
      "expect": {
        "status": [200],
        "jsonPath": {
          "$.success": true
        }
      }
    },
    {
      "id": "refresh_token",
      "name": "토큰 갱신",
      "method": "POST",
      "endpoint": "/refresh",
      "body": {
        "refresh_token": "{{login.refreshToken}}"
      },
      "dependsOn": ["get_profile"],
      "extract": {
        "newToken": "$.access_token"
      },
      "expect": {
        "status": [200],
        "jsonPath": {
          "$.access_token": "@isString"
        }
      }
    },
    {
      "id": "logout",
      "name": "로그아웃",
      "method": "POST",
      "endpoint": "/logout",
      "headers": {
        "Authorization": "Bearer {{refresh_token.newToken}}"
      },
      "dependsOn": ["refresh_token"],
      "expect": {
        "status": [200, 204]
      }
    }
  ]
}
