1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-04 18:29:17 +02:00

use security handler instead of express middleware for access token validation.

This commit is contained in:
Vishal Banthia 2015-12-03 17:33:53 +09:00
parent f10ae51b53
commit 221bc78e49
5 changed files with 120 additions and 81 deletions

View file

@ -1,14 +1,15 @@
swagger: "2.0"
info:
version: "1.0.10"
version: "2.0.0"
title: Smartphone Test Farm
description: Control and manager real Smartphone devices from browser and apis
description: Control and manager real Smartphone devices from browser and restful apis
license:
name: Apache-2.0
url: http://www.apache.org/licenses/LICENSE-2.0
contact:
url: http://openstf.io/
name: STF Support
email: contact@openstf.io
url: http://openstf.io/
basePath: /api/v1
schemes:
- http
@ -17,6 +18,11 @@ consumes:
- application/json
produces:
- application/json
tags:
- name: user
description: User Operations
- name: device
description: Device Operations
paths:
/me:
x-swagger-router-controller: user
@ -24,6 +30,8 @@ paths:
summary: User Profile
description: The User Profile endpoint returns information about current authorized user.
operationId: getCurrentUser
tags:
- user
responses:
"200":
description: Current User Profile information
@ -33,6 +41,8 @@ paths:
description: Unexpected Error
schema:
$ref: "#/definitions/ErrorResponse"
security:
- accessTokenAuth: []
# TODO: Change group endpoint with something more easy to understandable endpoint
/group:
x-swagger-router-controller: user
@ -40,21 +50,27 @@ paths:
summary: User Group
description: The User Group endpoint returns information about user group of current authorized user.
operationId: getCurrentUserGroup
tags:
- user
responses:
"200":
description: Current User Group information
description: Current User's Group information
schema:
$ref: "#/definitions/GroupResponse"
default:
description: Unexpected Error
schema:
$ref: "#/definitions/ErrorResponse"
security:
- accessTokenAuth: []
/accessTokens:
x-swagger-router-controller: token
get:
summary: Access Tokens
description: Return Current User Access Tokens titles
description: The Access Tokens endpoints returns titles of all the valid access tokens.
operationId: getAccessTokens
tags:
- user
responses:
"200":
description: Access Tokens titles
@ -64,12 +80,16 @@ paths:
description: Unexpected Error
schema:
$ref: "#/definitions/ErrorResponse"
security:
- accessTokenAuth: []
/devices:
x-swagger-router-controller: device
get:
summary: Device List
description: List of all the STF devices including Disconnected and Offline
description: The devices enpoint return list of all the STF devices including Disconnected and Offline
operationId: getDevices
tags:
- device
responses:
"200":
description: List of Devices
@ -79,12 +99,16 @@ paths:
description: Unexpected Error
schema:
$ref: "#/definitions/ErrorResponse"
security:
- accessTokenAuth: []
/devices/{serial}:
x-swagger-router-controller: device
get:
summary: Device Information
description: Device Information
description: The device enpoint return information about a single device.
operationId: getDeviceBySerial
tags:
- device
parameters:
- name: serial
in: path
@ -100,6 +124,8 @@ paths:
description: Unexpected Error
schema:
$ref: "#/definitions/ErrorResponse"
security:
- accessTokenAuth: []
/swagger.json:
x-swagger-pipe: swagger_raw
definitions:
@ -145,3 +171,9 @@ definitions:
properties:
message:
type: string
securityDefinitions:
accessTokenAuth:
type: apiKey
name: accessTokenAuth
in: header