)]}'
{"octavia/common/jinja/haproxy/templates/macros.j2":[{"author":{"_account_id":11628,"name":"Michael Johnson","email":"johnsomor@gmail.com","username":"johnsom"},"change_message_id":"9ddb83faa4868d9b6b73c6c7d7bf46d0273fd6c7","unresolved":false,"context_lines":[{"line_number":60,"context_line":""},{"line_number":61,"context_line":"{% macro l7rule_macro(constants, l7rule) %}"},{"line_number":62,"context_line":"    {% if l7rule.type \u003d\u003d constants.L7RULE_TYPE_HOST_NAME %}"},{"line_number":63,"context_line":"        acl {{ l7rule.id }} req.hdr(host) -i {{ l7rule_compare_type_macro("},{"line_number":64,"context_line":"            constants, l7rule.compare_type) }} {{ l7rule.value }}"},{"line_number":65,"context_line":"    {% elif l7rule.type \u003d\u003d constants.L7RULE_TYPE_PATH %}"},{"line_number":66,"context_line":"        acl {{ l7rule.id }} path {{ l7rule_compare_type_macro("}],"source_content_type":"text/x-jinja2","patch_set":9,"id":"bae84128_5c1a2a7e","line":63,"updated":"2016-02-23 02:47:22.000000000","message":"The extra spaces here in front of acl come through in the haproxy.cfg.\nThis didn\u0027t cause a failure for me, but if there is an indented block above, it would cause a failure.","commit_id":"20f65fc896320e4b2a0eaaaab244eb323bf01c27"},{"author":{"_account_id":11685,"name":"Stephen Balukoff","email":"stephen@balukoff.com","username":"sbalukoff"},"change_message_id":"75220b890a269a22b3d1fe80b991ef2329eefda1","unresolved":false,"context_lines":[{"line_number":60,"context_line":""},{"line_number":61,"context_line":"{% macro l7rule_macro(constants, l7rule) %}"},{"line_number":62,"context_line":"    {% if l7rule.type \u003d\u003d constants.L7RULE_TYPE_HOST_NAME %}"},{"line_number":63,"context_line":"        acl {{ l7rule.id }} req.hdr(host) -i {{ l7rule_compare_type_macro("},{"line_number":64,"context_line":"            constants, l7rule.compare_type) }} {{ l7rule.value }}"},{"line_number":65,"context_line":"    {% elif l7rule.type \u003d\u003d constants.L7RULE_TYPE_PATH %}"},{"line_number":66,"context_line":"        acl {{ l7rule.id }} path {{ l7rule_compare_type_macro("}],"source_content_type":"text/x-jinja2","patch_set":9,"id":"bae84128_225e2012","line":63,"in_reply_to":"bae84128_5c1a2a7e","updated":"2016-02-23 02:53:34.000000000","message":"Having those extra spaces in the haproxy config was by design on my part: From what I can tell, haproxy doesn\u0027t care about config indentation (only order) and it makes the generated haproxy.cfg slightly more human readable.","commit_id":"20f65fc896320e4b2a0eaaaab244eb323bf01c27"},{"author":{"_account_id":11628,"name":"Michael Johnson","email":"johnsomor@gmail.com","username":"johnsom"},"change_message_id":"51ca4dcab171188c8bcbd0aebef452690bd364e9","unresolved":false,"context_lines":[{"line_number":99,"context_line":"        {{- l7rule_macro(constants, l7rule) -}}"},{"line_number":100,"context_line":"    {% endfor %}"},{"line_number":101,"context_line":"    {% if l7policy.action \u003d\u003d constants.L7POLICY_ACTION_REJECT %}"},{"line_number":102,"context_line":"    http-request deny if{{ l7rule_list_macro(l7policy) }}"},{"line_number":103,"context_line":"    {% elif l7policy.action \u003d\u003d constants.L7POLICY_ACTION_REDIRECT_TO_URL %}"},{"line_number":104,"context_line":"    redirect location {{ l7policy.redirect_url }} if{{ l7rule_list_macro("},{"line_number":105,"context_line":"        l7policy) }}"}],"source_content_type":"text/x-jinja2","patch_set":9,"id":"bae84128_a2ea30aa","line":102,"updated":"2016-02-23 03:11:58.000000000","message":"This doesn\u0027t seem to work.\nAs I add rules to the policy, new ACLs are create for each rule instead of adding them to the ACL.  Then this line gets ACL UUIDs appended (long lines I don\u0027t expect will scale)\nHowever, the later rules do not trigger.\nGist with details:\nhttps://gist.github.com/johnsom/28164bbf9f4ba9a2be4a","commit_id":"20f65fc896320e4b2a0eaaaab244eb323bf01c27"},{"author":{"_account_id":11685,"name":"Stephen Balukoff","email":"stephen@balukoff.com","username":"sbalukoff"},"change_message_id":"0c8e9f75a5919920c231007f1481e6cf2086db1a","unresolved":false,"context_lines":[{"line_number":99,"context_line":"        {{- l7rule_macro(constants, l7rule) -}}"},{"line_number":100,"context_line":"    {% endfor %}"},{"line_number":101,"context_line":"    {% if l7policy.action \u003d\u003d constants.L7POLICY_ACTION_REJECT %}"},{"line_number":102,"context_line":"    http-request deny if{{ l7rule_list_macro(l7policy) }}"},{"line_number":103,"context_line":"    {% elif l7policy.action \u003d\u003d constants.L7POLICY_ACTION_REDIRECT_TO_URL %}"},{"line_number":104,"context_line":"    redirect location {{ l7policy.redirect_url }} if{{ l7rule_list_macro("},{"line_number":105,"context_line":"        l7policy) }}"}],"source_content_type":"text/x-jinja2","patch_set":9,"id":"bae84128_5a3dcbdb","line":102,"in_reply_to":"bae84128_311aba17","updated":"2016-02-24 04:04:46.000000000","message":"Just ran that test--  I was able to add 53 rules before haproxy refused to load the config. And looking closely at the config that failed, it appears that haproxy will stop parsing after 2048 characters in a line. Also, I wasn\u0027t able to extend the parsing to the next line using a trailing backslash like you can do in some config files. So 53 might be our effective \"hard limit\" if we\u0027re using UUIDs for the rule names.\n\nHonestly, I would be very surprised to see anyone adding more than 4 rules to an l7policy, let alone 50+. Still, we could add a validation that disallows adding more than 50 rules. Think it\u0027s worthwhile to do so?","commit_id":"20f65fc896320e4b2a0eaaaab244eb323bf01c27"},{"author":{"_account_id":11628,"name":"Michael Johnson","email":"johnsomor@gmail.com","username":"johnsom"},"change_message_id":"d6afb71445fb48993179650940917a9112710b09","unresolved":false,"context_lines":[{"line_number":99,"context_line":"        {{- l7rule_macro(constants, l7rule) -}}"},{"line_number":100,"context_line":"    {% endfor %}"},{"line_number":101,"context_line":"    {% if l7policy.action \u003d\u003d constants.L7POLICY_ACTION_REJECT %}"},{"line_number":102,"context_line":"    http-request deny if{{ l7rule_list_macro(l7policy) }}"},{"line_number":103,"context_line":"    {% elif l7policy.action \u003d\u003d constants.L7POLICY_ACTION_REDIRECT_TO_URL %}"},{"line_number":104,"context_line":"    redirect location {{ l7policy.redirect_url }} if{{ l7rule_list_macro("},{"line_number":105,"context_line":"        l7policy) }}"}],"source_content_type":"text/x-jinja2","patch_set":9,"id":"bae84128_311aba17","line":102,"in_reply_to":"bae84128_7f6556b3","updated":"2016-02-23 21:34:31.000000000","message":"Ok, functionality is confirmed.\nI would like to see a test run to see how many ACLs haproxy can handle on a line.  Just so we have an idea of the limit.","commit_id":"20f65fc896320e4b2a0eaaaab244eb323bf01c27"},{"author":{"_account_id":11685,"name":"Stephen Balukoff","email":"stephen@balukoff.com","username":"sbalukoff"},"change_message_id":"db0fc72519755e48a5250f51bcbb79b77c470327","unresolved":false,"context_lines":[{"line_number":99,"context_line":"        {{- l7rule_macro(constants, l7rule) -}}"},{"line_number":100,"context_line":"    {% endfor %}"},{"line_number":101,"context_line":"    {% if l7policy.action \u003d\u003d constants.L7POLICY_ACTION_REJECT %}"},{"line_number":102,"context_line":"    http-request deny if{{ l7rule_list_macro(l7policy) }}"},{"line_number":103,"context_line":"    {% elif l7policy.action \u003d\u003d constants.L7POLICY_ACTION_REDIRECT_TO_URL %}"},{"line_number":104,"context_line":"    redirect location {{ l7policy.redirect_url }} if{{ l7rule_list_macro("},{"line_number":105,"context_line":"        l7policy) }}"}],"source_content_type":"text/x-jinja2","patch_set":9,"id":"bae84128_7f6556b3","line":102,"in_reply_to":"bae84128_a2ea30aa","updated":"2016-02-23 08:58:14.000000000","message":"Michael-- in the gist you have created multiple mutually-exclusive rules on a single policy, which is why the policy is not executing. It is impossible for a path to start with \"/frog\" \"dog\" and \"foobar\" all at the same time. Haproxy will load such a configuration just fine, but like the if statement \"if False \u003d\u003d True\" whatever follows is just not going to get executed.\n\nAlso, each \"acl\" line is an L7rule, and then the following \"http-request deny if\" line is the policy. And listing the acl names in order on that line is exactly as the haproxy configuration documents specify that you create a logical AND between the rules! I am not aware of a particular limit on the length of a haproxy config line, but I also anticipate the most policies will probably consist of at most 1-4 rules because there generally just isn\u0027t a need for more than that to express the logic you\u0027re after in 99.9999% of the cases.\n\nI know the logic of how this L7 stuff works seems pretty complicated at first: I have it in my mind to write something for our documentation which gives examples of the most commonly-used L7 stuff people will probably want to do (based on our experience with what clients actually do with them at Blue Box).","commit_id":"20f65fc896320e4b2a0eaaaab244eb323bf01c27"}],"octavia/common/templates/haproxy/jinja_cfg.py":[{"author":{"_account_id":11302,"name":"Phillip Toohill","email":"phillip.toohill@rackspace.com","username":"ptoohill1"},"change_message_id":"70eb568c80545efa729e8d19927842d95340b7a8","unresolved":false,"context_lines":[{"line_number":3,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":4,"context_line":"#    not use this file except in compliance with the License. You may obtain"},{"line_number":5,"context_line":"#    a copy of the License at"},{"line_number":6,"context_line":"#"},{"line_number":7,"context_line":"#         http://www.apache.org/licenses/LICENSE-2.0"},{"line_number":8,"context_line":"#"},{"line_number":9,"context_line":"#    Unless required by applicable law or agreed to in writing, software"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a57f1b5_138773d8","line":6,"updated":"2016-02-10 20:23:42.000000000","message":"I think this file should be renamed to be slightly more specific since they all live together now. Maybe \u0027haproxy_jinja_cfg\u0027? Maybe we can remove the \u0027jinja\u0027 from the names too since that\u0027s slightly redundant. In either case this is -1 for file name.","commit_id":"31f8e63b2aeae85d3fdd9ee7f1de96eb91c90101"}]}
