2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-22 18:08:16 +00:00

[#3609] Checkpoint: doing syntax

This commit is contained in:
Francis Dupont 2024-11-15 11:16:11 +01:00
parent 3193b4f7b4
commit fc3a84eb29
11 changed files with 76 additions and 6 deletions

View File

@ -18,6 +18,16 @@
// is specifically for HA updates only. // is specifically for HA updates only.
"http-port": 8000, "http-port": 8000,
// Extra HTTP headers to add in responses.
"http-headers":
[
{
"comment": "HSTS header",
"name": "Strict-Transport-Security",
"value": "max-age=31536000"
}
],
// In authentication // In authentication
"authentication": "authentication":
{ {

View File

@ -15,6 +15,21 @@
// is specifically for HA updates only. // is specifically for HA updates only.
"http-port": 8000, "http-port": 8000,
// Extra HTTP headers to add in responses.
"http-headers":
[
{
// Optional user context.
"user-context": { "comment": "HSTS header" },
// Required HTTP header name.
"name": "Strict-Transport-Security",
// Required HTTP header value.
"value": "max-age=31536000"
}
],
// Optional authentication. // Optional authentication.
"authentication": "authentication":
{ {

View File

@ -191,6 +191,21 @@
// means they are optional. // means they are optional.
"cert-required": true, "cert-required": true,
// Extra HTTP headers to add in responses.
"http-headers":
[
{
// Optional user context.
"user-context": { "comment": "HSTS header" },
// Required HTTP header name.
"name": "Strict-Transport-Security",
// Required HTTP header value.
"value": "max-age=31536000"
}
],
// Optional authentication. // Optional authentication.
"authentication": { "authentication": {

View File

@ -142,6 +142,21 @@
// means they are optional. // means they are optional.
"cert-required": true, "cert-required": true,
// Extra HTTP headers to add in responses.
"http-headers":
[
{
// Optional user context.
"user-context": { "comment": "HSTS header" },
// Required HTTP header name.
"name": "Strict-Transport-Security",
// Required HTTP header value.
"value": "max-age=31536000"
}
],
// Optional authentication. // Optional authentication.
"authentication": { "authentication": {

View File

@ -1138,6 +1138,7 @@ namespace isc { namespace agent {
ctx.unique("http-headers", ctx.loc2pos(yystack_[0].location)); ctx.unique("http-headers", ctx.loc2pos(yystack_[0].location));
ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location))); ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("http-headers", l); ctx.stack_.back()->set("http-headers", l);
ctx.stack_.push_back(l);
ctx.enter(ctx.HTTP_HEADERS); ctx.enter(ctx.HTTP_HEADERS);
} }
#line 1144 "agent_parser.cc" #line 1144 "agent_parser.cc"

View File

@ -412,6 +412,7 @@ http_headers: HTTP_HEADERS {
ctx.unique("http-headers", ctx.loc2pos(@1)); ctx.unique("http-headers", ctx.loc2pos(@1));
ElementPtr l(new ListElement(ctx.loc2pos(@1))); ElementPtr l(new ListElement(ctx.loc2pos(@1)));
ctx.stack_.back()->set("http-headers", l); ctx.stack_.back()->set("http-headers", l);
ctx.stack_.push_back(l);
ctx.enter(ctx.HTTP_HEADERS); ctx.enter(ctx.HTTP_HEADERS);
} COLON LSQUARE_BRACKET http_header_list RSQUARE_BRACKET { } COLON LSQUARE_BRACKET http_header_list RSQUARE_BRACKET {
ctx.stack_.pop_back(); ctx.stack_.pop_back();
@ -445,7 +446,7 @@ http_header_params: http_header_param
; ;
http_header_param: name http_header_param: name
| value | header_value
| user_context | user_context
| comment | comment
| unknown_map_entry | unknown_map_entry
@ -460,7 +461,7 @@ name: NAME {
ctx.leave(); ctx.leave();
}; };
value: VALUE { header_value: VALUE {
ctx.unique("value", ctx.loc2pos(@1)); ctx.unique("value", ctx.loc2pos(@1));
ctx.enter(ctx.NO_KEYWORDS); ctx.enter(ctx.NO_KEYWORDS);
} COLON STRING { } COLON STRING {

View File

@ -49,6 +49,15 @@
} }
} }
], ],
"http-headers": [
{
"name": "Strict-Transport-Security",
"user-context": {
"comment": "HSTS header"
},
"value": "max-age=31536000"
}
],
"http-host": "127.0.0.1", "http-host": "127.0.0.1",
"http-port": 8000 "http-port": 8000
} }

