From 2c08f77f51e82be1ceea26b066ccdf5383f521c7 Mon Sep 17 00:00:00 2001 From: Mark S Date: Thu, 30 May 2024 14:26:10 -0400 Subject: [PATCH 1/5] refactor: preliminary name changes to make route types generic Signed-off-by: Mark S --- Cargo.lock | 229 +++++++++--------- policy-controller/core/src/inbound.rs | 2 +- policy-controller/core/src/lib.rs | 2 +- policy-controller/core/src/outbound.rs | 2 +- .../core/src/{http_route.rs => routes.rs} | 0 policy-controller/grpc/src/inbound.rs | 12 +- policy-controller/grpc/src/lib.rs | 2 +- policy-controller/grpc/src/outbound.rs | 14 +- .../grpc/src/{http_route.rs => routes.rs} | 150 ++++++------ policy-controller/k8s/index/src/http_route.rs | 52 ++-- .../index/src/inbound/authorization_policy.rs | 2 +- .../k8s/index/src/inbound/http_route.rs | 2 +- .../k8s/index/src/inbound/index.rs | 2 +- .../src/inbound/tests/authorization_policy.rs | 8 +- .../index/src/inbound/tests/http_routes.rs | 2 +- .../k8s/index/src/outbound/index.rs | 2 +- .../index/src/outbound/tests/http_routes.rs | 2 +- policy-controller/k8s/status/src/index.rs | 2 +- .../k8s/status/src/resource_id.rs | 2 +- .../k8s/status/src/tests/http_routes.rs | 2 +- policy-controller/src/admission.rs | 2 +- 21 files changed, 253 insertions(+), 240 deletions(-) rename policy-controller/core/src/{http_route.rs => routes.rs} (100%) rename policy-controller/grpc/src/{http_route.rs => routes.rs} (54%) diff --git a/Cargo.lock b/Cargo.lock index 98879de1f17e9..351fe43941c82 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -97,7 +97,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -108,7 +108,7 @@ checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -199,9 +199,9 @@ checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "base64" -version = "0.22.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9475866fec1451be56a3c2400fd081ff546538961565ccb5b7142cbd22bc7a51" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "bitflags" @@ -211,9 +211,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" [[package]] name = "block-buffer" @@ -264,7 +264,7 @@ dependencies = [ "iana-time-zone", "num-traits", "serde", - "windows-targets 0.52.0", + "windows-targets 0.52.5", ] [[package]] @@ -296,7 +296,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -370,7 +370,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -381,7 +381,7 @@ checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" dependencies = [ "darling_core", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -550,7 +550,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -631,7 +631,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 2.2.3", + "indexmap 2.2.6", "slab", "tokio", "tokio-util", @@ -646,9 +646,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", "allocator-api2", @@ -842,12 +842,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.3" +version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown 0.14.5", ] [[package]] @@ -906,9 +906,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.58" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3fac17f7123a73ca62df411b1bf727ccc805daa070338fda671c86dac1bdc27" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] @@ -1046,7 +1046,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -1060,7 +1060,7 @@ dependencies = [ "backoff", "derivative", "futures", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "json-patch", "k8s-openapi", "kube-client", @@ -1461,7 +1461,7 @@ version = "0.10.64" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.5.0", "cfg-if", "foreign-types", "libc", @@ -1478,7 +1478,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -1544,7 +1544,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-targets 0.52.0", + "windows-targets 0.52.5", ] [[package]] @@ -1553,7 +1553,7 @@ version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e459365e590736a54c3fa561947c84837534b8e9af6fc5bf781307e82658fae" dependencies = [ - "base64 0.22.0", + "base64 0.22.1", "serde", ] @@ -1594,7 +1594,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -1625,7 +1625,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -1667,7 +1667,7 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "731e0d9356b0c25f16f33b5be79b1c57b562f141ebfcdb0ad8ac2c13a24293b4" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.5.0", "hex", "lazy_static", "procfs-core", @@ -1680,7 +1680,7 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d3554923a69f4ce04c4a754260c338f505ce22642d3830e049a399fc2059a29" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.5.0", "hex", ] @@ -1704,7 +1704,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -1727,7 +1727,7 @@ dependencies = [ "itertools", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -1771,9 +1771,9 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ "getrandom", ] @@ -1784,7 +1784,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.5.0", ] [[package]] @@ -1795,8 +1795,8 @@ checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.4", - "regex-syntax 0.8.2", + "regex-automata 0.4.6", + "regex-syntax 0.8.3", ] [[package]] @@ -1810,13 +1810,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.4" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b7fa1134405e2ec9353fd416b17f8dacd46c473d7d3fd1cf202706a14eb792a" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.2", + "regex-syntax 0.8.3", ] [[package]] @@ -1827,9 +1827,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "ring" @@ -1858,7 +1858,7 @@ version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.5.0", "errno", "libc", "linux-raw-sys", @@ -1950,7 +1950,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -1981,11 +1981,11 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.10.0" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "770452e37cad93e0a50d5abc3990d2bc351c36d0328f86cefec2f2fb206eaef6" +checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.5.0", "core-foundation", "core-foundation-sys", "libc", @@ -2029,7 +2029,7 @@ checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -2040,7 +2040,7 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -2060,7 +2060,7 @@ version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.2.3", + "indexmap 2.2.6", "itoa", "ryu", "serde", @@ -2157,9 +2157,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.48" +version = "2.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" dependencies = [ "proc-macro2", "quote", @@ -2189,7 +2189,7 @@ checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -2254,7 +2254,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -2396,7 +2396,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61c5bb1d698276a2443e5ecfabc1008bf15a36c12e6a7176e7bf089ea9131140" dependencies = [ "base64 0.21.7", - "bitflags 2.4.0", + "bitflags 2.5.0", "bytes", "futures-core", "futures-util", @@ -2442,7 +2442,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -2619,9 +2619,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.81" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c53b543413a17a202f4be280a7e5c62a1c69345f5de525ee64f8cfdbc954994" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -2629,24 +2629,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.81" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5491a68ab4500fa6b4d726bd67408630c3dbe9c4fe7bda16d5c82a1fd8c7340a" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", - "lazy_static", "log", + "once_cell", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.66", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.81" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c441e177922bc58f1e12c022624b6216378e5febc2f0533e41ba443d505b80aa" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2654,22 +2654,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.81" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d94ac45fcf608c1f45ef53e748d35660f168490c10b23704c7779ab8f5c3048" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.66", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.81" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a89911bd99e5f3659ec4acf9c4d93b0a90fe4a2a11f15328472058edc5261be" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "winapi" @@ -2695,11 +2695,11 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-core" -version = "0.51.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b81650771e76355778637954dc9d7eb8d991cd89ad64ba26f21eeb3c22d8d836" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.48.2", + "windows-targets 0.52.5", ] [[package]] @@ -2708,7 +2708,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.2", + "windows-targets 0.48.5", ] [[package]] @@ -2717,37 +2717,38 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.5", ] [[package]] name = "windows-targets" -version = "0.48.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1eeca1c172a285ee6c2c84c341ccea837e7c01b12fbb2d0fe3c9e550ce49ec8" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.2", - "windows_i686_gnu 0.48.2", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.2", + "windows_x86_64_gnu 0.48.5", "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.2", + "windows_x86_64_msvc 0.48.5", ] [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", ] [[package]] @@ -2758,33 +2759,39 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" [[package]] name = "windows_aarch64_msvc" -version = "0.48.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "571d8d4e62f26d4932099a9efe89660e8bd5087775a2ab5cdd8b747b811f1058" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" [[package]] name = "windows_i686_gnu" -version = "0.48.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2229ad223e178db5fbbc8bd8d3835e51e566b8474bfca58d2e6150c48bb723cd" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" [[package]] name = "windows_i686_msvc" @@ -2794,21 +2801,21 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" [[package]] name = "windows_x86_64_gnu" -version = "0.48.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea99ff3f8b49fb7a8e0d305e5aec485bd068c2ba691b6e277d29eaeac945868a" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" [[package]] name = "windows_x86_64_gnullvm" @@ -2818,21 +2825,21 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" [[package]] name = "windows_x86_64_msvc" -version = "0.48.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d419259aba16b663966e29e6d7c6ecfa0bb8425818bb96f6f1f3c3eb71a6e7b9" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "zerocopy" @@ -2851,7 +2858,7 @@ checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] diff --git a/policy-controller/core/src/inbound.rs b/policy-controller/core/src/inbound.rs index 9be4bd6a5f844..a2eb4cff58b5e 100644 --- a/policy-controller/core/src/inbound.rs +++ b/policy-controller/core/src/inbound.rs @@ -1,5 +1,5 @@ use crate::{ - http_route::{ + routes::{ FailureInjectorFilter, GroupKindName, HeaderModifierFilter, HostMatch, HttpRouteMatch, PathMatch, RequestRedirectFilter, }, diff --git a/policy-controller/core/src/lib.rs b/policy-controller/core/src/lib.rs index 22020d7aa4792..67eec7fd7e990 100644 --- a/policy-controller/core/src/lib.rs +++ b/policy-controller/core/src/lib.rs @@ -1,7 +1,7 @@ #![deny(warnings, rust_2018_idioms)] #![forbid(unsafe_code)] -pub mod http_route; +pub mod routes; mod identity_match; pub mod inbound; mod network_match; diff --git a/policy-controller/core/src/outbound.rs b/policy-controller/core/src/outbound.rs index e5162c2317169..18070e7499df9 100644 --- a/policy-controller/core/src/outbound.rs +++ b/policy-controller/core/src/outbound.rs @@ -1,4 +1,4 @@ -use crate::http_route::{ +use crate::routes::{ GroupKindNamespaceName, HeaderModifierFilter, HostMatch, HttpRouteMatch, RequestRedirectFilter, }; use ahash::AHashMap as HashMap; diff --git a/policy-controller/core/src/http_route.rs b/policy-controller/core/src/routes.rs similarity index 100% rename from policy-controller/core/src/http_route.rs rename to policy-controller/core/src/routes.rs diff --git a/policy-controller/grpc/src/inbound.rs b/policy-controller/grpc/src/inbound.rs index 966237ab02493..c1ba6274d0872 100644 --- a/policy-controller/grpc/src/inbound.rs +++ b/policy-controller/grpc/src/inbound.rs @@ -1,4 +1,4 @@ -use crate::{http_route, workload::Workload}; +use crate::{routes, workload::Workload}; use futures::prelude::*; use linkerd2_proxy_api::{ self as api, @@ -382,14 +382,14 @@ fn to_http_route( let hosts = hostnames .into_iter() - .map(http_route::convert_host_match) + .map(routes::convert_host_match) .collect(); let rules = rules .into_iter() .map( |HttpRouteRule { matches, filters }| proto::http_route::Rule { - matches: matches.into_iter().map(http_route::convert_match).collect(), + matches: matches.into_iter().map(routes::http::convert_match).collect(), filters: filters.into_iter().filter_map(convert_filter).collect(), }, ) @@ -413,13 +413,13 @@ fn convert_filter(filter: Filter) -> Option { let kind = match filter { Filter::FailureInjector(f) => Some(Kind::FailureInjector( - http_route::convert_failure_injector_filter(f), + routes::http::convert_failure_injector_filter(f), )), Filter::RequestHeaderModifier(f) => Some(Kind::RequestHeaderModifier( - http_route::convert_request_header_modifier_filter(f), + routes::convert_request_header_modifier_filter(f), )), Filter::ResponseHeaderModifier(_) => None, - Filter::RequestRedirect(f) => Some(Kind::Redirect(http_route::convert_redirect_filter(f))), + Filter::RequestRedirect(f) => Some(Kind::Redirect(routes::convert_redirect_filter(f))), }; kind.map(|kind| proto::http_route::Filter { kind: Some(kind) }) diff --git a/policy-controller/grpc/src/lib.rs b/policy-controller/grpc/src/lib.rs index 834a814729b4c..dd665b0792e31 100644 --- a/policy-controller/grpc/src/lib.rs +++ b/policy-controller/grpc/src/lib.rs @@ -1,7 +1,7 @@ #![deny(warnings, rust_2018_idioms)] #![forbid(unsafe_code)] -mod http_route; +mod routes; pub mod inbound; pub mod outbound; diff --git a/policy-controller/grpc/src/outbound.rs b/policy-controller/grpc/src/outbound.rs index 517d7cd0543bb..ac9d90dab2ff9 100644 --- a/policy-controller/grpc/src/outbound.rs +++ b/policy-controller/grpc/src/outbound.rs @@ -1,4 +1,4 @@ -use crate::{http_route, workload}; +use crate::{routes, workload}; use futures::prelude::*; use linkerd2_proxy_api::{ self as api, destination, @@ -9,7 +9,7 @@ use linkerd2_proxy_api::{ }, }; use linkerd_policy_controller_core::{ - http_route::GroupKindNamespaceName, + routes::GroupKindNamespaceName, outbound::{ Backend, DiscoverOutboundPolicy, Filter, HttpRoute, HttpRouteRule, OutboundDiscoverTarget, OutboundPolicy, OutboundPolicyStream, @@ -316,7 +316,7 @@ fn convert_outbound_http_route( let hosts = hostnames .into_iter() - .map(http_route::convert_host_match) + .map(routes::convert_host_match) .collect(); let rules = rules @@ -351,7 +351,7 @@ fn convert_outbound_http_route( ) }; outbound::http_route::Rule { - matches: matches.into_iter().map(http_route::convert_match).collect(), + matches: matches.into_iter().map(routes::http::convert_match).collect(), backends: Some(outbound::http_route::Distribution { kind: Some(dist) }), filters: filters.into_iter().map(convert_filter).collect(), request_timeout: request_timeout @@ -598,12 +598,12 @@ fn convert_filter(filter: Filter) -> outbound::http_route::Filter { outbound::http_route::Filter { kind: Some(match filter { Filter::RequestHeaderModifier(f) => { - Kind::RequestHeaderModifier(http_route::convert_request_header_modifier_filter(f)) + Kind::RequestHeaderModifier(routes::convert_request_header_modifier_filter(f)) } Filter::ResponseHeaderModifier(f) => { - Kind::ResponseHeaderModifier(http_route::convert_response_header_modifier_filter(f)) + Kind::ResponseHeaderModifier(routes::convert_response_header_modifier_filter(f)) } - Filter::RequestRedirect(f) => Kind::Redirect(http_route::convert_redirect_filter(f)), + Filter::RequestRedirect(f) => Kind::Redirect(routes::convert_redirect_filter(f)), }), } } diff --git a/policy-controller/grpc/src/http_route.rs b/policy-controller/grpc/src/routes.rs similarity index 54% rename from policy-controller/grpc/src/http_route.rs rename to policy-controller/grpc/src/routes.rs index 4b55b045c42dc..335ad7a086f98 100644 --- a/policy-controller/grpc/src/http_route.rs +++ b/policy-controller/grpc/src/routes.rs @@ -1,7 +1,7 @@ use linkerd2_proxy_api::{http_route as proto, http_types}; -use linkerd_policy_controller_core::http_route::{ - FailureInjectorFilter, HeaderMatch, HeaderModifierFilter, HostMatch, HttpRouteMatch, PathMatch, - PathModifier, QueryParamMatch, RequestRedirectFilter, +use linkerd_policy_controller_core::routes::{ + FailureInjectorFilter, HeaderMatch, HeaderModifierFilter, HostMatch, + HttpRouteMatch, PathMatch, PathModifier, QueryParamMatch, RequestRedirectFilter, }; pub(crate) fn convert_host_match(h: HostMatch) -> proto::HostMatch { @@ -17,75 +17,6 @@ pub(crate) fn convert_host_match(h: HostMatch) -> proto::HostMatch { } } -pub(crate) fn convert_match( - HttpRouteMatch { - headers, - path, - query_params, - method, - }: HttpRouteMatch, -) -> proto::HttpRouteMatch { - let headers = headers - .into_iter() - .map(|hm| match hm { - HeaderMatch::Exact(name, value) => proto::HeaderMatch { - name: name.to_string(), - value: Some(proto::header_match::Value::Exact(value.as_bytes().to_vec())), - }, - HeaderMatch::Regex(name, re) => proto::HeaderMatch { - name: name.to_string(), - value: Some(proto::header_match::Value::Regex(re.to_string())), - }, - }) - .collect(); - - let path = path.map(|path| proto::PathMatch { - kind: Some(match path { - PathMatch::Exact(path) => proto::path_match::Kind::Exact(path), - PathMatch::Prefix(prefix) => proto::path_match::Kind::Prefix(prefix), - PathMatch::Regex(regex) => proto::path_match::Kind::Regex(regex.to_string()), - }), - }); - - let query_params = query_params - .into_iter() - .map(|qpm| match qpm { - QueryParamMatch::Exact(name, value) => proto::QueryParamMatch { - name, - value: Some(proto::query_param_match::Value::Exact(value)), - }, - QueryParamMatch::Regex(name, re) => proto::QueryParamMatch { - name, - value: Some(proto::query_param_match::Value::Regex(re.to_string())), - }, - }) - .collect(); - - proto::HttpRouteMatch { - headers, - path, - query_params, - method: method.map(Into::into), - } -} - -pub(crate) fn convert_failure_injector_filter( - FailureInjectorFilter { - status, - message, - ratio, - }: FailureInjectorFilter, -) -> proto::HttpFailureInjector { - proto::HttpFailureInjector { - status: u32::from(status.as_u16()), - message, - ratio: Some(proto::Ratio { - numerator: ratio.numerator, - denominator: ratio.denominator, - }), - } -} - pub(crate) fn convert_request_header_modifier_filter( HeaderModifierFilter { add, set, remove }: HeaderModifierFilter, ) -> proto::RequestHeaderModifier { @@ -160,3 +91,78 @@ pub(crate) fn convert_redirect_filter( status: u32::from(status.unwrap_or_default().as_u16()), } } + +pub(crate) mod http { + use super::{ + proto, FailureInjectorFilter, HeaderMatch, HttpRouteMatch, PathMatch, QueryParamMatch, + }; + + pub(crate) fn convert_match( + HttpRouteMatch { + headers, + path, + query_params, + method, + }: HttpRouteMatch, + ) -> proto::HttpRouteMatch { + let headers = headers + .into_iter() + .map(|hm| match hm { + HeaderMatch::Exact(name, value) => proto::HeaderMatch { + name: name.to_string(), + value: Some(proto::header_match::Value::Exact(value.as_bytes().to_vec())), + }, + HeaderMatch::Regex(name, re) => proto::HeaderMatch { + name: name.to_string(), + value: Some(proto::header_match::Value::Regex(re.to_string())), + }, + }) + .collect(); + + let path = path.map(|path| proto::PathMatch { + kind: Some(match path { + PathMatch::Exact(path) => proto::path_match::Kind::Exact(path), + PathMatch::Prefix(prefix) => proto::path_match::Kind::Prefix(prefix), + PathMatch::Regex(regex) => proto::path_match::Kind::Regex(regex.to_string()), + }), + }); + + let query_params = query_params + .into_iter() + .map(|qpm| match qpm { + QueryParamMatch::Exact(name, value) => proto::QueryParamMatch { + name, + value: Some(proto::query_param_match::Value::Exact(value)), + }, + QueryParamMatch::Regex(name, re) => proto::QueryParamMatch { + name, + value: Some(proto::query_param_match::Value::Regex(re.to_string())), + }, + }) + .collect(); + + proto::HttpRouteMatch { + headers, + path, + query_params, + method: method.map(Into::into), + } + } + + pub(crate) fn convert_failure_injector_filter( + FailureInjectorFilter { + status, + message, + ratio, + }: FailureInjectorFilter, + ) -> proto::HttpFailureInjector { + proto::HttpFailureInjector { + status: u32::from(status.as_u16()), + message, + ratio: Some(proto::Ratio { + numerator: ratio.numerator, + denominator: ratio.denominator, + }), + } + } +} diff --git a/policy-controller/k8s/index/src/http_route.rs b/policy-controller/k8s/index/src/http_route.rs index c25b9be464f8a..f4d1eccdd26ae 100644 --- a/policy-controller/k8s/index/src/http_route.rs +++ b/policy-controller/k8s/index/src/http_route.rs @@ -1,7 +1,7 @@ use anyhow::{anyhow, bail, Result}; use k8s_gateway_api as api; use kube::{Resource, ResourceExt}; -use linkerd_policy_controller_core::http_route::{self, GroupKindName, GroupKindNamespaceName}; +use linkerd_policy_controller_core::routes::{self, GroupKindName, GroupKindNamespaceName}; use linkerd_policy_controller_k8s_api::policy; use std::num::NonZeroU16; @@ -61,7 +61,7 @@ pub fn try_match( query_params, method, }: api::HttpRouteMatch, -) -> Result { +) -> Result { let path = path.map(path_match).transpose()?; let headers = headers @@ -78,10 +78,10 @@ pub fn try_match( let method = method .as_deref() - .map(http_route::Method::try_from) + .map(routes::Method::try_from) .transpose()?; - Ok(http_route::HttpRouteMatch { + Ok(routes::HttpRouteMatch { path, headers, query_params, @@ -89,23 +89,23 @@ pub fn try_match( }) } -pub fn path_match(path_match: api::HttpPathMatch) -> Result { +pub fn path_match(path_match: api::HttpPathMatch) -> Result { match path_match { api::HttpPathMatch::Exact { value } | api::HttpPathMatch::PathPrefix { value } if !value.starts_with('/') => { Err(anyhow!("HttpPathMatch paths must be absolute (begin with `/`); {value:?} is not an absolute path")) } - api::HttpPathMatch::Exact { value } => Ok(http_route::PathMatch::Exact(value)), - api::HttpPathMatch::PathPrefix { value } => Ok(http_route::PathMatch::Prefix(value)), + api::HttpPathMatch::Exact { value } => Ok(routes::PathMatch::Exact(value)), + api::HttpPathMatch::PathPrefix { value } => Ok(routes::PathMatch::Prefix(value)), api::HttpPathMatch::RegularExpression { value } => value .parse() - .map(http_route::PathMatch::Regex) + .map(routes::PathMatch::Regex) .map_err(Into::into), } } -pub fn host_match(hostname: api::Hostname) -> http_route::HostMatch { +pub fn host_match(hostname: api::Hostname) -> routes::HostMatch { if hostname.starts_with("*.") { let mut reverse_labels = hostname .split('.') @@ -113,41 +113,41 @@ pub fn host_match(hostname: api::Hostname) -> http_route::HostMatch { .map(|label| label.to_string()) .collect::>(); reverse_labels.reverse(); - http_route::HostMatch::Suffix { reverse_labels } + routes::HostMatch::Suffix { reverse_labels } } else { - http_route::HostMatch::Exact(hostname) + routes::HostMatch::Exact(hostname) } } -pub fn header_match(header_match: api::HttpHeaderMatch) -> Result { +pub fn header_match(header_match: api::HttpHeaderMatch) -> Result { match header_match { - api::HttpHeaderMatch::Exact { name, value } => Ok(http_route::HeaderMatch::Exact( + api::HttpHeaderMatch::Exact { name, value } => Ok(routes::HeaderMatch::Exact( name.parse()?, value.parse()?, )), api::HttpHeaderMatch::RegularExpression { name, value } => Ok( - http_route::HeaderMatch::Regex(name.parse()?, value.parse()?), + routes::HeaderMatch::Regex(name.parse()?, value.parse()?), ), } } pub fn query_param_match( query_match: api::HttpQueryParamMatch, -) -> Result { +) -> Result { match query_match { api::HttpQueryParamMatch::Exact { name, value } => { - Ok(http_route::QueryParamMatch::Exact(name, value)) + Ok(routes::QueryParamMatch::Exact(name, value)) } api::HttpQueryParamMatch::RegularExpression { name, value } => { - Ok(http_route::QueryParamMatch::Regex(name, value.parse()?)) + Ok(routes::QueryParamMatch::Regex(name, value.parse()?)) } } } pub fn header_modifier( api::HttpRequestHeaderFilter { set, add, remove }: api::HttpRequestHeaderFilter, -) -> Result { - Ok(http_route::HeaderModifierFilter { +) -> Result { + Ok(routes::HeaderModifierFilter { add: add .into_iter() .flatten() @@ -161,7 +161,7 @@ pub fn header_modifier( remove: remove .into_iter() .flatten() - .map(http_route::HeaderName::try_from) + .map(routes::HeaderName::try_from) .collect::>()?, }) } @@ -174,19 +174,19 @@ pub fn req_redirect( port, status_code, }: api::HttpRequestRedirectFilter, -) -> Result { - Ok(http_route::RequestRedirectFilter { +) -> Result { + Ok(routes::RequestRedirectFilter { scheme: scheme.as_deref().map(TryInto::try_into).transpose()?, host: hostname, path: path.map(path_modifier).transpose()?, port: port.and_then(|p| NonZeroU16::try_from(p).ok()), status: status_code - .map(http_route::StatusCode::try_from) + .map(routes::StatusCode::try_from) .transpose()?, }) } -fn path_modifier(path_modifier: api::HttpPathModifier) -> Result { +fn path_modifier(path_modifier: api::HttpPathModifier) -> Result { use api::HttpPathModifier::*; match path_modifier { ReplaceFullPath { @@ -201,11 +201,11 @@ fn path_modifier(path_modifier: api::HttpPathModifier) -> Result { - Ok(http_route::PathModifier::Full(replace_full_path)) + Ok(routes::PathModifier::Full(replace_full_path)) } ReplacePrefixMatch { replace_prefix_match, - } => Ok(http_route::PathModifier::Prefix(replace_prefix_match)), + } => Ok(routes::PathModifier::Prefix(replace_prefix_match)), } } diff --git a/policy-controller/k8s/index/src/inbound/authorization_policy.rs b/policy-controller/k8s/index/src/inbound/authorization_policy.rs index ca061b5fe495f..b0ed3b3bdf04a 100644 --- a/policy-controller/k8s/index/src/inbound/authorization_policy.rs +++ b/policy-controller/k8s/index/src/inbound/authorization_policy.rs @@ -1,5 +1,5 @@ use anyhow::Result; -use linkerd_policy_controller_core::http_route::GroupKindName; +use linkerd_policy_controller_core::routes::GroupKindName; use linkerd_policy_controller_k8s_api::{ self as k8s, policy::{LocalTargetRef, NamespacedTargetRef}, diff --git a/policy-controller/k8s/index/src/inbound/http_route.rs b/policy-controller/k8s/index/src/inbound/http_route.rs index ad326ccb8e615..ec44df0ec0e6f 100644 --- a/policy-controller/k8s/index/src/inbound/http_route.rs +++ b/policy-controller/k8s/index/src/inbound/http_route.rs @@ -2,7 +2,7 @@ use crate::http_route; use ahash::AHashMap as HashMap; use anyhow::{bail, Error, Result}; use k8s_gateway_api as api; -use linkerd_policy_controller_core::http_route::{HttpRouteMatch, Method}; +use linkerd_policy_controller_core::routes::{HttpRouteMatch, Method}; use linkerd_policy_controller_core::inbound::{Filter, HttpRoute, HttpRouteRule}; use linkerd_policy_controller_core::POLICY_CONTROLLER_NAME; use linkerd_policy_controller_k8s_api::{ diff --git a/policy-controller/k8s/index/src/inbound/index.rs b/policy-controller/k8s/index/src/inbound/index.rs index c8a1b47e45d12..c65ac615f973b 100644 --- a/policy-controller/k8s/index/src/inbound/index.rs +++ b/policy-controller/k8s/index/src/inbound/index.rs @@ -18,7 +18,7 @@ use crate::{ use ahash::{AHashMap as HashMap, AHashSet as HashSet}; use anyhow::{anyhow, bail, Result}; use linkerd_policy_controller_core::{ - http_route::{GroupKindName, HttpRouteMatch, Method, PathMatch}, + routes::{GroupKindName, HttpRouteMatch, Method, PathMatch}, inbound::{ AuthorizationRef, ClientAuthentication, ClientAuthorization, HttpRoute, HttpRouteRef, HttpRouteRule, InboundServer, ProxyProtocol, ServerRef, diff --git a/policy-controller/k8s/index/src/inbound/tests/authorization_policy.rs b/policy-controller/k8s/index/src/inbound/tests/authorization_policy.rs index 6fc4224aa582b..567fe48c4d8ab 100644 --- a/policy-controller/k8s/index/src/inbound/tests/authorization_policy.rs +++ b/policy-controller/k8s/index/src/inbound/tests/authorization_policy.rs @@ -1,6 +1,6 @@ use super::*; use k8s_openapi::apimachinery::pkg::apis::meta::v1 as metav1; -use linkerd_policy_controller_core::{http_route, inbound}; +use linkerd_policy_controller_core::{routes, inbound}; #[test] fn links_authorization_policy_with_mtls_name() { @@ -362,14 +362,14 @@ fn authorization_policy_prevents_index_deletion() { reference: ServerRef::Server("srv-8080".to_string()), authorizations: Default::default(), protocol: ProxyProtocol::Http1, - http_routes: hashmap!(HttpRouteRef::Linkerd(http_route::GroupKindName{ + http_routes: hashmap!(HttpRouteRef::Linkerd(routes::GroupKindName{ group: "policy.linkerd.io".into(), kind: "HTTPRoute".into(), name: "route-foo".into(), }) => HttpRoute { rules: vec![inbound::HttpRouteRule { - matches: vec![http_route::HttpRouteMatch { - path: Some(http_route::PathMatch::Prefix("/foo".to_string())), + matches: vec![routes::HttpRouteMatch { + path: Some(routes::PathMatch::Prefix("/foo".to_string())), headers: vec![], query_params: vec![], method: None, diff --git a/policy-controller/k8s/index/src/inbound/tests/http_routes.rs b/policy-controller/k8s/index/src/inbound/tests/http_routes.rs index d5f3a5f20f1f5..95bd6c686d66c 100644 --- a/policy-controller/k8s/index/src/inbound/tests/http_routes.rs +++ b/policy-controller/k8s/index/src/inbound/tests/http_routes.rs @@ -1,7 +1,7 @@ use super::*; use crate::http_route::gkn_for_linkerd_http_route; use linkerd_policy_controller_core::{ - http_route::{HttpRouteMatch, Method, PathMatch}, + routes::{HttpRouteMatch, Method, PathMatch}, POLICY_CONTROLLER_NAME, }; diff --git a/policy-controller/k8s/index/src/outbound/index.rs b/policy-controller/k8s/index/src/outbound/index.rs index ee23bf4d849e5..b5b4a2da2ad5d 100644 --- a/policy-controller/k8s/index/src/outbound/index.rs +++ b/policy-controller/k8s/index/src/outbound/index.rs @@ -7,7 +7,7 @@ use ahash::AHashMap as HashMap; use anyhow::{bail, ensure, Result}; use k8s_gateway_api::{BackendObjectReference, HttpBackendRef, ParentReference}; use linkerd_policy_controller_core::{ - http_route::GroupKindNamespaceName, + routes::GroupKindNamespaceName, outbound::{ Backend, Backoff, FailureAccrual, Filter, HttpRoute, HttpRouteRule, OutboundPolicy, WeightedService, diff --git a/policy-controller/k8s/index/src/outbound/tests/http_routes.rs b/policy-controller/k8s/index/src/outbound/tests/http_routes.rs index 4861b67fd4dc8..3d515a341d1e4 100644 --- a/policy-controller/k8s/index/src/outbound/tests/http_routes.rs +++ b/policy-controller/k8s/index/src/outbound/tests/http_routes.rs @@ -1,7 +1,7 @@ use k8s_gateway_api::BackendRef; use kube::Resource; use linkerd_policy_controller_core::{ - http_route::GroupKindNamespaceName, + routes::GroupKindNamespaceName, outbound::{Backend, WeightedService}, POLICY_CONTROLLER_NAME, }; diff --git a/policy-controller/k8s/status/src/index.rs b/policy-controller/k8s/status/src/index.rs index 8892c269403a7..75d47ed1fef4e 100644 --- a/policy-controller/k8s/status/src/index.rs +++ b/policy-controller/k8s/status/src/index.rs @@ -8,7 +8,7 @@ use chrono::offset::Utc; use chrono::DateTime; use k8s::{NamespaceResourceScope, Resource}; use kubert::lease::Claim; -use linkerd_policy_controller_core::{http_route::GroupKindName, POLICY_CONTROLLER_NAME}; +use linkerd_policy_controller_core::{routes::GroupKindName, POLICY_CONTROLLER_NAME}; use linkerd_policy_controller_k8s_api::{self as k8s, gateway, ResourceExt}; use parking_lot::RwLock; use prometheus_client::{ diff --git a/policy-controller/k8s/status/src/resource_id.rs b/policy-controller/k8s/status/src/resource_id.rs index a3036323d1705..001d3dcd71999 100644 --- a/policy-controller/k8s/status/src/resource_id.rs +++ b/policy-controller/k8s/status/src/resource_id.rs @@ -1,4 +1,4 @@ -use linkerd_policy_controller_core::http_route::GroupKindName; +use linkerd_policy_controller_core::routes::GroupKindName; #[derive(Clone, Debug, Eq, Hash, PartialEq)] pub struct ResourceId { diff --git a/policy-controller/k8s/status/src/tests/http_routes.rs b/policy-controller/k8s/status/src/tests/http_routes.rs index 19fde10a18d19..04fd70719100f 100644 --- a/policy-controller/k8s/status/src/tests/http_routes.rs +++ b/policy-controller/k8s/status/src/tests/http_routes.rs @@ -6,7 +6,7 @@ use crate::{ use gateway::{BackendObjectReference, BackendRef, HttpBackendRef, ParentReference}; use k8s::{Resource, ResourceExt}; use kubert::index::IndexNamespacedResource; -use linkerd_policy_controller_core::{http_route::GroupKindName, POLICY_CONTROLLER_NAME}; +use linkerd_policy_controller_core::{routes::GroupKindName, POLICY_CONTROLLER_NAME}; use linkerd_policy_controller_k8s_api::{self as k8s, gateway, policy::server::Port}; use std::sync::Arc; use tokio::sync::{mpsc, watch}; diff --git a/policy-controller/src/admission.rs b/policy-controller/src/admission.rs index 06ceafbb3c970..76fa39e1e4944 100644 --- a/policy-controller/src/admission.rs +++ b/policy-controller/src/admission.rs @@ -451,7 +451,7 @@ fn validate_match( let _ = path.map(http_route::path_match).transpose()?; let _ = method .as_deref() - .map(core::http_route::Method::try_from) + .map(core::routes::Method::try_from) .transpose()?; for q in query_params.into_iter().flatten() { From b6dbafc4d1b5fc0ad1c98f5abae4d408234632b2 Mon Sep 17 00:00:00 2001 From: Mark S Date: Thu, 30 May 2024 15:16:06 -0400 Subject: [PATCH 2/5] style: cargo fmt Signed-off-by: Mark S --- policy-controller/core/src/inbound.rs | 4 +-- policy-controller/core/src/lib.rs | 2 +- policy-controller/grpc/src/inbound.rs | 5 +++- policy-controller/grpc/src/outbound.rs | 7 ++++-- policy-controller/grpc/src/routes.rs | 4 +-- policy-controller/k8s/index/src/http_route.rs | 25 +++++++------------ .../k8s/index/src/inbound/http_route.rs | 2 +- .../k8s/index/src/inbound/index.rs | 2 +- .../src/inbound/tests/authorization_policy.rs | 2 +- .../k8s/index/src/outbound/index.rs | 2 +- .../index/src/outbound/tests/http_routes.rs | 2 +- 11 files changed, 28 insertions(+), 29 deletions(-) diff --git a/policy-controller/core/src/inbound.rs b/policy-controller/core/src/inbound.rs index a2eb4cff58b5e..7f128a5082922 100644 --- a/policy-controller/core/src/inbound.rs +++ b/policy-controller/core/src/inbound.rs @@ -1,10 +1,10 @@ use crate::{ + identity_match::IdentityMatch, + network_match::NetworkMatch, routes::{ FailureInjectorFilter, GroupKindName, HeaderModifierFilter, HostMatch, HttpRouteMatch, PathMatch, RequestRedirectFilter, }, - identity_match::IdentityMatch, - network_match::NetworkMatch, }; use ahash::AHashMap as HashMap; use anyhow::Result; diff --git a/policy-controller/core/src/lib.rs b/policy-controller/core/src/lib.rs index 67eec7fd7e990..11479bdcca31b 100644 --- a/policy-controller/core/src/lib.rs +++ b/policy-controller/core/src/lib.rs @@ -1,11 +1,11 @@ #![deny(warnings, rust_2018_idioms)] #![forbid(unsafe_code)] -pub mod routes; mod identity_match; pub mod inbound; mod network_match; pub mod outbound; +pub mod routes; pub use self::{identity_match::IdentityMatch, network_match::NetworkMatch}; pub use ipnet::{IpNet, Ipv4Net, Ipv6Net}; diff --git a/policy-controller/grpc/src/inbound.rs b/policy-controller/grpc/src/inbound.rs index c1ba6274d0872..036ddf6cc6e75 100644 --- a/policy-controller/grpc/src/inbound.rs +++ b/policy-controller/grpc/src/inbound.rs @@ -389,7 +389,10 @@ fn to_http_route( .into_iter() .map( |HttpRouteRule { matches, filters }| proto::http_route::Rule { - matches: matches.into_iter().map(routes::http::convert_match).collect(), + matches: matches + .into_iter() + .map(routes::http::convert_match) + .collect(), filters: filters.into_iter().filter_map(convert_filter).collect(), }, ) diff --git a/policy-controller/grpc/src/outbound.rs b/policy-controller/grpc/src/outbound.rs index ac9d90dab2ff9..b7ab0c9436635 100644 --- a/policy-controller/grpc/src/outbound.rs +++ b/policy-controller/grpc/src/outbound.rs @@ -9,11 +9,11 @@ use linkerd2_proxy_api::{ }, }; use linkerd_policy_controller_core::{ - routes::GroupKindNamespaceName, outbound::{ Backend, DiscoverOutboundPolicy, Filter, HttpRoute, HttpRouteRule, OutboundDiscoverTarget, OutboundPolicy, OutboundPolicyStream, }, + routes::GroupKindNamespaceName, }; use std::{net::SocketAddr, num::NonZeroU16, str::FromStr, sync::Arc, time}; @@ -351,7 +351,10 @@ fn convert_outbound_http_route( ) }; outbound::http_route::Rule { - matches: matches.into_iter().map(routes::http::convert_match).collect(), + matches: matches + .into_iter() + .map(routes::http::convert_match) + .collect(), backends: Some(outbound::http_route::Distribution { kind: Some(dist) }), filters: filters.into_iter().map(convert_filter).collect(), request_timeout: request_timeout diff --git a/policy-controller/grpc/src/routes.rs b/policy-controller/grpc/src/routes.rs index 335ad7a086f98..d3b82c415c2e0 100644 --- a/policy-controller/grpc/src/routes.rs +++ b/policy-controller/grpc/src/routes.rs @@ -1,7 +1,7 @@ use linkerd2_proxy_api::{http_route as proto, http_types}; use linkerd_policy_controller_core::routes::{ - FailureInjectorFilter, HeaderMatch, HeaderModifierFilter, HostMatch, - HttpRouteMatch, PathMatch, PathModifier, QueryParamMatch, RequestRedirectFilter, + FailureInjectorFilter, HeaderMatch, HeaderModifierFilter, HostMatch, HttpRouteMatch, PathMatch, + PathModifier, QueryParamMatch, RequestRedirectFilter, }; pub(crate) fn convert_host_match(h: HostMatch) -> proto::HostMatch { diff --git a/policy-controller/k8s/index/src/http_route.rs b/policy-controller/k8s/index/src/http_route.rs index f4d1eccdd26ae..199d6e5617a16 100644 --- a/policy-controller/k8s/index/src/http_route.rs +++ b/policy-controller/k8s/index/src/http_route.rs @@ -121,19 +121,16 @@ pub fn host_match(hostname: api::Hostname) -> routes::HostMatch { pub fn header_match(header_match: api::HttpHeaderMatch) -> Result { match header_match { - api::HttpHeaderMatch::Exact { name, value } => Ok(routes::HeaderMatch::Exact( - name.parse()?, - value.parse()?, - )), - api::HttpHeaderMatch::RegularExpression { name, value } => Ok( - routes::HeaderMatch::Regex(name.parse()?, value.parse()?), - ), + api::HttpHeaderMatch::Exact { name, value } => { + Ok(routes::HeaderMatch::Exact(name.parse()?, value.parse()?)) + } + api::HttpHeaderMatch::RegularExpression { name, value } => { + Ok(routes::HeaderMatch::Regex(name.parse()?, value.parse()?)) + } } } -pub fn query_param_match( - query_match: api::HttpQueryParamMatch, -) -> Result { +pub fn query_param_match(query_match: api::HttpQueryParamMatch) -> Result { match query_match { api::HttpQueryParamMatch::Exact { name, value } => { Ok(routes::QueryParamMatch::Exact(name, value)) @@ -180,9 +177,7 @@ pub fn req_redirect( host: hostname, path: path.map(path_modifier).transpose()?, port: port.and_then(|p| NonZeroU16::try_from(p).ok()), - status: status_code - .map(routes::StatusCode::try_from) - .transpose()?, + status: status_code.map(routes::StatusCode::try_from).transpose()?, }) } @@ -200,9 +195,7 @@ fn path_modifier(path_modifier: api::HttpPathModifier) -> Result { - Ok(routes::PathModifier::Full(replace_full_path)) - } + ReplaceFullPath { replace_full_path } => Ok(routes::PathModifier::Full(replace_full_path)), ReplacePrefixMatch { replace_prefix_match, } => Ok(routes::PathModifier::Prefix(replace_prefix_match)), diff --git a/policy-controller/k8s/index/src/inbound/http_route.rs b/policy-controller/k8s/index/src/inbound/http_route.rs index ec44df0ec0e6f..37b521d1ee300 100644 --- a/policy-controller/k8s/index/src/inbound/http_route.rs +++ b/policy-controller/k8s/index/src/inbound/http_route.rs @@ -2,8 +2,8 @@ use crate::http_route; use ahash::AHashMap as HashMap; use anyhow::{bail, Error, Result}; use k8s_gateway_api as api; -use linkerd_policy_controller_core::routes::{HttpRouteMatch, Method}; use linkerd_policy_controller_core::inbound::{Filter, HttpRoute, HttpRouteRule}; +use linkerd_policy_controller_core::routes::{HttpRouteMatch, Method}; use linkerd_policy_controller_core::POLICY_CONTROLLER_NAME; use linkerd_policy_controller_k8s_api::{ self as k8s, gateway, diff --git a/policy-controller/k8s/index/src/inbound/index.rs b/policy-controller/k8s/index/src/inbound/index.rs index c65ac615f973b..d7771dff6dd55 100644 --- a/policy-controller/k8s/index/src/inbound/index.rs +++ b/policy-controller/k8s/index/src/inbound/index.rs @@ -18,11 +18,11 @@ use crate::{ use ahash::{AHashMap as HashMap, AHashSet as HashSet}; use anyhow::{anyhow, bail, Result}; use linkerd_policy_controller_core::{ - routes::{GroupKindName, HttpRouteMatch, Method, PathMatch}, inbound::{ AuthorizationRef, ClientAuthentication, ClientAuthorization, HttpRoute, HttpRouteRef, HttpRouteRule, InboundServer, ProxyProtocol, ServerRef, }, + routes::{GroupKindName, HttpRouteMatch, Method, PathMatch}, IdentityMatch, Ipv4Net, Ipv6Net, NetworkMatch, }; use linkerd_policy_controller_k8s_api::{ diff --git a/policy-controller/k8s/index/src/inbound/tests/authorization_policy.rs b/policy-controller/k8s/index/src/inbound/tests/authorization_policy.rs index 567fe48c4d8ab..42a3554d106ff 100644 --- a/policy-controller/k8s/index/src/inbound/tests/authorization_policy.rs +++ b/policy-controller/k8s/index/src/inbound/tests/authorization_policy.rs @@ -1,6 +1,6 @@ use super::*; use k8s_openapi::apimachinery::pkg::apis::meta::v1 as metav1; -use linkerd_policy_controller_core::{routes, inbound}; +use linkerd_policy_controller_core::{inbound, routes}; #[test] fn links_authorization_policy_with_mtls_name() { diff --git a/policy-controller/k8s/index/src/outbound/index.rs b/policy-controller/k8s/index/src/outbound/index.rs index b5b4a2da2ad5d..0f14bb229a688 100644 --- a/policy-controller/k8s/index/src/outbound/index.rs +++ b/policy-controller/k8s/index/src/outbound/index.rs @@ -7,11 +7,11 @@ use ahash::AHashMap as HashMap; use anyhow::{bail, ensure, Result}; use k8s_gateway_api::{BackendObjectReference, HttpBackendRef, ParentReference}; use linkerd_policy_controller_core::{ - routes::GroupKindNamespaceName, outbound::{ Backend, Backoff, FailureAccrual, Filter, HttpRoute, HttpRouteRule, OutboundPolicy, WeightedService, }, + routes::GroupKindNamespaceName, }; use linkerd_policy_controller_k8s_api::{policy as api, ResourceExt, Service, Time}; use parking_lot::RwLock; diff --git a/policy-controller/k8s/index/src/outbound/tests/http_routes.rs b/policy-controller/k8s/index/src/outbound/tests/http_routes.rs index 3d515a341d1e4..bc9cd76bf46f8 100644 --- a/policy-controller/k8s/index/src/outbound/tests/http_routes.rs +++ b/policy-controller/k8s/index/src/outbound/tests/http_routes.rs @@ -1,8 +1,8 @@ use k8s_gateway_api::BackendRef; use kube::Resource; use linkerd_policy_controller_core::{ - routes::GroupKindNamespaceName, outbound::{Backend, WeightedService}, + routes::GroupKindNamespaceName, POLICY_CONTROLLER_NAME, }; use tracing::Level; From c0533464362e64f274b4468ca210def5fb56a0b0 Mon Sep 17 00:00:00 2001 From: Mark S Date: Thu, 30 May 2024 15:17:37 -0400 Subject: [PATCH 3/5] revert: revert lock changes Signed-off-by: Mark S --- Cargo.lock | 229 ++++++++++++++++++++++++++--------------------------- 1 file changed, 111 insertions(+), 118 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 351fe43941c82..98879de1f17e9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -97,7 +97,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -108,7 +108,7 @@ checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -199,9 +199,9 @@ checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "base64" -version = "0.22.1" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" +checksum = "9475866fec1451be56a3c2400fd081ff546538961565ccb5b7142cbd22bc7a51" [[package]] name = "bitflags" @@ -211,9 +211,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" [[package]] name = "block-buffer" @@ -264,7 +264,7 @@ dependencies = [ "iana-time-zone", "num-traits", "serde", - "windows-targets 0.52.5", + "windows-targets 0.52.0", ] [[package]] @@ -296,7 +296,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -370,7 +370,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -381,7 +381,7 @@ checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" dependencies = [ "darling_core", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -550,7 +550,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -631,7 +631,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 2.2.6", + "indexmap 2.2.3", "slab", "tokio", "tokio-util", @@ -646,9 +646,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.14.5" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ "ahash", "allocator-api2", @@ -842,12 +842,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.6" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" dependencies = [ "equivalent", - "hashbrown 0.14.5", + "hashbrown 0.14.3", ] [[package]] @@ -906,9 +906,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.69" +version = "0.3.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "c3fac17f7123a73ca62df411b1bf727ccc805daa070338fda671c86dac1bdc27" dependencies = [ "wasm-bindgen", ] @@ -1046,7 +1046,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -1060,7 +1060,7 @@ dependencies = [ "backoff", "derivative", "futures", - "hashbrown 0.14.5", + "hashbrown 0.14.3", "json-patch", "k8s-openapi", "kube-client", @@ -1461,7 +1461,7 @@ version = "0.10.64" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.4.0", "cfg-if", "foreign-types", "libc", @@ -1478,7 +1478,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -1544,7 +1544,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-targets 0.52.5", + "windows-targets 0.52.0", ] [[package]] @@ -1553,7 +1553,7 @@ version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e459365e590736a54c3fa561947c84837534b8e9af6fc5bf781307e82658fae" dependencies = [ - "base64 0.22.1", + "base64 0.22.0", "serde", ] @@ -1594,7 +1594,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -1625,7 +1625,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -1667,7 +1667,7 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "731e0d9356b0c25f16f33b5be79b1c57b562f141ebfcdb0ad8ac2c13a24293b4" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.4.0", "hex", "lazy_static", "procfs-core", @@ -1680,7 +1680,7 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d3554923a69f4ce04c4a754260c338f505ce22642d3830e049a399fc2059a29" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.4.0", "hex", ] @@ -1704,7 +1704,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -1727,7 +1727,7 @@ dependencies = [ "itertools", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -1771,9 +1771,9 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.6.4" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" dependencies = [ "getrandom", ] @@ -1784,7 +1784,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.4.0", ] [[package]] @@ -1795,8 +1795,8 @@ checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.6", - "regex-syntax 0.8.3", + "regex-automata 0.4.4", + "regex-syntax 0.8.2", ] [[package]] @@ -1810,13 +1810,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.6" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +checksum = "3b7fa1134405e2ec9353fd416b17f8dacd46c473d7d3fd1cf202706a14eb792a" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.3", + "regex-syntax 0.8.2", ] [[package]] @@ -1827,9 +1827,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.3" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "ring" @@ -1858,7 +1858,7 @@ version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.4.0", "errno", "libc", "linux-raw-sys", @@ -1950,7 +1950,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -1981,11 +1981,11 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.11.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" +checksum = "770452e37cad93e0a50d5abc3990d2bc351c36d0328f86cefec2f2fb206eaef6" dependencies = [ - "bitflags 2.5.0", + "bitflags 1.3.2", "core-foundation", "core-foundation-sys", "libc", @@ -2029,7 +2029,7 @@ checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -2040,7 +2040,7 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -2060,7 +2060,7 @@ version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.2.6", + "indexmap 2.2.3", "itoa", "ryu", "serde", @@ -2157,9 +2157,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.66" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ "proc-macro2", "quote", @@ -2189,7 +2189,7 @@ checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -2254,7 +2254,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -2396,7 +2396,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61c5bb1d698276a2443e5ecfabc1008bf15a36c12e6a7176e7bf089ea9131140" dependencies = [ "base64 0.21.7", - "bitflags 2.5.0", + "bitflags 2.4.0", "bytes", "futures-core", "futures-util", @@ -2442,7 +2442,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -2619,9 +2619,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "7c53b543413a17a202f4be280a7e5c62a1c69345f5de525ee64f8cfdbc954994" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -2629,24 +2629,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.92" +version = "0.2.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "5491a68ab4500fa6b4d726bd67408630c3dbe9c4fe7bda16d5c82a1fd8c7340a" dependencies = [ "bumpalo", + "lazy_static", "log", - "once_cell", "proc-macro2", "quote", - "syn 2.0.66", + "syn 1.0.109", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "c441e177922bc58f1e12c022624b6216378e5febc2f0533e41ba443d505b80aa" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2654,22 +2654,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "7d94ac45fcf608c1f45ef53e748d35660f168490c10b23704c7779ab8f5c3048" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 1.0.109", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "6a89911bd99e5f3659ec4acf9c4d93b0a90fe4a2a11f15328472058edc5261be" [[package]] name = "winapi" @@ -2695,11 +2695,11 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-core" -version = "0.52.0" +version = "0.51.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +checksum = "b81650771e76355778637954dc9d7eb8d991cd89ad64ba26f21eeb3c22d8d836" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.48.2", ] [[package]] @@ -2708,7 +2708,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.5", + "windows-targets 0.48.2", ] [[package]] @@ -2717,38 +2717,37 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.0", ] [[package]] name = "windows-targets" -version = "0.48.5" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +checksum = "d1eeca1c172a285ee6c2c84c341ccea837e7c01b12fbb2d0fe3c9e550ce49ec8" dependencies = [ "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", + "windows_aarch64_msvc 0.48.2", + "windows_i686_gnu 0.48.2", "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnu 0.48.2", "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", + "windows_x86_64_msvc 0.48.2", ] [[package]] name = "windows-targets" -version = "0.52.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", ] [[package]] @@ -2759,39 +2758,33 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" [[package]] name = "windows_aarch64_msvc" -version = "0.48.5" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +checksum = "571d8d4e62f26d4932099a9efe89660e8bd5087775a2ab5cdd8b747b811f1058" [[package]] name = "windows_aarch64_msvc" -version = "0.52.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" [[package]] name = "windows_i686_gnu" -version = "0.48.5" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +checksum = "2229ad223e178db5fbbc8bd8d3835e51e566b8474bfca58d2e6150c48bb723cd" [[package]] name = "windows_i686_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" [[package]] name = "windows_i686_msvc" @@ -2801,21 +2794,21 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" [[package]] name = "windows_x86_64_gnu" -version = "0.48.5" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +checksum = "ea99ff3f8b49fb7a8e0d305e5aec485bd068c2ba691b6e277d29eaeac945868a" [[package]] name = "windows_x86_64_gnu" -version = "0.52.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" [[package]] name = "windows_x86_64_gnullvm" @@ -2825,21 +2818,21 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" [[package]] name = "windows_x86_64_msvc" -version = "0.48.5" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +checksum = "d419259aba16b663966e29e6d7c6ecfa0bb8425818bb96f6f1f3c3eb71a6e7b9" [[package]] name = "windows_x86_64_msvc" -version = "0.52.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "zerocopy" @@ -2858,7 +2851,7 @@ checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] From e3b1857494fae187a47bd786d9b636247b8bff3a Mon Sep 17 00:00:00 2001 From: Mark S Date: Mon, 3 Jun 2024 19:38:39 -0400 Subject: [PATCH 4/5] fic: resolve merge conflicts Signed-off-by: Mark S --- policy-controller/k8s/status/src/index.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/policy-controller/k8s/status/src/index.rs b/policy-controller/k8s/status/src/index.rs index 5acf9ae884cac..1acacecc84b78 100644 --- a/policy-controller/k8s/status/src/index.rs +++ b/policy-controller/k8s/status/src/index.rs @@ -79,7 +79,7 @@ pub struct Index { /// Maps HttpRoute ids to a list of their parent and backend refs, /// regardless of if those parents have accepted the route. - http_route_refs: HashMap, + route_refs: HashMap, servers: HashSet, services: HashMap, From ebbdb0530ee9c860fa38a539caf0a0d1ed5673e1 Mon Sep 17 00:00:00 2001 From: Mark S Date: Tue, 4 Jun 2024 09:32:54 -0400 Subject: [PATCH 5/5] fix: resolve merge conflict Signed-off-by: Mark S --- policy-controller/k8s/status/src/index.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/policy-controller/k8s/status/src/index.rs b/policy-controller/k8s/status/src/index.rs index 1acacecc84b78..29d146aff9299 100644 --- a/policy-controller/k8s/status/src/index.rs +++ b/policy-controller/k8s/status/src/index.rs @@ -77,7 +77,7 @@ pub struct Index { claims: Receiver>, updates: mpsc::Sender, - /// Maps HttpRoute ids to a list of their parent and backend refs, + /// Maps route ids to a list of their parent and backend refs, /// regardless of if those parents have accepted the route. route_refs: HashMap, servers: HashSet,