|
306 | 306 | "additionalProperties": false |
307 | 307 | }, |
308 | 308 | "AgentFileConfig": { |
309 | | - "description": "Configuration for the mirrord-agent pod that is spawned in the Kubernetes cluster.\n\n**Note:** this configuration is ignored when using the mirrord Operator. Agent configuration is done by the cluster admin.\n\nWe provide sane defaults for this option, so you don't have to set up anything here.\n\n```json { \"agent\": { \"log_level\": \"info\", \"json_log\": false, \"namespace\": \"default\", \"image\": \"ghcr.io/metalbear-co/mirrord:latest\", \"image_pull_policy\": \"IfNotPresent\", \"image_pull_secrets\": [ { \"secret-key\": \"secret\" } ], \"ttl\": 30, \"ephemeral\": false, \"communication_timeout\": 30, \"startup_timeout\": 360, \"network_interface\": \"eth0\", \"flush_connections\": false, \"exclude_from_mesh\": false \"inject_headers\": false, } } ```", |
| 309 | + "description": "Configuration for the mirrord-agent pod that is spawned in the Kubernetes cluster.\n\n**Note:** this configuration is ignored when using the mirrord Operator. Agent configuration is done by the cluster admin.\n\nWe provide sane defaults for this option, so you don't have to set up anything here.\n\n```json { \"agent\": { \"log_level\": \"info\", \"json_log\": false, \"namespace\": \"default\", \"image\": \"ghcr.io/metalbear-co/mirrord:latest\", \"image_pull_policy\": \"IfNotPresent\", \"image_pull_secrets\": [ { \"secret-key\": \"secret\" } ], \"ttl\": 30, \"ephemeral\": false, \"communication_timeout\": 30, \"startup_timeout\": 360, \"network_interface\": \"eth0\", \"flush_connections\": false, \"exclude_from_mesh\": false \"inject_headers\": false, \"max_body_buffer_size\": 65535, \"max_body_buffer_timeout\": 1000 } } ```", |
310 | 310 | "type": "object", |
311 | 311 | "properties": { |
312 | 312 | "annotations": { |
|
450 | 450 | "null" |
451 | 451 | ] |
452 | 452 | }, |
| 453 | + "max_body_buffer_size": { |
| 454 | + "title": "agent.max_body_buffer_size {#agent-max_body_buffer_size}", |
| 455 | + "description": "Maximum size, in bytes, of HTTP request body buffers. Used for temporarily storing bodies of incoming HTTP requests to run body filters. HTTP body filters will not match any requests with bodies larger than this.", |
| 456 | + "type": [ |
| 457 | + "integer", |
| 458 | + "null" |
| 459 | + ], |
| 460 | + "format": "uint32", |
| 461 | + "minimum": 0.0 |
| 462 | + }, |
| 463 | + "max_body_buffer_timeout": { |
| 464 | + "title": "agent.max_body_buffer_timeout {#agent-max_body_buffer_timeout}", |
| 465 | + "description": "Maximum timeout, in milliseconds, for receiving HTTP request bodies. HTTP body filters will not match any requests whose bodies do not arrive within this timeout.", |
| 466 | + "type": [ |
| 467 | + "integer", |
| 468 | + "null" |
| 469 | + ], |
| 470 | + "format": "uint32", |
| 471 | + "minimum": 0.0 |
| 472 | + }, |
453 | 473 | "metrics": { |
454 | 474 | "title": "agent.metrics {#agent-metrics}", |
455 | 475 | "description": "Enables prometheus metrics for the agent pod.\n\nYou might need to add annotations to the agent pod depending on how prometheus is configured to scrape for metrics.\n\n```json { \"agent\": { \"metrics\": \"0.0.0.0:9000\" } } ```", |
|
615 | 635 | } |
616 | 636 | } |
617 | 637 | }, |
| 638 | + "BodyFilter": { |
| 639 | + "oneOf": [ |
| 640 | + { |
| 641 | + "title": "feature.network.incoming.inner_filter.body_filter.json {#feature-network-incoming-inner-body-filter-json}", |
| 642 | + "description": "Tries to parse the body as a JSON object and find (a) matching subobjects(s).\n\n`query` should be a valid JSONPath (RFC 9535) query string. `matches` should be a regex. Supports regexes validated by the [`fancy-regex`](https://docs.rs/fancy-regex/latest/fancy_regex/) crate\n\nExample: ```json \"http_filter\": { \"body_filter\": { \"body\": \"json\", \"query\": \"$.library.books[*]\", \"matches\": \"^\\\\d{3,5}$\" } } ``` will match ```json { \"library\": { \"books\": [ 34555, 1233, 234 23432 ] } } ```\n\nThe filter will match if there is at least one query result.\n\nNon-string matches are stringified before being compared to the regex. To filter query results by type, the `typeof` [function extension](https://www.rfc-editor.org/rfc/rfc9535.html#name-function-extensions) is provided. It takes in a single `NodesType` parameter and returns `\"null\" | \"bool\" | \"number\" | \"string\" | \"array\" | \"object\"`, depending on the type of the argument. If not all nodes in the argument have the same type, it returns `nothing`.\n\nExample:\n\n```json \"body_filter\": { \"body\": \"json\", \"query\": \"$.books[?(typeof(@) == 'number')]\", \"matches\": \"4$\" } ``` will match\n\n```json { \"books\": [ 1111, 2222, 4444 ] } ```\n\nbut not\n\n```json { \"books\": [ \"1111\", \"2222\", \"4444\" ] } ```\n\nTo use with with `all_of` or `any_of`, use the following syntax: ```json \"http_filter\": { \"all_of\": [ { \"path\": \"/buildings\" }, { \"body\": \"json\", \"query\": \"$.library.books[*]\", \"matches\": \"^\\\\d{3,5}$\" } ] } ```", |
| 643 | + "type": "object", |
| 644 | + "required": [ |
| 645 | + "body", |
| 646 | + "matches", |
| 647 | + "query" |
| 648 | + ], |
| 649 | + "properties": { |
| 650 | + "body": { |
| 651 | + "type": "string", |
| 652 | + "enum": [ |
| 653 | + "json" |
| 654 | + ] |
| 655 | + }, |
| 656 | + "matches": { |
| 657 | + "type": "string" |
| 658 | + }, |
| 659 | + "query": { |
| 660 | + "type": "string" |
| 661 | + } |
| 662 | + } |
| 663 | + } |
| 664 | + ] |
| 665 | + }, |
618 | 666 | "CiFileConfig": { |
619 | 667 | "description": "Configuration for mirrord for CI.\n\n```json { \"ci\": { \"output_dir\": \"/tmp/mirrord/\", } } ```", |
620 | 668 | "type": "object", |
|
1493 | 1541 | "$ref": "#/definitions/InnerFilter" |
1494 | 1542 | } |
1495 | 1543 | }, |
| 1544 | + "body_filter": { |
| 1545 | + "title": "feature.network.incoming.http_filter.body_filter {#feature-network-incoming-http-body-filter}", |
| 1546 | + "description": "Matches the request based on the contents of its body. Currently only JSON body filtering is supported.", |
| 1547 | + "anyOf": [ |
| 1548 | + { |
| 1549 | + "$ref": "#/definitions/BodyFilter" |
| 1550 | + }, |
| 1551 | + { |
| 1552 | + "type": "null" |
| 1553 | + } |
| 1554 | + ] |
| 1555 | + }, |
1496 | 1556 | "header_filter": { |
1497 | 1557 | "title": "feature.network.incoming.http_filter.header_filter {#feature-network-incoming-http-header-filter}", |
1498 | 1558 | "description": "Supports regexes validated by the [`fancy-regex`](https://docs.rs/fancy-regex/latest/fancy_regex/) crate.\n\nThe HTTP traffic feature converts the HTTP headers to `HeaderKey: HeaderValue`, case-insensitive.", |
|
1767 | 1827 | "type": "string" |
1768 | 1828 | } |
1769 | 1829 | } |
| 1830 | + }, |
| 1831 | + { |
| 1832 | + "title": "feature.network.incoming.inner_filter.body_filter {#feature-network-incoming-inner-body-filter}", |
| 1833 | + "description": "Matches the request based on the contents of its body. Currently only JSON body filtering is supported.", |
| 1834 | + "allOf": [ |
| 1835 | + { |
| 1836 | + "$ref": "#/definitions/BodyFilter" |
| 1837 | + } |
| 1838 | + ] |
1770 | 1839 | } |
1771 | 1840 | ] |
1772 | 1841 | }, |
|
0 commit comments