View File

@ -4176,6 +4176,7 @@ namespace isc { namespace dhcp {
ctx.unique("http-headers", ctx.loc2pos(yystack_[0].location)); ctx.unique("http-headers", ctx.loc2pos(yystack_[0].location));
ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location))); ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("http-headers", l); ctx.stack_.back()->set("http-headers", l);
ctx.stack_.push_back(l);
ctx.enter(ctx.HTTP_HEADERS); ctx.enter(ctx.HTTP_HEADERS);
} }
#line 4182 "dhcp4_parser.cc" #line 4182 "dhcp4_parser.cc"

View File

@ -2657,6 +2657,7 @@ http_headers: HTTP_HEADERS {
ctx.unique("http-headers", ctx.loc2pos(@1)); ctx.unique("http-headers", ctx.loc2pos(@1));
ElementPtr l(new ListElement(ctx.loc2pos(@1))); ElementPtr l(new ListElement(ctx.loc2pos(@1)));
ctx.stack_.back()->set("http-headers", l); ctx.stack_.back()->set("http-headers", l);
ctx.stack_.push_back(l);
ctx.enter(ctx.HTTP_HEADERS); ctx.enter(ctx.HTTP_HEADERS);
} COLON LSQUARE_BRACKET http_header_list RSQUARE_BRACKET { } COLON LSQUARE_BRACKET http_header_list RSQUARE_BRACKET {
ctx.stack_.pop_back(); ctx.stack_.pop_back();
@ -2690,13 +2691,13 @@ http_header_params: http_header_param
; ;
http_header_param: name http_header_param: name
| value | header_value
| user_context | user_context
| comment | comment
| unknown_map_entry | unknown_map_entry
; ;
value: VALUE { header_value: VALUE {
ctx.unique("value", ctx.loc2pos(@1)); ctx.unique("value", ctx.loc2pos(@1));
ctx.enter(ctx.NO_KEYWORD); ctx.enter(ctx.NO_KEYWORD);
} COLON STRING { } COLON STRING {

View File

@ -4331,6 +4331,7 @@ namespace isc { namespace dhcp {
ctx.unique("http-headers", ctx.loc2pos(yystack_[0].location)); ctx.unique("http-headers", ctx.loc2pos(yystack_[0].location));
ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location))); ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("http-headers", l); ctx.stack_.back()->set("http-headers", l);
ctx.stack_.push_back(l);
ctx.enter(ctx.HTTP_HEADERS); ctx.enter(ctx.HTTP_HEADERS);
} }
#line 4337 "dhcp6_parser.cc" #line 4337 "dhcp6_parser.cc"

View File

@ -2799,6 +2799,7 @@ http_headers: HTTP_HEADERS {
ctx.unique("http-headers", ctx.loc2pos(@1)); ctx.unique("http-headers", ctx.loc2pos(@1));
ElementPtr l(new ListElement(ctx.loc2pos(@1))); ElementPtr l(new ListElement(ctx.loc2pos(@1)));
ctx.stack_.back()->set("http-headers", l); ctx.stack_.back()->set("http-headers", l);
ctx.stack_.push_back(l);
ctx.enter(ctx.HTTP_HEADERS); ctx.enter(ctx.HTTP_HEADERS);
} COLON LSQUARE_BRACKET http_header_list RSQUARE_BRACKET { } COLON LSQUARE_BRACKET http_header_list RSQUARE_BRACKET {
ctx.stack_.pop_back(); ctx.stack_.pop_back();
@ -2832,13 +2833,13 @@ http_header_params: http_header_param
; ;
http_header_param: name http_header_param: name
| value | header_value
| user_context | user_context
| comment | comment
| unknown_map_entry | unknown_map_entry
; ;
value: VALUE { header_value: VALUE {
ctx.unique("value", ctx.loc2pos(@1)); ctx.unique("value", ctx.loc2pos(@1));
ctx.enter(ctx.NO_KEYWORD); ctx.enter(ctx.NO_KEYWORD);
} COLON STRING { } COLON STRING {