-
Notifications
You must be signed in to change notification settings - Fork 395
/
openapi.yaml
126 lines (123 loc) · 3.27 KB
/
openapi.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
openapi: 3.1.0
info:
version: 0.0.1
title: OpenFlights Internal API Documentation
externalDocs:
description: Project source code
url: https://github.com/jpatokal/openflights
tags:
- name: login
description: User session management
paths:
/php/login.php:
post:
tags:
- login
summary: Logs user into the system and creates a session
operationId: loginUser
parameters:
- name: challenge
in: query
description: Server-generated challenge string returned from the `php/map.php` endpoint
required: true
schema:
type: string
- name: name
in: query
description: The user name for login
required: true
schema:
type: string
- name: pw
in: query
description: The user password as `base64(md5(challenge + md5(password + lowercase(name))))`
required: true
schema:
type: string
- name: lpw
in: query
description: Same as `pw` except the name is not converted to lowercase
required: false
schema:
type: string
deprecated: true
responses:
'200':
description: The server processed the request. Different types are returned for success/failure.
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/LoginSuccess'
- $ref: '#/components/schemas/LoginFailure'
/php/logout.php:
post:
tags:
- login
summary: Logs out current logged in user session
parameters: []
responses:
'200':
description: Successful logout. This response has no content.
components:
schemas:
DistanceUnit:
type: string
oneOf:
- title: Kilometers
const: "K"
- title: Miles
const: "M"
EditorType:
type: string
oneOf:
- title: Basic
const: "B"
- title: Detailed
const: "D"
LoginStatus:
type: integer
oneOf:
- title: Failure
const: 0
description: Invalid username/password or an expired session.
- title: Success
const: 1
- title: Success (reload for user locale)
const: 2
LoginSuccess:
type: object
description: "Login success and associated user information"
properties:
status:
$ref: '#/components/schemas/LoginStatus'
uid:
type: string
description: "User ID"
example: "123"
name:
type: string
description: "User name"
example: "woof"
locale:
description: "User locale"
type: string
example: "en_US"
units:
$ref: '#/components/schemas/DistanceUnit'
email:
type: string
example: "[email protected]"
editor:
$ref: '#/components/schemas/EditorType'
elite:
type: string
LoginFailure:
type: object
description: "Login failure and failure message"
properties:
status:
$ref: '#/components/schemas/LoginStatus'
message:
type: string
example: "Login failed"