Implement addAdbPublicKey endpoint

Reason: manually approve adb connection from web UI does not scale for test automation. Especially those that are using different adb keys on each session (eg: via container)

This changes also added swagger doc endpoint. Using `stf local` command, it will end up at: `http://localhost:7106/docs/`
This commit is contained in:
Akhmad Fathonih
2017-12-05 13:23:57 +09:00
parent 0e751ca3d7
commit 524fd566b7
4 changed files with 94 additions and 1 deletions

View File

@@ -208,6 +208,41 @@ paths:
$ref: "#/definitions/ErrorResponse"
security:
- accessTokenAuth: []
/user/adbPublicKeys:
x-swagger-router-controller: user
post:
summary: Adb public keys
description: Add adb public key for current user
operationId: addAdbPublicKey
consumes:
- application/json
produces:
- application/json
tags:
- user
parameters:
- name: adb
in: body
schema:
type: object
required:
- publickey
properties:
publickey:
type: string
description: adb public key (~/.android/id_rsa.pub)
title:
type: string
description: By default will be extracted from public key
responses:
"200":
description: Add adb key response
default:
description: Unexpected Error
schema:
$ref: "#/definitions/ErrorResponse"
security:
- accessTokenAuth: []
/devices:
x-swagger-router-controller: devices
get: