-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SecurityScheme.php
178 lines (159 loc) · 5.67 KB
/
SecurityScheme.php
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
<?php
namespace Zerotoprod\DataModelOpenapi30;
use Zerotoprod\DataModel\Describe;
use Zerotoprod\DataModelOpenapi30\Helpers\DataModel;
/**
* Defines a security scheme that can be used by the operations.
*
* Supported schemes are HTTP authentication, an API key (either as
* a header, a cookie parameter, or as a query parameter), OAuth2’s
* common flows (implicit, password, client credentials, and
* authorization code) as defined in [RFC6749], and
* [OpenID-Connect-Core]. Please note that as of
* 2020, the implicit flow is about to be
* deprecated by OAuth 2.0 Security Best
* Current Practice. Recommended for
* most use cases is Authorization
* Code Grant flow with PKCE.
*
* @link https://spec.openapis.org/oas/v3.0.4.html#security-scheme-object-0
*/
class SecurityScheme
{
use DataModel;
/**
* **REQUIRED**. The type of the security scheme. Valid values are
* `"apiKey"`, `"http"`, `"oauth2"`, `"openIdConnect"`.
*
* @link https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-23
* @see $type
*/
public const type = 'type';
/**
* **REQUIRED**. The type of the security scheme. Valid values are
* `"apiKey"`, `"http"`, `"oauth2"`, `"openIdConnect"`.
*
* @link https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-23
*/
#[Describe(['nullable'])]
public ?string $type;
/**
* A description for security scheme. [CommonMark] syntax _MAY_
* be used for rich text representation.
*
* @link https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-23
* @see $description
*/
public const description = 'description';
/**
* A description for security scheme. [CommonMark] syntax _MAY_
* be used for rich text representation.
*
* @link https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-23
*/
#[Describe(['nullable'])]
public ?string $description;
/**
* **REQUIRED**. The name of the header, query or cookie parameter to be used.
*
* @link https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-23
* @see $name
*/
public const name = 'name';
/**
* **REQUIRED**. The name of the header, query or cookie parameter to be used.
*
* @link https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-23
*/
#[Describe(['nullable'])]
public ?string $name;
/**
* **REQUIRED**. The type of the security scheme. Valid values are
* `"query"`, `"header"`, `"cookie"`.
*
* @link https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-23
* @see $in
*/
public const in = 'in';
/**
* **REQUIRED**. The type of the security scheme. Valid values are
* `"apiKey"`, `"http"`, `"oauth2"`, `"openIdConnect"`.
*
* @link https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-23
*/
#[Describe(['nullable'])]
public ?string $in;
/**
* **REQUIRED**. The name of the HTTP Authentication scheme to be used
* in the Authorization header as defined in [RFC7235] Section 5.1.
* The values used SHOULD be registered in the IANA Authentication
* Scheme registry. The value is case-insensitive, as defined in [
* RFC7235] Section 2.1.
*
* @link https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-23
* @see $scheme
*/
public const scheme = 'scheme';
/**
* **REQUIRED**. The name of the HTTP Authentication scheme to be used
* in the Authorization header as defined in [RFC7235] Section 5.1.
* The values used SHOULD be registered in the IANA Authentication
* Scheme registry. The value is case-insensitive, as defined in [
* RFC7235] Section 2.1.
*
* @link https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-23
*/
#[Describe(['nullable'])]
public ?string $scheme;
/**
* A hint to the client to identify how the bearer token is formatted.
* Bearer tokens are usually generated by an authorization server, so
* this information is primarily for documentation purposes.
*
* @link https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-23
* @see $bearerFormat
*/
public const bearerFormat = 'bearerFormat';
/**
* A hint to the client to identify how the bearer token is formatted.
* Bearer tokens are usually generated by an authorization server, so
* this information is primarily for documentation purposes.
*
* @link https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-23
*/
#[Describe(['nullable'])]
public ?string $bearerFormat;
/**
* **REQUIRED**. Well-known URL to discover the [OpenID-Connect-Discovery]
* provider metadata.
*
* @link https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-23
* @see $openIdConnectUrl
*/
public const openIdConnectUrl = 'openIdConnectUrl';
/**
* A hint to the client to identify how the bearer token is formatted.
* Bearer tokens are usually generated by an authorization server, so
* this information is primarily for documentation purposes.
*
* @link https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-23
*/
#[Describe(['nullable'])]
public ?string $openIdConnectUrl;
/**
* **REQUIRED**. An object containing configuration information for the
* flow types supported.
*
* @link https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-24
* @see $flows
*/
public const flows = 'flows';
/**
* **REQUIRED**. An object containing configuration information for the
* flow types supported.
*
* @link https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-24
*/
#[Describe(['nullable'])]
public ?OAuthFlows $flows;
}