]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3609] Checkpoint: doing syntax
authorFrancis Dupont <fdupont@isc.org>
Fri, 15 Nov 2024 10:16:11 +0000 (11:16 +0100)
committerFrancis Dupont <fdupont@isc.org>
Fri, 22 Nov 2024 08:55:31 +0000 (09:55 +0100)
doc/examples/agent/comments.json
doc/examples/agent/simple.json
doc/examples/kea4/all-keys.json
doc/examples/kea6/all-keys.json
src/bin/agent/agent_parser.cc
src/bin/agent/agent_parser.yy
src/bin/agent/tests/testdata/get_config.json
src/bin/dhcp4/dhcp4_parser.cc
src/bin/dhcp4/dhcp4_parser.yy
src/bin/dhcp6/dhcp6_parser.cc
src/bin/dhcp6/dhcp6_parser.yy

index 10c82e3fa3795869d5f2cd7fafa540fef93e3a46..b382a66bc3674232ae5da3f51c9bdf1473dd3194 100644 (file)
         // is specifically for HA updates only.
         "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
         "authentication":
         {
index 7597f652db3e6b1f42ccc91847c7687100c5e7b1..fec2c3eef971b1364d70e45e21c66c0ef3d25216 100644 (file)
         // is specifically for HA updates only.
         "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.
         "authentication":
         {
index b68e6d2f04d2015f182b314f2552d6a944f4ab30..0c71d8b9f14b1463ee27b0a7f98634c33d0d2a4c 100644 (file)
                 // means they are optional.
                 "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.
                 "authentication": {
 
index 281627950c23ba621b3488af6b22266783770afd..6ac1bb3f834f1b1ec8b5b4022553a6a1c1112982 100644 (file)
                 // means they are optional.
                 "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.
                 "authentication": {
 
index 274ec2b257a8944ea696d00a6891c36575a9cabe..964208fd3139f4858aecdb84bc28c0da528be141 100644 (file)
@@ -1138,6 +1138,7 @@ namespace isc { namespace agent {
     ctx.unique("http-headers", ctx.loc2pos(yystack_[0].location));
     ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
     ctx.stack_.back()->set("http-headers", l);
+    ctx.stack_.push_back(l);
     ctx.enter(ctx.HTTP_HEADERS);
 }
 #line 1144 "agent_parser.cc"
index 228f5f56dc9b794243aa3aff2ef93f139d41923a..9bd07e8900df5848f1ac3a300166acc5a5b5f6d1 100644 (file)
@@ -412,6 +412,7 @@ http_headers: HTTP_HEADERS {
     ctx.unique("http-headers", ctx.loc2pos(@1));
     ElementPtr l(new ListElement(ctx.loc2pos(@1)));
     ctx.stack_.back()->set("http-headers", l);
+    ctx.stack_.push_back(l);
     ctx.enter(ctx.HTTP_HEADERS);
 } COLON LSQUARE_BRACKET http_header_list RSQUARE_BRACKET {
     ctx.stack_.pop_back();
@@ -445,7 +446,7 @@ http_header_params: http_header_param
                   ;
 
 http_header_param: name
-                 | value
+                 | header_value
                  | user_context
                  | comment
                  | unknown_map_entry
@@ -460,7 +461,7 @@ name: NAME {
     ctx.leave();
 };
 
-value: VALUE {
+header_value: VALUE {
     ctx.unique("value", ctx.loc2pos(@1));
     ctx.enter(ctx.NO_KEYWORDS);
 } COLON STRING {
index 3117d66fc32eaa52d4fef36f75c0e036b7c3899a..4072ca316357cdce1facbc27b806e3e4f1dc1333 100644 (file)
                 }
             }
         ],
+        "http-headers": [
+            {
+                "name": "Strict-Transport-Security",
+                "user-context": {
+                    "comment": "HSTS header"
+                },
+                "value": "max-age=31536000"
+            }
+        ],
         "http-host": "127.0.0.1",
         "http-port": 8000
     }
index 2360f52c5686a6ef4b101216620796b5fd50e0e9..f24fbd2e96a2dbd907f203c4a2fe9118dd652c49 100644 (file)
@@ -4176,6 +4176,7 @@ namespace isc { namespace dhcp {
     ctx.unique("http-headers", ctx.loc2pos(yystack_[0].location));
     ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
     ctx.stack_.back()->set("http-headers", l);
+    ctx.stack_.push_back(l);
     ctx.enter(ctx.HTTP_HEADERS);
 }
 #line 4182 "dhcp4_parser.cc"
index 8bc762de500c6d47011698af1dc0e0fd7079e6a6..a12cb4a7e58f7eacffb48cd62a74d06ca0117353 100644 (file)
@@ -2657,6 +2657,7 @@ http_headers: HTTP_HEADERS {
     ctx.unique("http-headers", ctx.loc2pos(@1));
     ElementPtr l(new ListElement(ctx.loc2pos(@1)));
     ctx.stack_.back()->set("http-headers", l);
+    ctx.stack_.push_back(l);
     ctx.enter(ctx.HTTP_HEADERS);
 } COLON LSQUARE_BRACKET http_header_list RSQUARE_BRACKET {
     ctx.stack_.pop_back();
@@ -2690,13 +2691,13 @@ http_header_params: http_header_param
                   ;
 
 http_header_param: name
-                 | value
+                 | header_value
                  | user_context
                  | comment
                  | unknown_map_entry
                  ;
 
-value: VALUE {
+header_value: VALUE {
     ctx.unique("value", ctx.loc2pos(@1));
     ctx.enter(ctx.NO_KEYWORD);
 } COLON STRING {
index a7b925c32f5ab928970a264e43e853d3df00d60a..80eaba0cfd88094a670d021efbfc240149ab64e7 100644 (file)
@@ -4331,6 +4331,7 @@ namespace isc { namespace dhcp {
     ctx.unique("http-headers", ctx.loc2pos(yystack_[0].location));
     ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
     ctx.stack_.back()->set("http-headers", l);
+    ctx.stack_.push_back(l);
     ctx.enter(ctx.HTTP_HEADERS);
 }
 #line 4337 "dhcp6_parser.cc"
index b58f10ac013c3b5e75a7a76fa94a7943c8c284b7..583a85a96f99a082653f436dee1935a3526d0213 100644 (file)
@@ -2799,6 +2799,7 @@ http_headers: HTTP_HEADERS {
     ctx.unique("http-headers", ctx.loc2pos(@1));
     ElementPtr l(new ListElement(ctx.loc2pos(@1)));
     ctx.stack_.back()->set("http-headers", l);
+    ctx.stack_.push_back(l);
     ctx.enter(ctx.HTTP_HEADERS);
 } COLON LSQUARE_BRACKET http_header_list RSQUARE_BRACKET {
     ctx.stack_.pop_back();
@@ -2832,13 +2833,13 @@ http_header_params: http_header_param
                   ;
 
 http_header_param: name
-                 | value
+                 | header_value
                  | user_context
                  | comment
                  | unknown_map_entry
                  ;
 
-value: VALUE {
+header_value: VALUE {
     ctx.unique("value", ctx.loc2pos(@1));
     ctx.enter(ctx.NO_KEYWORD);
 } COLON STRING {