-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathietf-http-server.yang
319 lines (291 loc) · 9.99 KB
/
ietf-http-server.yang
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
module ietf-http-server {
yang-version 1.1;
namespace "urn:ietf:params:xml:ns:yang:ietf-http-server";
prefix https;
import ietf-yang-types {
prefix yang;
reference
"RFC 6991: Common YANG Data Types";
}
import iana-crypt-hash {
prefix ianach;
reference
"RFC 7317: A YANG Data Model for System Management";
}
import ietf-netconf-acm {
prefix nacm;
reference
"RFC 8341: Network Configuration Access Control Model";
}
import ietf-tcp-server {
prefix tcps;
reference
"RFC DDDD: YANG Groupings for TCP Clients and TCP Servers";
}
import ietf-tls-server {
prefix tlss;
reference
"RFC FFFF: YANG Groupings for TLS Clients and TLS Servers";
}
import ietf-udp-server {
prefix udps;
reference
"RFC JJJJ: YANG Groupings for UDP Clients and UDP Servers";
}
organization
"IETF NETCONF (Network Configuration) Working Group";
contact
"WG Web: https://datatracker.ietf.org/wg/netconf
WG List: NETCONF WG list <mailto:[email protected]>
Author: Kent Watsen <mailto:[email protected]>";
description
"This module defines reusable groupings for HTTP servers that
can be used as a basis for specific HTTP server instances.
Copyright (c) 2024 IETF Trust and the persons identified
as authors of the code. All rights reserved.
Redistribution and use in source and binary forms, with
or without modification, is permitted pursuant to, and
subject to the license terms contained in, the Revised
BSD License set forth in Section 4.c of the IETF Trust's
Legal Provisions Relating to IETF Documents
(https://trustee.ietf.org/license-info).
This version of this YANG module is part of RFC GGGG
(https://www.rfc-editor.org/info/rfcGGGG); see the RFC
itself for full legal notices.
The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL',
'SHALL NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED',
'NOT RECOMMENDED', 'MAY', and 'OPTIONAL' in this document
are to be interpreted as described in BCP 14 (RFC 2119)
(RFC 8174) when, and only when, they appear in all
capitals, as shown here.";
revision YYYY-MM-DD {
description
"Initial version";
reference
"RFC GGGG: YANG Groupings for HTTP Clients and HTTP Servers";
}
// Features
feature client-auth-supported {
description
"Indicates that the server supports configuring HTTP
servers to authenticate HTTP clients. HTTP-level client
authentication may not be needed when client authentication
is expected to occur only at another protocol layer (e.g.,
TLS).";
}
feature local-users-supported {
if-feature "client-auth-supported";
description
"Indicates that the server supports configuring client
authentication with its own database of local users, as
opposed to in an application specific location.";
}
feature basic-auth {
if-feature "local-users-supported";
description
"Indicates that the server supports configuring 'basic'
authentication credentials in its local user database.";
reference
"RFC 7617: The 'Basic' HTTP Authentication Scheme";
}
feature tcp-supported {
description
"Indicates that the server supports configuring HTTP
servers to listen for HTTP 1.1/2.0 connections over TCP.";
reference
"RFC 9110: HTTP Semantics";
}
feature tls-supported {
description
"Indicates that the server supports configuring HTTP
servers to listen for HTTP 1.1/2.0 connections over TLS.";
reference
"RFC 9110: HTTP Semantics";
}
feature quic-supported {
description
"Indicates that the server supports configuring HTTP
servers to listen for HTTP/3 connections over QUIC.";
reference
"RFC 9114: HTTP/3";
}
// Groupings
grouping http-server-grouping {
description
"A reusable grouping for configuring an HTTP server.
Note that this grouping uses fairly typical descendant
node names such that a stack of 'uses' statements will
have name conflicts. It is intended that the consuming
data model will resolve the issue (e.g., by wrapping
the 'uses' statement in a container called
'http-server-parameters'). This model purposely does
not do this itself so as to provide maximum flexibility
to consuming models.";
leaf server-name {
nacm:default-deny-write;
type string;
description
"The value of the 'Server' header field. If not set, then
underlying software's default value is used. Set to the
empty string to disable.";
}
container client-authentication {
if-feature "client-auth-supported";
nacm:default-deny-write;
presence
"Indicates that HTTP based client authentication is
configured. This statement is present so the mandatory
descendant nodes do not imply that this node must be
configured.";
description
"Configures how the HTTP server can authenticate HTTP
clients. The HTTP server will request that the HTTP
client send authentication when needed.";
container users {
if-feature "local-users-supported";
description
"A list of locally configured users.";
list user {
key "user-id";
description
"The list of local users configured on this device.";
leaf user-id {
type string;
description
"The user-id for the authenticating client.";
}
choice auth-type {
mandatory true;
description
"The authentication type.";
case basic {
container basic {
if-feature "basic-auth";
leaf username {
type string;
description
"The username for the authenticating HTTP
client.";
}
container password {
description
"The hashed password the HTTP server uses to
authenticate this user. A user is authenticated
if the hash of the supplied password matches
this value.";
leaf hashed-password {
type ianach:crypt-hash;
description
"The password for the authenticating client.";
}
leaf last-modified {
type yang:date-and-time;
config false;
description
"Identifies when the password was last set.";
}
}
description
"The 'basic' HTTP scheme credentials.";
reference
"RFC 7617:
The 'Basic' HTTP Authentication Scheme";
}
}
}
}
}
} // container client-authentication
} // grouping http-server-grouping
grouping http-server-stack-grouping {
description
"A grouping that defines common HTTP-based protocol stacks.";
choice transport {
mandatory true;
description
"Choice amongst various transports type.";
case tcp {
if-feature "tcp-supported";
container tcp {
description
"Container for TCP-based HTTP protocols.";
container tcp-server-parameters {
description
"TCP-level server parameters to
listen for HTTP connections.";
uses tcps:tcp-server-grouping {
refine "local-bind/local-port" {
default "80";
description
"The HTTP server will attempt to connect
to the IANA-assigned well-known port for
'http' (80) if no value is specified.";
}
}
}
container http-server-parameters {
description
"HTTP-level server parameters to
listen for HTTP connections.";
uses http-server-grouping;
}
}
}
case tls {
if-feature "tls-supported";
container tls {
description
"Container for TLS-based HTTP protocols.";
container tcp-server-parameters {
description
"TCP-level server parameters to
listen for HTTPS connections.";
uses tcps:tcp-server-grouping {
refine "local-bind/local-port" {
default "443";
description
"The HTTP server will attempt to connect
to the IANA-assigned well-known port for
'https' (443) if no value is specified.";
}
}
}
container tls-server-parameters {
description
"TLS-level server parameters to
listen for HTTPS connections.";
uses tlss:tls-server-grouping;
}
container http-server-parameters {
description
"HTTP-level server parameters to
listen for HTTPS connections.";
uses http-server-grouping;
}
}
}
case quic {
if-feature "quic-supported";
container quic {
description
"Container for the QUIC-based HTTP/3 protocol.";
container udp-server-parameters {
description
"UDP-level server parameters.";
uses udps:udp-server;
}
container tls-server-parameters {
description
"TLS-level server parameters.";
uses tlss:tls-server-grouping;
}
container http-server-parameters {
description
"HTTP-level server parameters.";
uses http-server-grouping;
}
}
}
}
} // http-server-stack-grouping
}