forked from pagopa/io-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
api_auth.yaml
178 lines (176 loc) · 4.82 KB
/
api_auth.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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
swagger: '2.0'
info:
version: 7.19.2
title: Authentication API
description: Collection of endpoints to interact with user's auth session.
host: localhost
basePath: /
schemes:
- https
security:
- Bearer: []
paths:
/logout:
x-swagger-router-controller: AuthenticationController
post:
operationId: logout
summary: Execute the logout
description: Delete user's active session and tokens.
responses:
'200':
description: Logout succeeded
schema:
$ref: '#/definitions/SuccessResponse'
examples:
application/json:
message: ok
'400':
description: Bad request
schema:
$ref: '#/definitions/ProblemJson'
'401':
description: Bearer token null or expired.
'500':
description: There was an error deleting user's session.
schema:
$ref: '#/definitions/ProblemJson'
/user-identity:
x-swagger-router-controller: AuthenticationController
get:
operationId: getUserIdentity
summary: Get stored user's identity
description: Returns the user's identity stored during the login phase
responses:
'200':
description: Found.
schema:
$ref: '#/definitions/UserIdentity'
examples:
application/json:
family_name: Rossi
fiscal_code: TMMEXQ60A10Y526X
name: Mario
spid_email: [email protected]
spid_mobile_phone: '1234567890'
'400':
description: Bad request
schema:
$ref: '#/definitions/ProblemJson'
'401':
description: Bearer token null or expired.
'500':
description: There was an error retrieving user's profile.
schema:
$ref: '#/definitions/ProblemJson'
definitions:
ProblemJson:
type: object
properties:
type:
type: string
format: uri
description: |-
An absolute URI that identifies the problem type. When dereferenced,
it SHOULD provide human-readable documentation for the problem type
(e.g., using HTML).
default: about:blank
example: https://example.com/problem/constraint-violation
title:
type: string
description: |-
A short, summary of the problem type. Written in english and readable
for engineers (usually not suited for non technical stakeholders and
not localized); example: Service Unavailable
status:
type: integer
format: int32
description: >-
The HTTP status code generated by the origin server for this
occurrence
of the problem.
minimum: 100
maximum: 600
exclusiveMaximum: true
example: 200
detail:
type: string
description: |-
A human readable explanation specific to this occurrence of the
problem.
example: There was an error processing the request
instance:
type: string
format: uri
description: >-
An absolute URI that identifies the specific occurrence of the
problem.
It may or may not yield further information if dereferenced.
SuccessResponse:
type: object
properties:
message:
type: string
EmailAddress:
type: string
format: email
example: [email protected]
FiscalCode:
type: string
description: User's fiscal code.
format: FiscalCode
x-import: '@pagopa/ts-commons/lib/strings'
example: SPNDNL80R13C555X
SpidUserIdentity:
type: object
title: SPID User Identity
description: Describes the user's profile while it's authenticated with Spid.
properties:
family_name:
type: string
fiscal_code:
$ref: '#/definitions/FiscalCode'
name:
type: string
spid_email:
$ref: '#/definitions/EmailAddress'
date_of_birth:
type: string
format: date
required:
- family_name
- fiscal_code
- name
- spid_email
CieUserIdentity:
type: object
title: CIE User Identity
description: Describes the user's profile while it's authenticated with CIE.
properties:
family_name:
type: string
fiscal_code:
$ref: '#/definitions/FiscalCode'
name:
type: string
date_of_birth:
type: string
format: date
required:
- family_name
- fiscal_code
- name
- date_of_birth
UserIdentity:
x-one-of: true
allOf:
- $ref: '#/definitions/SpidUserIdentity'
- $ref: '#/definitions/CieUserIdentity'
consumes:
- application/json
produces:
- application/json
securityDefinitions:
Bearer:
type: apiKey
name: Authorization
in: header