diff --git a/Cargo.lock b/Cargo.lock index c8b86ad44..ae2446c69 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -725,7 +725,7 @@ dependencies = [ "serde_json", "serde_repr", "serde_urlencoded", - "thiserror", + "thiserror 1.0.68", "tokio", "tokio-util", "tower-service", @@ -824,7 +824,7 @@ dependencies = [ "semver", "serde", "serde_json", - "thiserror", + "thiserror 1.0.68", ] [[package]] @@ -1002,18 +1002,17 @@ checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "common-multipart-rfc7578" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22328b3864f1d8dbe7036f3f2fdfdcb1f367af43dca418943d396fbf8c4b8021" +version = "0.6.0" +source = "git+https://github.com/jothan/rust-hyper-multipart-rfc7578.git?rev=4d3064a7a8c0062b485d50e4460cb7ad71c83d35#4d3064a7a8c0062b485d50e4460cb7ad71c83d35" dependencies = [ "bytes", "futures-core", "futures-util", - "http 0.2.12", + "http 1.1.0", "mime", "mime_guess", "rand", - "thiserror", + "thiserror 1.0.68", ] [[package]] @@ -1077,6 +1076,16 @@ dependencies = [ "libc", ] +[[package]] +name = "core-foundation" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b55271e5c8c478ad3f38ad24ef34923091e0548492a266d19b3c0b4d82574c63" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -1382,7 +1391,6 @@ dependencies = [ "ddcommon-ffi", "ddcommon-net1", "function_name", - "hyper 0.14.31", "libc", "symbolic-common", "symbolic-demangle", @@ -1521,15 +1529,11 @@ dependencies = [ "criterion", "datadog-alloc", "ddcommon", - "ddcommon-net1", + "ddcommon-net2", "derivative", "futures", - "futures-core", - "futures-util", "hashbrown 0.14.5", - "http 0.2.12", - "http-body 0.4.6", - "hyper 0.14.31", + "http-body-util", "hyper-multipart-rfc7578", "indexmap 2.6.0", "libc", @@ -1539,6 +1543,7 @@ dependencies = [ "percent-encoding", "prost 0.12.6", "rustc-hash 1.1.0", + "rustls-native-certs 0.8.1", "serde", "serde_json", "tokio", @@ -1557,9 +1562,9 @@ dependencies = [ "datadog-profiling", "ddcommon", "ddcommon-ffi", - "ddcommon-net1", "ddtelemetry-ffi", "futures", + "http-body-util", "hyper 0.14.31", "libc", "serde_json", @@ -1860,7 +1865,6 @@ dependencies = [ "crossbeam-queue", "ddcommon", "ddcommon-net1", - "hyper 0.14.31", "serde", ] @@ -1888,6 +1892,23 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "ddcommon-net2" +version = "14.3.1" +dependencies = [ + "ddcommon", + "hex", + "hyper 1.5.0", + "hyper-util", + "rustls-native-certs 0.8.1", + "serde", + "thiserror 2.0.11", + "tokio", + "tokio-rustls 0.26.0", + "tokio-util", + "webpki-roots", +] + [[package]] name = "ddsketch-agent" version = "0.1.0" @@ -2088,7 +2109,7 @@ dependencies = [ "reqwest", "serde", "serde_json", - "thiserror", + "thiserror 1.0.68", "tokio", "tokio-util", "tracing", @@ -2799,15 +2820,14 @@ dependencies = [ [[package]] name = "hyper-multipart-rfc7578" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63ca8108ac0ae98d310d41cddb11c6b822e8aca865dbe421366934e6f7f72e10" +version = "0.8.0" +source = "git+https://github.com/jothan/rust-hyper-multipart-rfc7578.git?rev=4d3064a7a8c0062b485d50e4460cb7ad71c83d35#4d3064a7a8c0062b485d50e4460cb7ad71c83d35" dependencies = [ "bytes", "common-multipart-rfc7578", "futures-core", - "http 0.2.12", - "hyper 0.14.31", + "http 1.1.0", + "hyper 1.5.0", ] [[package]] @@ -2891,7 +2911,7 @@ dependencies = [ "hyper 1.5.0", "hyper-util", "rustls 0.23.18", - "rustls-native-certs 0.8.0", + "rustls-native-certs 0.8.1", "rustls-pki-types", "tokio", "tokio-rustls 0.26.0", @@ -3711,7 +3731,7 @@ dependencies = [ "percent-encoding", "pin-project", "rand", - "thiserror", + "thiserror 1.0.68", "tokio", "tokio-stream", ] @@ -3726,7 +3746,7 @@ dependencies = [ "lazy_static", "opentelemetry", "opentelemetry-semantic-conventions", - "thiserror", + "thiserror 1.0.68", "thrift", "tokio", ] @@ -4256,7 +4276,7 @@ dependencies = [ "bytes", "once_cell", "protobuf-support", - "thiserror", + "thiserror 1.0.68", ] [[package]] @@ -4271,7 +4291,7 @@ dependencies = [ "protobuf-parse", "regex", "tempfile", - "thiserror", + "thiserror 1.0.68", ] [[package]] @@ -4286,7 +4306,7 @@ dependencies = [ "protobuf", "protobuf-support", "tempfile", - "thiserror", + "thiserror 1.0.68", "which", ] @@ -4296,7 +4316,7 @@ version = "3.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b088fd20b938a875ea00843b6faf48579462630015c3788d397ad6a786663252" dependencies = [ - "thiserror", + "thiserror 1.0.68", ] [[package]] @@ -4375,7 +4395,7 @@ dependencies = [ "rustc-hash 2.0.0", "rustls 0.23.18", "socket2", - "thiserror", + "thiserror 1.0.68", "tokio", "tracing", ] @@ -4392,7 +4412,7 @@ dependencies = [ "rustc-hash 2.0.0", "rustls 0.23.18", "slab", - "thiserror", + "thiserror 1.0.68", "tinyvec", "tracing", ] @@ -4496,7 +4516,7 @@ checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom", "libredox", - "thiserror", + "thiserror 1.0.68", ] [[package]] @@ -4742,6 +4762,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c9cc1d47e243d655ace55ed38201c19ae02c148ae56412ab8750e8f0166ab7f" dependencies = [ "aws-lc-rs", + "log", "once_cell", "ring 0.17.8", "rustls-pki-types", @@ -4759,7 +4780,7 @@ dependencies = [ "openssl-probe", "rustls 0.19.1", "schannel", - "security-framework", + "security-framework 2.11.1", ] [[package]] @@ -4772,20 +4793,19 @@ dependencies = [ "rustls-pemfile", "rustls-pki-types", "schannel", - "security-framework", + "security-framework 2.11.1", ] [[package]] name = "rustls-native-certs" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcaf18a4f2be7326cd874a5fa579fae794320a0f388d365dca7e480e55f83f8a" +checksum = "7fcff2dd52b58a8d98a70243663a0d234c4e2b79235637849d15913394a247d3" dependencies = [ "openssl-probe", - "rustls-pemfile", "rustls-pki-types", "schannel", - "security-framework", + "security-framework 3.2.0", ] [[package]] @@ -4840,7 +4860,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a15e661f0f9dac21f3494fe5d23a6338c0ac116a2d22c2b63010acd89467ffe" dependencies = [ "byteorder", - "thiserror", + "thiserror 1.0.68", "twox-hash", ] @@ -4915,7 +4935,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ "bitflags 2.6.0", - "core-foundation", + "core-foundation 0.9.4", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271720403f46ca04f7ba6f55d438f8bd878d6b8ca0a1046e8228c4145bcbb316" +dependencies = [ + "bitflags 2.6.0", + "core-foundation 0.10.0", "core-foundation-sys", "libc", "security-framework-sys", @@ -4923,9 +4956,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.12.0" +version = "2.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" +checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" dependencies = [ "core-foundation-sys", "libc", @@ -5483,7 +5516,7 @@ dependencies = [ "serde_bytes", "static_assertions", "tarpc-plugins", - "thiserror", + "thiserror 1.0.68", "tokio", "tokio-serde", "tokio-util", @@ -5591,7 +5624,7 @@ dependencies = [ "serde", "serde_json", "serde_with", - "thiserror", + "thiserror 1.0.68", "tokio", "tokio-stream", "tokio-util", @@ -5604,7 +5637,16 @@ version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "02dd99dc800bbb97186339685293e1cc5d9df1f8fae2d0aecd9ff1c77efea892" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.68", +] + +[[package]] +name = "thiserror" +version = "2.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" +dependencies = [ + "thiserror-impl 2.0.11", ] [[package]] @@ -5618,6 +5660,17 @@ dependencies = [ "syn 2.0.87", ] +[[package]] +name = "thiserror-impl" +version = "2.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "thread_local" version = "1.1.8" diff --git a/Cargo.toml b/Cargo.toml index 592b908a0..52f5467d5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,6 +13,7 @@ members = [ "ddcommon", "ddcommon-ffi", "ddcommon-net1", + "ddcommon-net2", "ddtelemetry", "ddtelemetry-ffi", "dogstatsd", @@ -67,7 +68,7 @@ debug = 2 # full debug info [profile.release] codegen-units = 1 -debug = "line-tables-only" +debug = "full" # todo: revert this back to line tables only lto = true opt-level = "s" # optimize for size diff --git a/LICENSE-3rdparty.yml b/LICENSE-3rdparty.yml index b819f086f..0d208d882 100644 --- a/LICENSE-3rdparty.yml +++ b/LICENSE-3rdparty.yml @@ -1,4 +1,4 @@ -root_name: datadog-alloc, builder, build_common, tools, datadog-crashtracker, ddcommon, ddcommon-net1, ddtelemetry, datadog-ddsketch, datadog-crashtracker-ffi, ddcommon-ffi, datadog-profiling, datadog-profiling-ffi, data-pipeline-ffi, data-pipeline, datadog-trace-normalization, datadog-trace-protobuf, datadog-trace-obfuscation, datadog-trace-utils, tinybytes, dogstatsd-client, datadog-library-config-ffi, datadog-library-config, ddtelemetry-ffi, symbolizer-ffi, datadog-profiling-replayer, dogstatsd, datadog-ipc, datadog-ipc-macros, tarpc, tarpc-plugins, spawn_worker, cc_utils, datadog-live-debugger, datadog-live-debugger-ffi, datadog-remote-config, datadog-dynamic-configuration, datadog-sidecar, datadog-sidecar-macros, datadog-sidecar-ffi, sidecar_mockgen, test_spawn_from_lib, datadog-serverless-trace-mini-agent, datadog-trace-mini-agent +root_name: datadog-alloc, builder, build_common, tools, datadog-crashtracker, ddcommon, ddcommon-net1, ddtelemetry, datadog-ddsketch, datadog-crashtracker-ffi, ddcommon-ffi, datadog-profiling, ddcommon-net2, datadog-profiling-ffi, data-pipeline-ffi, data-pipeline, datadog-trace-normalization, datadog-trace-protobuf, datadog-trace-obfuscation, datadog-trace-utils, tinybytes, dogstatsd-client, datadog-library-config-ffi, datadog-library-config, ddtelemetry-ffi, symbolizer-ffi, datadog-profiling-replayer, dogstatsd, datadog-ipc, datadog-ipc-macros, tarpc, tarpc-plugins, spawn_worker, cc_utils, datadog-live-debugger, datadog-live-debugger-ffi, datadog-remote-config, datadog-dynamic-configuration, datadog-sidecar, datadog-sidecar-macros, datadog-sidecar-ffi, sidecar_mockgen, test_spawn_from_lib, datadog-serverless-trace-mini-agent, datadog-trace-mini-agent third_party_libraries: - package_name: addr2line package_version: 0.24.2 @@ -7006,14 +7006,37 @@ third_party_libraries: limitations under the License. - package_name: common-multipart-rfc7578 - package_version: 0.5.0 + package_version: 0.6.0 repository: https://github.com/ferristseng/rust-multipart-rfc7578 license: MIT OR Apache-2.0 licenses: - license: MIT - text: NOT FOUND + text: | + Permission is hereby granted, free of charge, to any + person obtaining a copy of this software and associated + documentation files (the "Software"), to deal in the + Software without restriction, including without + limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of + the Software, and to permit persons to whom the Software + is furnished to do so, subject to the following + conditions: + + The above copyright notice and this permission notice + shall be included in all copies or substantial portions + of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF + ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED + TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT + SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR + IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. - license: Apache-2.0 - text: NOT FOUND + text: " Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n" - package_name: concurrent-queue package_version: 2.5.0 repository: https://github.com/smol-rs/concurrent-queue @@ -7307,6 +7330,40 @@ third_party_libraries: DEALINGS IN THE SOFTWARE. - license: Apache-2.0 text: " Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n" +- package_name: core-foundation + package_version: 0.10.0 + repository: https://github.com/servo/core-foundation-rs + license: MIT OR Apache-2.0 + licenses: + - license: MIT + text: | + Copyright (c) 2012-2013 Mozilla Foundation + + Permission is hereby granted, free of charge, to any + person obtaining a copy of this software and associated + documentation files (the "Software"), to deal in the + Software without restriction, including without + limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of + the Software, and to permit persons to whom the Software + is furnished to do so, subject to the following + conditions: + + The above copyright notice and this permission notice + shall be included in all copies or substantial portions + of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF + ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED + TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT + SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR + IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + - license: Apache-2.0 + text: " Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n" - package_name: core-foundation-sys package_version: 0.8.7 repository: https://github.com/servo/core-foundation-rs @@ -13307,14 +13364,37 @@ third_party_libraries: OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - package_name: hyper-multipart-rfc7578 - package_version: 0.7.0 + package_version: 0.8.0 repository: https://github.com/ferristseng/rust-multipart-rfc7578 license: MIT OR Apache-2.0 licenses: - license: MIT - text: NOT FOUND + text: | + Permission is hereby granted, free of charge, to any + person obtaining a copy of this software and associated + documentation files (the "Software"), to deal in the + Software without restriction, including without + limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of + the Software, and to permit persons to whom the Software + is furnished to do so, subject to the following + conditions: + + The above copyright notice and this permission notice + shall be included in all copies or substantial portions + of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF + ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED + TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT + SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR + IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. - license: Apache-2.0 - text: NOT FOUND + text: " Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n" - package_name: hyper-named-pipe package_version: 0.1.0 repository: https://github.com/fussybeaver/hyper-named-pipe @@ -23183,7 +23263,7 @@ third_party_libraries: IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - package_name: rustls-native-certs - package_version: 0.8.0 + package_version: 0.8.1 repository: https://github.com/rustls/rustls-native-certs license: Apache-2.0 OR ISC OR MIT licenses: @@ -23972,8 +24052,37 @@ third_party_libraries: CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - license: Apache-2.0 text: " Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n" +- package_name: security-framework + package_version: 3.2.0 + repository: https://github.com/kornelski/rust-security-framework + license: MIT OR Apache-2.0 + licenses: + - license: MIT + text: | + The MIT License (MIT) + + Copyright (c) 2015 Steven Fackler + + Permission is hereby granted, free of charge, to any person obtaining a copy of + this software and associated documentation files (the "Software"), to deal in + the Software without restriction, including without limitation the rights to + use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + the Software, and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + - license: Apache-2.0 + text: " Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n" - package_name: security-framework-sys - package_version: 2.12.0 + package_version: 2.14.0 repository: https://github.com/kornelski/rust-security-framework license: MIT OR Apache-2.0 licenses: @@ -29073,8 +29182,424 @@ third_party_libraries: of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS -- package_name: thiserror-impl - package_version: 1.0.68 +- package_name: thiserror + package_version: 2.0.11 + repository: https://github.com/dtolnay/thiserror + license: MIT OR Apache-2.0 + licenses: + - license: MIT + text: | + Permission is hereby granted, free of charge, to any + person obtaining a copy of this software and associated + documentation files (the "Software"), to deal in the + Software without restriction, including without + limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of + the Software, and to permit persons to whom the Software + is furnished to do so, subject to the following + conditions: + + The above copyright notice and this permission notice + shall be included in all copies or substantial portions + of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF + ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED + TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT + SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR + IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + - license: Apache-2.0 + text: |2 + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS +- package_name: thiserror-impl + package_version: 1.0.68 + repository: https://github.com/dtolnay/thiserror + license: MIT OR Apache-2.0 + licenses: + - license: MIT + text: | + Permission is hereby granted, free of charge, to any + person obtaining a copy of this software and associated + documentation files (the "Software"), to deal in the + Software without restriction, including without + limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of + the Software, and to permit persons to whom the Software + is furnished to do so, subject to the following + conditions: + + The above copyright notice and this permission notice + shall be included in all copies or substantial portions + of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF + ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED + TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT + SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR + IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + - license: Apache-2.0 + text: |2 + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS +- package_name: thiserror-impl + package_version: 2.0.11 repository: https://github.com/dtolnay/thiserror license: MIT OR Apache-2.0 licenses: diff --git a/README.md b/README.md index 71c94a991..aa5cbbf06 100644 --- a/README.md +++ b/README.md @@ -37,8 +37,8 @@ LIBDD_OUTPUT_FOLDER=/opt/release cargo build -p builder --features profiling,tel ``` #### Build scripts -This is the non-prefered way of building a release, it's use is discouraged and it will be soon deprecated in favour of -using the builder crate. +This is the non-preferred way of building a release, it's use is discouraged and it will be soon deprecated in favour +of using the builder crate. To package a release with the generated ffi header and CMake module, use the `build-profiling-ffi.sh` / `build-telemetry-ffi.sh` helper scripts. Here's an example of using on of these scripts, placing the output inside `/opt/libdatadog`: diff --git a/crashtracker-ffi/Cargo.toml b/crashtracker-ffi/Cargo.toml index 1551318a4..2c48def1d 100644 --- a/crashtracker-ffi/Cargo.toml +++ b/crashtracker-ffi/Cargo.toml @@ -29,7 +29,6 @@ datadog-crashtracker = { path = "../crashtracker" } ddcommon = { path = "../ddcommon" } ddcommon-ffi = { path = "../ddcommon-ffi", default-features = false } ddcommon-net1 = { path = "../ddcommon-net1" } -hyper = {version = "0.14", features = ["backports", "deprecated"], default-features = false} symbolic-demangle = { version = "12.8.0", default-features = false, features = ["rust", "cpp", "msvc"], optional = true } symbolic-common = { version = "12.8.0", default-features = false, optional = true } function_name = "0.3.0" diff --git a/ddcommon-ffi/Cargo.toml b/ddcommon-ffi/Cargo.toml index 2a5a1c9fa..b0a4bbe48 100644 --- a/ddcommon-ffi/Cargo.toml +++ b/ddcommon-ffi/Cargo.toml @@ -24,7 +24,6 @@ chrono = { version = "0.4.38", features = ["std"] } crossbeam-queue = "0.3.11" ddcommon = { path = "../ddcommon" } ddcommon-net1 = { path = "../ddcommon-net1" } -hyper = {version = "0.14", features = ["backports", "deprecated"], default-features = false} serde = "1.0" [dev-dependencies] diff --git a/ddcommon-ffi/src/endpoint.rs b/ddcommon-ffi/src/endpoint.rs index 186ac9ff2..e4df1436f 100644 --- a/ddcommon-ffi/src/endpoint.rs +++ b/ddcommon-ffi/src/endpoint.rs @@ -3,12 +3,13 @@ use crate::slice::AsBytes; use crate::Error; -use hyper::http::uri::{Authority, Parts}; -use std::borrow::Cow; -use std::str::FromStr; - use ddcommon_net1 as net; +use ddcommon_net1::dep::http; + +use http::uri::{Authority, Parts}; use net::parse_uri; +use std::borrow::Cow; +use std::str::FromStr; /// Wrapper type to generate the correct FFI name. pub struct Endpoint(net::Endpoint); @@ -49,7 +50,7 @@ pub extern "C" fn ddog_endpoint_from_api_key(api_key: crate::CharSlice) -> Box Self { DEFAULT_CONNECTOR.clone() @@ -123,6 +133,7 @@ fn build_https_connector_with_webpki_roots( #[cfg(not(feature = "use_webpki_roots"))] fn load_root_certs() -> anyhow::Result { + *INIT_CRYPTO_PROVIDER; // One-time initialization of a crypto provider if needed let mut roots = rustls::RootCertStore::empty(); for cert in rustls_native_certs::load_native_certs()? { diff --git a/ddcommon-net1/src/lib.rs b/ddcommon-net1/src/lib.rs index 2dee51be8..e70ec6e02 100644 --- a/ddcommon-net1/src/lib.rs +++ b/ddcommon-net1/src/lib.rs @@ -13,6 +13,10 @@ use std::str::FromStr; pub mod connector; +pub mod dep { + pub use http; +} + pub type HttpClient = hyper::Client; pub type HttpResponse = hyper::Response; pub type HttpRequestBuilder = hyper::http::request::Builder; diff --git a/ddcommon-net2/Cargo.toml b/ddcommon-net2/Cargo.toml new file mode 100644 index 000000000..5ca3adcdd --- /dev/null +++ b/ddcommon-net2/Cargo.toml @@ -0,0 +1,30 @@ +# Copyright 2024-Present Datadog, Inc. https://www.datadoghq.com/ +# SPDX-License-Identifier: Apache-2.0 + +[package] +name = "ddcommon-net2" +rust-version.workspace = true +edition.workspace = true +version.workspace = true +license.workspace = true + +[lib] +bench = false + +[features] +default = [] +use_native_roots = ["rustls-native-certs", "tokio-rustls/ring"] +use_webpki_roots = ["webpki-roots" ,"tokio-rustls/aws-lc-rs"] + +[dependencies] +ddcommon = { path = "../ddcommon" } +hex = { version = "0.4" } +hyper = { version = "1", default-features = false, features = ["client", "http1"] } +hyper-util = { version = "0.1", default-features = false, features = ["tokio"] } +rustls-native-certs = { version = "0.8", optional = true } +serde = { version = "1.0", features = ["derive"] } +thiserror = { version = "2" } +tokio = { version = "1.41" } +tokio-rustls = { version = "0.26", default-features = false, features = ["logging", "tls12"] } +tokio-util = { version = "0.7" } +webpki-roots = { version = "0.26", optional = true } diff --git a/ddcommon-net2/src/compat.rs b/ddcommon-net2/src/compat.rs new file mode 100644 index 000000000..e72822d98 --- /dev/null +++ b/ddcommon-net2/src/compat.rs @@ -0,0 +1,134 @@ +// Copyright 2021-Present Datadog, Inc. https://www.datadoghq.com/ +// SPDX-License-Identifier: Apache-2.0 + +use hyper::http; + +use ddcommon::entity_id; +use http::request::Builder as HttpRequestBuilder; +use http::{HeaderValue, Uri}; +use serde::{Deserialize, Deserializer, Serialize, Serializer}; +use std::borrow::Cow; +use std::ops::Deref; + +// todo: why do we need to serialize and deserialize endpoints? +#[derive(Clone, PartialEq, Eq, Hash, Debug, Serialize, Deserialize)] +pub struct Endpoint { + #[serde(serialize_with = "serialize_uri", deserialize_with = "deserialize_uri")] + pub url: Uri, + pub api_key: Option>, + pub timeout_ms: u64, + /// Sets X-Datadog-Test-Session-Token header on any request + pub test_token: Option>, +} + +#[derive(serde::Deserialize, serde::Serialize)] +struct SerializedUri<'a> { + scheme: Option>, + authority: Option>, + path_and_query: Option>, +} + +fn serialize_uri(uri: &Uri, serializer: S) -> Result +where + S: Serializer, +{ + let parts = uri.clone().into_parts(); + let uri = SerializedUri { + scheme: parts.scheme.as_ref().map(|s| Cow::Borrowed(s.as_str())), + authority: parts.authority.as_ref().map(|s| Cow::Borrowed(s.as_str())), + path_and_query: parts + .path_and_query + .as_ref() + .map(|s| Cow::Borrowed(s.as_str())), + }; + uri.serialize(serializer) +} + +fn deserialize_uri<'de, D>(deserializer: D) -> Result +where + D: Deserializer<'de>, +{ + let uri = SerializedUri::deserialize(deserializer)?; + let mut builder = hyper::Uri::builder(); + if let Some(v) = uri.authority { + builder = builder.authority(v.deref()); + } + if let Some(v) = uri.scheme { + builder = builder.scheme(v.deref()); + } + if let Some(v) = uri.path_and_query { + builder = builder.path_and_query(v.deref()); + } + + builder.build().map_err(serde::de::Error::custom) +} + +impl Endpoint { + /// Default value for the timeout field in milliseconds. + pub const DEFAULT_TIMEOUT: u64 = 3_000; + + /// Return a request builder with the following headers: + /// - User agent + /// - Api key + /// - Container Id/Entity Id + pub fn to_request_builder(&self, user_agent: &str) -> Result { + let mut builder = hyper::Request::builder() + .uri(self.url.clone()) + .header(hyper::header::USER_AGENT, user_agent); + + // Add the Api key header if available + if let Some(api_key) = &self.api_key { + builder = builder.header(header::DATADOG_API_KEY, HeaderValue::from_str(api_key)?); + } + + // Add the test session token if available + if let Some(token) = &self.test_token { + builder = builder.header( + header::X_DATADOG_TEST_SESSION_TOKEN, + HeaderValue::from_str(token)?, + ); + } + + // Add the Container Id header if available + if let Some(container_id) = entity_id::get_container_id() { + builder = builder.header(header::DATADOG_CONTAINER_ID, container_id); + } + + // Add the Entity Id header if available + if let Some(entity_id) = entity_id::get_entity_id() { + builder = builder.header(header::DATADOG_ENTITY_ID, entity_id); + } + + // Add the External Env header if available + if let Some(external_env) = entity_id::get_external_env() { + builder = builder.header(header::DATADOG_EXTERNAL_ENV, external_env); + } + + Ok(builder) + } +} + +impl From for Endpoint { + fn from(uri: Uri) -> Self { + Self { + url: uri, + api_key: None, + timeout_ms: Endpoint::DEFAULT_TIMEOUT, + test_token: None, + } + } +} + +pub mod header { + #![allow(clippy::declare_interior_mutable_const)] + use hyper::{header::HeaderName, http::HeaderValue}; + pub const DATADOG_CONTAINER_ID: HeaderName = HeaderName::from_static("datadog-container-id"); + pub const DATADOG_ENTITY_ID: HeaderName = HeaderName::from_static("datadog-entity-id"); + pub const DATADOG_EXTERNAL_ENV: HeaderName = HeaderName::from_static("datadog-external-env"); + pub const DATADOG_TRACE_COUNT: HeaderName = HeaderName::from_static("x-datadog-trace-count"); + pub const DATADOG_API_KEY: HeaderName = HeaderName::from_static("dd-api-key"); + pub const APPLICATION_JSON: HeaderValue = HeaderValue::from_static("application/json"); + pub const APPLICATION_MSGPACK: HeaderValue = HeaderValue::from_static("application/msgpack"); + pub const X_DATADOG_TEST_SESSION_TOKEN: HeaderName = + HeaderName::from_static("x-datadog-test-session-token"); +} diff --git a/ddcommon-net2/src/http.rs b/ddcommon-net2/src/http.rs new file mode 100644 index 000000000..624f86af9 --- /dev/null +++ b/ddcommon-net2/src/http.rs @@ -0,0 +1,348 @@ +// Copyright 2024-Present Datadog, Inc. https://www.datadoghq.com/ +// SPDX-License-Identifier: Apache-2.0 + +use hyper::http; + +use hex::FromHex; +use http::{Request, Response, Uri}; +use hyper::body::{Body, Incoming}; +use hyper::rt::{Read, Write}; +use hyper_util::rt::TokioIo; +use std::result::Result as StdResult; +use std::{io, path, sync, time}; +use tokio::net::TcpStream; +use tokio::time::error::Elapsed; +use tokio_rustls::rustls; +use tokio_rustls::rustls::pki_types::ServerName; +use tokio_util::sync::CancellationToken; + +pub trait UriExt { + fn from_path(scheme: S, path: P) -> http::Result + where + http::uri::Scheme: TryFrom, + >::Error: Into, + P: AsRef; +} + +impl UriExt for Uri { + /// Encode the [path::Path] into a URI with the provided scheme. Since file + /// system paths are not valid "authority"s in URIs, the path is + /// hex-encoded. + fn from_path(scheme: S, path: P) -> http::Result + where + http::uri::Scheme: TryFrom, + >::Error: Into, + P: AsRef, + { + let path = path.as_ref(); + let hex_encoded_path = { + // On Unix we can convert the Path's OsStr into &[u8] using a + // trait from the prelude. This is possible because OsStr on Unix + // are basically just byte strings anyway. + #[cfg(unix)] + { + use std::os::unix::prelude::*; + hex::encode(path.as_os_str().as_bytes()) + } + + #[cfg(not(unix))] + // But on other platforms, notably Windows, there is not an API + // for this. So we have to either convert it to UTF lossily, or + // panic, or handle in some other way the conversion. + // This chooses to panic because that's what the implementation in + // ddcommon did. + { + hex::encode(path.to_str().unwrap().as_bytes()) + } + }; + Uri::builder() + .scheme(scheme) + .authority(hex_encoded_path) + .build() + } +} + +#[derive(Debug, thiserror::Error)] +pub enum Error { + #[error(transparent)] + Dns(#[from] rustls::pki_types::InvalidDnsNameError), + + #[error(transparent)] + Http(#[from] http::Error), + + #[error(transparent)] + Hyper(#[from] hyper::Error), + + #[error(transparent)] + Io(#[from] io::Error), + + #[error("secure connections require ClientConfig, none provided")] + MissingConfig, + + #[error(transparent)] + Rustls(#[from] rustls::Error), + + #[error(transparent)] + Timeout(#[from] Elapsed), + + #[error("unsupported scheme: `{0}`")] + UnsupportedScheme(String), + + #[error("user requested cancellation")] + UserRequestedCancellation, +} + +pub struct Client { + config: Option>, + runtime: tokio::runtime::Runtime, +} + +impl Client { + /// Create a client from the given config and runtime. For do-it-yourself + /// types and testing. + pub const fn new( + config: Option>, + runtime: tokio::runtime::Runtime, + ) -> Self { + Self { config, runtime } + } + + /// Create a client with the native cert store and use a current thread + /// runtime. + #[cfg(feature = "use_native_roots")] + pub fn use_native_roots_on_current_thread() -> Result { + let provider = crate::crytpo::Provider::use_native_roots(); + let config = provider.get_client_config(); + let runtime = crate::rt::create_current_thread_runtime()?; + Ok(Client { config, runtime }) + } + + /// Create a client with the webpki certs and use a current thread runtime. + #[cfg(feature = "use_webpki_roots")] + pub fn use_webpki_roots_on_current_thread() -> Result { + let provider = crate::crytpo::Provider::use_webpki_roots(); + let config = provider.get_client_config(); + let runtime = crate::rt::create_current_thread_runtime()?; + Ok(Client { config, runtime }) + } + + pub fn send( + &self, + request: Request, + cancel: Option<&CancellationToken>, + timeout: Option, + ) -> Result, Error> + where + B: Body + Send + 'static, + B::Data: Send, + B::Error: Into>, + { + let client_config = self.config.clone(); + self.runtime.block_on(async move { + tokio::select! { + result = async { match timeout { + Some(t) => { + tokio::time::timeout(t, send_and_infer_connector(client_config, request)) + .await? + } + None => send_and_infer_connector(client_config, request).await, + }} => result, + _ = async { match cancel { + Some(token) => token.cancelled().await, + // If no token is provided, future::pending() provides a + // no-op future that never resolves. + None => std::future::pending().await, + }} => Err(Error::UserRequestedCancellation), + } + }) + } +} + +pub async fn send_and_infer_connector( + client_config: Option>, + request: Request, +) -> StdResult, Error> +where + B: Body + Send + 'static, + B::Data: Send, + B::Error: Into>, +{ + let uri = request.uri(); + match uri.scheme() { + None => Err(Error::UnsupportedScheme(String::new())), + Some(scheme) => match scheme.as_str() { + "http" => send_http(request).await, + "https" => { + if let Some(client_config) = client_config { + send_https(client_config, request).await + } else { + Err(Error::MissingConfig) + } + } + #[cfg(unix)] + "unix" => send_via_unix_socket(request).await, + #[cfg(windows)] + "windows" => send_via_named_pipe(request).await, + scheme => Err(Error::UnsupportedScheme(String::from(scheme))), + }, + } +} + +#[cfg(unix)] +pub async fn send_via_unix_socket(request: Request) -> StdResult, Error> +where + B: Body + Send + 'static, + B::Data: Send, + B::Error: Into>, +{ + let path = parse_path_from_uri(request.uri())?; + let unix_stream = tokio::net::UnixStream::connect(path).await?; + let hyper_wrapper = TokioIo::new(unix_stream); + + Ok(send_via_io(request, hyper_wrapper).await?) +} + +#[cfg(windows)] +pub async fn send_via_named_pipe(request: Request) -> StdResult, Error> +where + B: Body + Send + 'static, + B::Data: Send, + B::Error: Into>, +{ + let _path = parse_path_from_uri(request.uri())?; + todo!("re-implement named pipes on Windows") +} + +pub async fn send_http(request: Request) -> StdResult, Error> +where + B: Body + Send + 'static, + B::Data: Send, + B::Error: Into>, +{ + // This _should_ be a redundant check, caller should only call this if + // they expect it's an http connection to begin with. + let scheme_str = request.uri().scheme_str(); + if scheme_str != Some("http") { + let base = "URI scheme must be http"; + let msg = if let Some(scheme) = scheme_str { + format!("{base}, given {scheme}") + } else { + format!("{base}, empty scheme found") + }; + let err = io::Error::new(io::ErrorKind::InvalidInput, msg); + return Err(Error::from(err)); + } + + let authority = request + .uri() + .authority() + .ok_or(Error::Io(io::Error::new( + io::ErrorKind::InvalidInput, + "URI must have host", + )))? + .as_str(); + let stream = TcpStream::connect(authority).await?; + let hyper_wrapper = TokioIo::new(stream); + + Ok(send_via_io(request, hyper_wrapper).await?) +} + +pub async fn send_https( + client_config: sync::Arc, + request: Request, +) -> StdResult, Error> +where + B: Body + Send + 'static, + B::Data: Send, + B::Error: Into>, +{ + let uri = request.uri(); + + // This _should_ be a redundant check, caller should only call this if + // they expect it's an https connection to begin with. + let scheme_str = request.uri().scheme_str(); + if scheme_str != Some("https") { + let base = "URI scheme must be https"; + let msg = if let Some(scheme) = scheme_str { + format!("{base}, given {scheme}") + } else { + format!("{base}, empty scheme found") + }; + let err = io::Error::new(io::ErrorKind::InvalidInput, msg); + return Err(Error::from(err)); + } + + let server_name = ServerName::try_from(uri.to_string())?; + let connector = tokio_rustls::TlsConnector::from(client_config); + + let tcp_stream = { + let authority = uri.authority().ok_or(Error::Io(io::Error::new( + io::ErrorKind::InvalidInput, + "URI must have a host", + )))?; + TcpStream::connect(authority.as_str()).await? + }; + + let stream = connector.connect(server_name, tcp_stream).await?; + let hyper_wrapper = TokioIo::new(stream); + Ok(send_via_io(request, hyper_wrapper).await?) +} + +async fn send_via_io( + request: Request, + io: T, +) -> StdResult, hyper::Error> +where + T: Read + Write + Send + Unpin + 'static, + B: Body + Send + 'static, + B::Data: Send, + B::Error: Into>, +{ + let (mut sender, connection) = hyper::client::conn::http1::handshake(io).await?; + + // The docs say we need to poll this to drive it to completion, but they + // never directly use the return type or anything: + // https://hyper.rs/guides/1/client/basic/ + let _todo = tokio::spawn(connection); + + sender.send_request(request).await +} + +pub fn parse_path_from_uri(uri: &Uri) -> io::Result { + // This _should_ be a redundant check, caller should only call this if + // they expect it's a unix domain socket or windows named pipe. + let scheme_str = uri.scheme_str(); + if scheme_str != Some("unix") || scheme_str != Some("windows") { + let base = "URI scheme must be unix or windows"; + let msg = if let Some(scheme) = scheme_str { + format!("{base}, given {scheme}") + } else { + format!("{base}, empty scheme found") + }; + return Err(io::Error::new(io::ErrorKind::InvalidInput, msg)); + } + + if let Some(host) = uri.host() { + let bytes = Vec::from_hex(host).map_err(|err| { + io::Error::new( + io::ErrorKind::InvalidInput, + format!("URI host must be a hex-encoded path: {err}"), + ) + })?; + let str = match std::str::from_utf8(&bytes) { + Ok(s) => s, + Err(err) => { + return Err(io::Error::new( + io::ErrorKind::InvalidInput, + format!("URI is invalid: {err}"), + )) + } + }; + Ok(path::PathBuf::from(str)) + } else { + Err(io::Error::new( + io::ErrorKind::InvalidInput, + "URI is missing host", + )) + } +} diff --git a/ddcommon-net2/src/lib.rs b/ddcommon-net2/src/lib.rs new file mode 100644 index 000000000..df2165972 --- /dev/null +++ b/ddcommon-net2/src/lib.rs @@ -0,0 +1,112 @@ +// Copyright 2024-Present Datadog, Inc. https://www.datadoghq.com/ +// SPDX-License-Identifier: Apache-2.0 + +/// Provides _some_ migration paths from the ddcommon +pub mod compat; + +/// The http module has types and functions for working with HTTP requests +/// through hyper and tokio. Generally, we do not need asynchronous execution, +/// but we do need features like HTTP over UNIX Domain Sockets (UDS) and +/// Windows Named Pipes. This aims to provide a simple API for doing blocking, +/// synchronous HTTP calls with all the different connectors we support. +pub mod http; + +/// This module exports some dependencies so that crates depending on this +/// one do not also have to directly depend on and manage the versions. +pub mod dep { + pub use hex; + pub use hyper::{self, http}; + pub use tokio; + pub use tokio_rustls::{self, rustls}; +} + +pub mod crytpo { + use std::sync::Arc; + use tokio_rustls::rustls; + + #[derive(Clone, Debug)] + pub enum Provider { + #[cfg(feature = "use_native_roots")] + Native(Arc), + + #[cfg(feature = "use_webpki_roots")] + Webpki(Arc), + + // This won't work for TLS. + None, + } + + impl Provider { + pub const fn none() -> Self { + Provider::None + } + + #[cfg(feature = "use_webpki_roots")] + pub fn use_webpki_roots() -> Provider { + Provider::Webpki(Arc::new(rustls::crypto::aws_lc_rs::default_provider())) + } + + #[cfg(feature = "use_native_roots")] + pub fn use_native_roots() -> Provider { + Provider::Native(Arc::new(rustls::crypto::ring::default_provider())) + } + + /// Create the [rustls::ClientConfig] for the provider. Note that this + /// can be expensive and should be called sparingly. + pub fn get_client_config(&self) -> Option> { + let mut cert_store = rustls::RootCertStore::empty(); + + let maybe_provider: Option> = match self { + #[cfg(feature = "use_native_roots")] + Provider::Native(crypto_provider) => { + // Its docs say: + // > This function can be expensive: on some platforms it + // > involves loading and parsing a ~300KB disk file. It's + // > therefore prudent to call this sparingly. + let certs = rustls_native_certs::load_native_certs().certs; + + // It is unlikely that the end-user selects HTTPs, so there's + // no need to hard-error here if certificates aren't added. + _ = cert_store.add_parsable_certificates(certs); + Some(crypto_provider.clone()) + } + + #[cfg(feature = "use_webpki_roots")] + Provider::Webpki(crypto_provider) => { + cert_store.extend(webpki_roots::TLS_SERVER_ROOTS.iter().cloned()); + Some(crypto_provider.clone()) + } + + Provider::None => None, + }; + + maybe_provider.and_then(|provider| { + let client_config = rustls::ClientConfig::builder_with_provider(provider) + .with_protocol_versions(rustls::DEFAULT_VERSIONS) + .ok()? + .with_root_certificates(cert_store) + .with_no_client_auth(); + Some(Arc::new(client_config)) + }) + } + } +} + +/// Holds a function to create a Tokio Runtime for the current thread. +/// Note that currently it will still use a thread pool for certain operations +/// which block. +pub mod rt { + use std::io; + use tokio::runtime; + use tokio_util::sync::CancellationToken; + + /// Creates a tokio runtime for the current thread. This is the expected + /// way to create a runtime used by this crate. + pub fn create_current_thread_runtime() -> io::Result { + runtime::Builder::new_current_thread().enable_all().build() + } + + pub fn create_cancellation_token() -> CancellationToken { + CancellationToken::new() + } +} diff --git a/examples/ffi/telemetry.c b/examples/ffi/telemetry.c index 195a29f3a..5b88b6e03 100644 --- a/examples/ffi/telemetry.c +++ b/examples/ffi/telemetry.c @@ -44,4 +44,4 @@ int main(void) { ddog_telemetry_handle_wait_for_shutdown(handle); return 0; -} \ No newline at end of file +} diff --git a/profiling-ffi/Cargo.toml b/profiling-ffi/Cargo.toml index e46330bb8..85937f4d5 100644 --- a/profiling-ffi/Cargo.toml +++ b/profiling-ffi/Cargo.toml @@ -38,7 +38,6 @@ datadog-profiling = { path = "../profiling" } hyper = { version = "0.14", features = ["backports", "deprecated"], default-features = false } ddcommon = { path = "../ddcommon" } ddcommon-ffi = { path = "../ddcommon-ffi", default-features = false } -ddcommon-net1 = { path = "../ddcommon-net1" } ddtelemetry-ffi = { path = "../ddtelemetry-ffi", default-features = false, optional = true, features = ["expanded_builder_macros"] } libc = "0.2" tokio-util = "0.7.1" @@ -49,3 +48,6 @@ symbolic-demangle = { version = "12.8.0", default-features = false, features = [ symbolic-common = "12.8.0" data-pipeline-ffi = { path = "../data-pipeline-ffi", default-features = false, optional = true } datadog-library-config-ffi = { path = "../library-config-ffi", default-features = false, optional = true } + +[dev-dependencies] +http-body-util = "0.1" diff --git a/profiling-ffi/src/exporter.rs b/profiling-ffi/src/exporter.rs index bba105f39..3c1c2aad9 100644 --- a/profiling-ffi/src/exporter.rs +++ b/profiling-ffi/src/exporter.rs @@ -4,15 +4,15 @@ #![allow(renamed_and_removed_lints)] #![allow(clippy::box_vec)] -use datadog_profiling::exporter; -use datadog_profiling::exporter::{ProfileExporter, Request}; +use datadog_profiling::exporter::config::{self, EndpointExt}; +use datadog_profiling::exporter::{self, Client, Endpoint, ProfileExporter, Request, Uri}; use datadog_profiling::internal::ProfiledEndpointsStats; use ddcommon::tag::Tag; use ddcommon_ffi::slice::{AsBytes, ByteSlice, CharSlice, Slice}; use ddcommon_ffi::{Error, MaybeError, Timespec}; -use std::borrow::Cow; use std::ptr::NonNull; use std::str::FromStr; +use std::sync::{Arc, OnceLock}; #[allow(dead_code)] #[repr(C)] @@ -93,40 +93,39 @@ pub extern "C" fn ddog_prof_Endpoint_agentless<'a>( pub extern "C" fn endpoint_file(filename: CharSlice) -> ProfilingEndpoint { ProfilingEndpoint::File(filename) } -unsafe fn try_to_url(slice: CharSlice) -> anyhow::Result { + +unsafe fn try_to_url(slice: CharSlice) -> anyhow::Result { let str: &str = slice.try_to_utf8()?; #[cfg(unix)] if let Some(path) = str.strip_prefix("unix://") { - return Ok(exporter::socket_path_to_uri(path.as_ref())?); + return Ok(config::try_socket_path_to_uri(path.as_ref())?); } #[cfg(windows)] if let Some(path) = str.strip_prefix("windows:") { - return Ok(exporter::named_pipe_path_to_uri(path.as_ref())?); + return Ok(config::try_named_pipe_path_to_uri(path.as_ref())?); } - Ok(hyper::Uri::from_str(str)?) + Ok(Uri::from_str(str)?) } -pub unsafe fn try_to_endpoint( - endpoint: ProfilingEndpoint, -) -> anyhow::Result { +pub unsafe fn try_to_endpoint(endpoint: ProfilingEndpoint) -> anyhow::Result { // convert to utf8 losslessly -- URLs and API keys should all be ASCII, so // a failed result is likely to be an error. match endpoint { ProfilingEndpoint::Agent(url) => { let base_url = try_to_url(url)?; - exporter::config::agent(base_url) + Ok(Endpoint::profiling_agent(base_url)?) } ProfilingEndpoint::Agentless(site, api_key) => { let site_str = site.try_to_utf8()?; let api_key_str = api_key.try_to_utf8()?; - exporter::config::agentless( - Cow::Owned(site_str.to_owned()), - Cow::Owned(api_key_str.to_owned()), - ) + Ok(Endpoint::profiling_agentless( + site_str, + api_key_str.to_owned(), + )?) } ProfilingEndpoint::File(filename) => { let filename = filename.try_to_utf8()?; - exporter::config::file(filename) + Ok(Endpoint::profiling_file(filename)?) } } } @@ -168,7 +167,7 @@ pub unsafe extern "C" fn ddog_prof_Exporter_new( let ptr = NonNull::new_unchecked(Box::into_raw(Box::new(exporter))); ExporterNewResult::Ok(ptr) } - Err(err) => ExporterNewResult::Err(err.into()), + Err(err) => ExporterNewResult::Err(err.context("ddog_prof_Exporter_new failed").into()), } } @@ -179,12 +178,32 @@ fn ddog_prof_exporter_new_impl( tags: Option<&ddcommon_ffi::Vec>, endpoint: ProfilingEndpoint, ) -> anyhow::Result { + // Cache the client because client config can be expensive to create. + // The client should probably be exposed to the user over FFI so that: + // 1. They can choose which cert provider to use (webpki or native). + // 2. The client can actually be freed properly if needed as this will leak some memory. The + // previous implementation also leaked memory in this area, so this is not a new leak. + // 3. I don't like hidden locks. + static CLIENT: OnceLock, exporter::Error>> = OnceLock::new(); + let client_result = CLIENT.get_or_init(|| -> Result, exporter::Error> { + let client = Client::use_native_roots_on_current_thread()?; + Ok(Arc::new(client)) + }); + + let client = match client_result { + Ok(c) => c.clone(), + Err(err) => { + return Err(anyhow::Error::from(err).context("failed to create HTTP client")); + } + }; + let library_name = profiling_library_name.to_utf8_lossy().into_owned(); let library_version = profiling_library_version.to_utf8_lossy().into_owned(); let family = family.to_utf8_lossy().into_owned(); let converted_endpoint = unsafe { try_to_endpoint(endpoint)? }; let tags = tags.map(|tags| tags.iter().cloned().collect()); ProfileExporter::new( + client, library_name, library_version, family, @@ -483,7 +502,7 @@ mod tests { use super::*; use ddcommon::tag; use ddcommon_ffi::Slice; - use hyper::body::HttpBody; + use http_body_util::BodyExt; use serde_json::json; fn profiling_library_name() -> CharSlice<'static> { @@ -514,6 +533,7 @@ mod tests { // alternative. If you do figure out a better way, there's another copy of this code // in the profiling tests, please update there too :) let body = request.body(); + let body_bytes: String = String::from_utf8_lossy( &futures::executor::block_on(body.collect()) .unwrap() @@ -975,7 +995,10 @@ mod tests { }; let build_result = Result::from(build_result); - build_result.unwrap_err(); + assert!( + build_result.is_err(), + "ddog_prof_Exporter_Request_build returned Ok when it should have errored" + ); } #[test] diff --git a/profiling/Cargo.toml b/profiling/Cargo.toml index 048d7cc81..e33f077ad 100644 --- a/profiling/Cargo.toml +++ b/profiling/Cargo.toml @@ -20,20 +20,15 @@ harness = false [dependencies] anyhow = "1.0" bitmaps = "3.2.0" +byteorder = { version = "1.5", features = ["std"] } bytes = "1.1" chrono = {version = "0.4", default-features = false, features = ["std", "clock"]} datadog-alloc = {path = "../alloc"} ddcommon = { path = "../ddcommon" } -ddcommon-net1 = { path = "../ddcommon-net1" } +ddcommon-net2 = { path = "../ddcommon-net2", features = ["use_native_roots"] } derivative = "2.2.0" -futures = { version = "0.3", default-features = false } -futures-core = {version = "0.3.0", default-features = false} -futures-util = {version = "0.3.0", default-features = false} hashbrown = { version = "0.14", default-features = false, features = ["allocator-api2"] } -http = "0.2" -http-body = "0.4" -hyper = {version = "0.14", features = ["client", "backports", "deprecated"], default-features = false} -hyper-multipart-rfc7578 = "0.7.0" +hyper-multipart-rfc7578 = { git = "https://github.com/jothan/rust-hyper-multipart-rfc7578.git", rev = "4d3064a7a8c0062b485d50e4460cb7ad71c83d35" } indexmap = "2.2" libc = "0.2" lz4_flex = { version = "0.9", default-features = false, features = ["std", "safe-encode", "frame"] } @@ -46,9 +41,11 @@ serde = {version = "1.0", features = ["derive"]} serde_json = {version = "1.0"} tokio = {version = "1.23", features = ["rt", "macros"]} tokio-util = "0.7.1" -byteorder = { version = "1.5", features = ["std"] } +rustls-native-certs = "0.8.1" [dev-dependencies] bolero = "0.10.1" bolero-generator = "0.10.2" criterion = "0.5.1" +futures = { version = "0.3", default-features = false } +http-body-util = "0.1" diff --git a/profiling/src/exporter/config.rs b/profiling/src/exporter/config.rs index 51a71b8bd..5407ff0f7 100644 --- a/profiling/src/exporter/config.rs +++ b/profiling/src/exporter/config.rs @@ -1,77 +1,80 @@ // Copyright 2021-Present Datadog, Inc. https://www.datadoghq.com/ // SPDX-License-Identifier: Apache-2.0 -use http::Uri; +use crate::exporter::Uri; +use ddcommon_net2::compat::Endpoint; +use ddcommon_net2::{dep::http, http::UriExt}; use std::borrow::Cow; +use std::path::Path; use std::str::FromStr; -use ddcommon_net1::Endpoint; +pub trait EndpointExt { + fn profiling_agentless( + site: impl AsRef, + api_key: impl Into>, + ) -> http::Result; -#[cfg(unix)] -use ddcommon_net1::connector::uds; + fn profiling_agent>(uri: U) -> Result + where + http::Error: From; -#[cfg(windows)] -use ddcommon_net1::connector::named_pipe; + fn profiling_file(path: impl AsRef) -> http::Result; +} -/// Creates an Endpoint for talking to the Datadog agent. -/// -/// # Arguments -/// * `base_url` - has protocol, host, and port e.g. http://localhost:8126/ -pub fn agent(base_url: Uri) -> anyhow::Result { - let mut parts = base_url.into_parts(); - let p_q = match parts.path_and_query { - None => None, - Some(pq) => { - let path = pq.path(); - let path = path.strip_suffix('/').unwrap_or(path); - Some(format!("{path}/profiling/v1/input").parse()?) - } - }; - parts.path_and_query = p_q; - let url = Uri::from_parts(parts)?; - Ok(Endpoint::from_url(url)) +impl EndpointExt for Endpoint { + fn profiling_agentless( + site: impl AsRef, + api_key: impl Into>, + ) -> http::Result { + let intake_url = format!("https://intake.profile.{}/api/v2/profile", site.as_ref()); + Ok(Self { + url: Uri::try_from(intake_url)?, + api_key: Some(api_key.into()), + timeout_ms: 0, + test_token: None, + }) + } + + fn profiling_agent>(uri: U) -> Result + where + http::Error: From, + { + let mut parts = uri.try_into()?.into_parts(); + parts.path_and_query = Some(http::uri::PathAndQuery::from_str("/profiling/v1/input")?); + let url = Uri::from_parts(parts)?; + Ok(Self { + url, + api_key: None, + timeout_ms: 0, + test_token: None, + }) + } + + fn profiling_file(path: impl AsRef) -> http::Result { + let raw_url = format!("file://{}", path.as_ref()); + let url = Uri::from_str(&raw_url)?; + Ok(Self::from(url)) + } } -/// Creates an Endpoint for talking to the Datadog agent though a unix socket. -/// -/// # Arguments -/// * `socket_path` - file system path to the socket #[cfg(unix)] -pub fn agent_uds(path: &std::path::Path) -> anyhow::Result { - let base_url = uds::socket_path_to_uri(path)?; - agent(base_url) +/// Creates a new Uri, with the `unix` scheme, and the path to the socket +/// encoded as a hex string, to prevent special characters in the url authority +pub fn try_socket_path_to_uri(path: &Path) -> http::Result { + Uri::from_path("unix", path) } -/// Creates an Endpoint for talking to the Datadog agent though a windows named pipe. -/// -/// # Arguments -/// * `path` - file system path to the named pipe #[cfg(windows)] -pub fn agent_named_pipe(path: &std::path::Path) -> anyhow::Result { - let base_url = named_pipe::named_pipe_path_to_uri(path)?; - agent(base_url) -} - -/// Creates an Endpoint for talking to Datadog intake without using the agent. -/// This is an experimental feature. +/// Windows Named Pipe +/// https://docs.microsoft.com/en-us/windows/win32/ipc/named-pipes /// -/// # Arguments -/// * `site` - e.g. "datadoghq.com". -/// * `api_key` -pub fn agentless, IntoCow: Into>>( - site: AsStrRef, - api_key: IntoCow, -) -> anyhow::Result { - let intake_url: String = format!("https://intake.profile.{}/api/v2/profile", site.as_ref()); - - Ok(Endpoint { - url: Uri::from_str(intake_url.as_str())?, - api_key: Some(api_key.into()), - ..Default::default() - }) -} - -pub fn file(path: impl AsRef) -> anyhow::Result { - let url: String = format!("file://{}", path.as_ref()); - Ok(Endpoint::from_slice(&url)) +/// The form a windows named pipe path is either local to the computer: +/// \\.\pipe\pipename +/// or targeting a remote server +/// \\ServerName\pipe\pipename +/// +/// Build a URI from a Path representing a named pipe +/// `path` - named pipe path. ex: \\.\pipe\pipename +pub fn try_named_pipe_path_to_uri(path: &Path) -> http::Result { + Uri::from_path("windows", path) } diff --git a/profiling/src/exporter/mod.rs b/profiling/src/exporter/mod.rs index 57d97ee91..5d6d9284d 100644 --- a/profiling/src/exporter/mod.rs +++ b/profiling/src/exporter/mod.rs @@ -2,47 +2,38 @@ // SPDX-License-Identifier: Apache-2.0 pub mod config; - mod errors; -use bytes::Bytes; +use crate::internal::ProfiledEndpointsStats; +use ddcommon::azure_app_services; +use ddcommon_net2::dep::{http, hyper}; +use hyper::body::Incoming; use hyper_multipart_rfc7578::client::multipart; use lz4_flex::frame::FrameEncoder; use serde_json::json; use std::borrow::Cow; -use std::future; use std::io::{Cursor, Write}; -use tokio::runtime::Runtime; +use std::sync; use tokio_util::sync::CancellationToken; -use crate::internal::ProfiledEndpointsStats; -use ddcommon::azure_app_services; -use ddcommon_net1::{connector, Endpoint, HttpClient, HttpResponse}; - pub use chrono::{DateTime, Utc}; pub use ddcommon::tag::Tag; -pub use hyper::Uri; - -#[cfg(unix)] -pub use connector::uds::{socket_path_from_uri, socket_path_to_uri}; - -#[cfg(windows)] -pub use connector::named_pipe::{named_pipe_path_from_uri, named_pipe_path_to_uri}; +pub use ddcommon_net2::compat::Endpoint; +pub use ddcommon_net2::crytpo::Provider as CryptoProvider; +pub use ddcommon_net2::dep::tokio_rustls::rustls; +pub use ddcommon_net2::http::{Client, Error}; +pub use ddcommon_net2::rt; +pub use http::Uri; const DURATION_ZERO: std::time::Duration = std::time::Duration::from_millis(0); -pub struct Exporter { - client: HttpClient, - runtime: Runtime, -} - pub struct Fields { pub start: DateTime, pub end: DateTime, } pub struct ProfileExporter { - exporter: Exporter, + http_client: sync::Arc, endpoint: Endpoint, family: Cow<'static, str>, profiling_library_name: Cow<'static, str>, @@ -55,14 +46,13 @@ pub struct File<'a> { pub bytes: &'a [u8], } -#[derive(Debug)] pub struct Request { timeout: Option, - req: hyper::Request, + req: hyper::Request, } -impl From> for Request { - fn from(req: hyper::Request) -> Self { +impl From> for Request { + fn from(req: hyper::Request) -> Self { Self { req, timeout: None } } } @@ -81,7 +71,7 @@ impl Request { &self.timeout } - pub fn uri(&self) -> &hyper::Uri { + pub fn uri(&self) -> &Uri { self.req.uri() } @@ -89,32 +79,9 @@ impl Request { self.req.headers() } - pub fn body(self) -> hyper::Body { + pub fn body(self) -> multipart::Body { self.req.into_body() } - - async fn send( - self, - client: &HttpClient, - cancel: Option<&CancellationToken>, - ) -> anyhow::Result> { - tokio::select! { - _ = async { match cancel { - Some(cancellation_token) => cancellation_token.cancelled().await, - // If no token is provided, future::pending() provides a no-op future that never resolves - None => future::pending().await, - }} - => Err(crate::exporter::errors::Error::UserRequestedCancellation.into()), - result = async { - Ok(match self.timeout { - Some(t) => tokio::time::timeout(t, client.request(self.req)) - .await - .map_err(|_| crate::exporter::errors::Error::OperationTimedOut)?, - None => client.request(self.req).await, - }?)} - => result, - } - } } impl ProfileExporter { @@ -130,6 +97,7 @@ impl ProfileExporter { /// to include profile-specific tags, see `additional_tags` on `build`. /// * `endpoint` - Configuration for reporting data pub fn new( + http_client: sync::Arc, profiling_library_name: N, profiling_library_version: V, family: F, @@ -142,7 +110,7 @@ impl ProfileExporter { V: Into>, { Ok(Self { - exporter: Exporter::new()?, + http_client, endpoint, family: family.into(), profiling_library_name: profiling_library_name.into(), @@ -274,66 +242,33 @@ impl ProfileExporter { let builder = self .endpoint - .into_request_builder(concat!("DDProf/", env!("CARGO_PKG_VERSION")))? - .method(http::Method::POST) - .header("Connection", "close") + .to_request_builder(concat!("DDProf/", env!("CARGO_PKG_VERSION")))? + .method(http::Method::POST.as_str()) + .header(http::header::CONNECTION.as_str(), "close") .header("DD-EVP-ORIGIN", self.profiling_library_name.as_ref()) .header( "DD-EVP-ORIGIN-VERSION", self.profiling_library_version.as_ref(), ); - Ok( - Request::from(form.set_body_convert::(builder)?) - .with_timeout(std::time::Duration::from_millis(self.endpoint.timeout_ms)), - ) + let request = form.set_body::(builder)?; + + Ok(Request::from(request) + .with_timeout(std::time::Duration::from_millis(self.endpoint.timeout_ms))) } pub fn send( &self, request: Request, cancel: Option<&CancellationToken>, - ) -> anyhow::Result { - self.exporter - .runtime - .block_on(request.send(&self.exporter.client, cancel)) + ) -> anyhow::Result> { + let response = self + .http_client + .send(request.req, cancel, request.timeout)?; + Ok(response) } pub fn set_timeout(&mut self, timeout_ms: u64) { self.endpoint.timeout_ms = timeout_ms; } } - -impl Exporter { - /// Creates a new Exporter, initializing the TLS stack. - pub fn new() -> anyhow::Result { - // Set idle to 0, which prevents the pipe being broken every 2nd request - let client = hyper::Client::builder() - .pool_max_idle_per_host(0) - .build(connector::Connector::default()); - let runtime = tokio::runtime::Builder::new_current_thread() - .enable_all() - .build()?; - Ok(Self { client, runtime }) - } - - pub fn send( - &self, - http_method: http::Method, - url: &str, - mut headers: hyper::header::HeaderMap, - body: &[u8], - timeout: std::time::Duration, - ) -> anyhow::Result> { - self.runtime.block_on(async { - let mut request = hyper::Request::builder() - .method(http_method) - .uri(url) - .body(hyper::Body::from(Bytes::copy_from_slice(body)))?; - std::mem::swap(request.headers_mut(), &mut headers); - - let request: Request = request.into(); - request.with_timeout(timeout).send(&self.client, None).await - }) - } -} diff --git a/profiling/tests/form.rs b/profiling/tests/form.rs index 4eed33d21..a59a354d3 100644 --- a/profiling/tests/form.rs +++ b/profiling/tests/form.rs @@ -59,16 +59,18 @@ fn multipart( #[cfg(test)] mod tests { use crate::multipart; + use datadog_profiling::exporter::config::EndpointExt; use datadog_profiling::exporter::*; use ddcommon::tag; - use hyper::body::HttpBody; use serde_json::json; + use std::sync; fn default_tags() -> Vec { vec![tag!("service", "php"), tag!("host", "bits")] } fn parsed_event_json(request: Request) -> serde_json::Value { + use http_body_util::BodyExt; // Really hacky way of getting the event.json file contents, because I didn't want to // implement a full multipart parser and didn't find a particularly good // alternative. If you do figure out a better way, there's another copy of this code @@ -89,6 +91,11 @@ mod tests { serde_json::from_str(event_json).unwrap() } + fn http_only_client() -> sync::Arc { + let runtime = rt::create_current_thread_runtime().unwrap(); + sync::Arc::new(Client::new(None, runtime)) + } + #[test] // This test invokes an external function SecTrustSettingsCopyCertificates // which Miri cannot evaluate. @@ -96,9 +103,10 @@ mod tests { fn multipart_agent() { let profiling_library_name = "dd-trace-foo"; let profiling_library_version = "1.2.3"; - let base_url = "http://localhost:8126".parse().expect("url to parse"); - let endpoint = config::agent(base_url).expect("endpoint to construct"); + let endpoint = + Endpoint::profiling_agent("http://localhost:8126").expect("endpoint to construct"); let mut exporter = ProfileExporter::new( + http_only_client(), profiling_library_name, profiling_library_version, "php", @@ -145,9 +153,10 @@ mod tests { fn including_internal_metadata() { let profiling_library_name = "dd-trace-foo"; let profiling_library_version = "1.2.3"; - let base_url = "http://localhost:8126".parse().expect("url to parse"); - let endpoint = config::agent(base_url).expect("endpoint to construct"); + let endpoint = + Endpoint::profiling_agent("http://localhost:8126").expect("endpoint to construct"); let mut exporter = ProfileExporter::new( + http_only_client(), profiling_library_name, profiling_library_version, "php", @@ -174,9 +183,10 @@ mod tests { fn including_info() { let profiling_library_name = "dd-trace-foo"; let profiling_library_version = "1.2.3"; - let base_url = "http://localhost:8126".parse().expect("url to parse"); - let endpoint = config::agent(base_url).expect("endpoint to construct"); + let endpoint = + Endpoint::profiling_agent("http://localhost:8126").expect("endpoint to construct"); let mut exporter = ProfileExporter::new( + http_only_client(), profiling_library_name, profiling_library_version, "php", @@ -214,9 +224,11 @@ mod tests { fn multipart_agentless() { let profiling_library_name = "dd-trace-foo"; let profiling_library_version = "1.2.3"; + let site = "datadoghq.com"; let api_key = "1234567890123456789012"; - let endpoint = config::agentless("datadoghq.com", api_key).expect("endpoint to construct"); + let endpoint = Endpoint::profiling_agentless(site, api_key).expect("endpoint to construct"); let mut exporter = ProfileExporter::new( + http_only_client(), profiling_library_name, profiling_library_version, "php", diff --git a/tools/docker/Dockerfile.build b/tools/docker/Dockerfile.build index ff9ad7e48..d5e4d7edf 100644 --- a/tools/docker/Dockerfile.build +++ b/tools/docker/Dockerfile.build @@ -4,18 +4,18 @@ ARG CARGO_NET_RETRY="2" ARG BUILDER_IMAGE=debian_builder ### Debian builder -FROM rust:1-slim-buster as debian_builder +FROM rust:1-slim-buster AS debian_builder ENV CARGO_HOME="/root/.cargo" WORKDIR /build RUN cargo install cbindgen; mv /root/.cargo/bin/cbindgen /usr/bin/; rm -rf /root/.cargo ### Debian buildplatform builder -FROM --platform=$BUILDPLATFORM rust:1-slim-buster as debian_builder_platform_native +FROM --platform=$BUILDPLATFORM rust:1-slim-buster AS debian_builder_platform_native ENV CARGO_HOME="/root/.cargo" WORKDIR /build ### Alpine builder -FROM ${ALPINE_BASE_IMAGE} as alpine_base +FROM ${ALPINE_BASE_IMAGE} AS alpine_base ENV CARGO_HOME="/root/.cargo" WORKDIR /build @@ -43,20 +43,20 @@ SHELL ["/bin/bash", "-c"] # Also, it doesn't understand x86_64-alpine-linux-musl like the OS's cargo. #RUN rustup-init -y --no-modify-path --default-toolchain stable -FROM alpine_base as alpine_aws_cli +FROM alpine_base AS alpine_aws_cli RUN apk add --no-cache aws-cli \ && rm -rf /var/cache/apk/* RUN aws --version # Just to make sure its installed alright -FROM alpine_base as alpine_cbindgen +FROM alpine_base AS alpine_cbindgen ENV PATH="/root/.cargo/bin:$PATH" ARG CARGO_BUILD_INCREMENTAL ARG CARGO_NET_RETRY ENV CARGO_NET_RETRY="${CARGO_NET_RETRY}" RUN cargo install cbindgen --version "^0.26" && cargo install bindgen-cli --locked && rm -rf /root/.cargo/registry /root/.cargo/git -FROM alpine_aws_cli as alpine_builder +FROM alpine_aws_cli AS alpine_builder COPY --from=alpine_cbindgen /root/.cargo/bin/cbindgen /usr/local/bin/cbindgen COPY --from=alpine_cbindgen /root/.cargo/bin/bindgen /usr/local/bin/bindgen @@ -73,8 +73,9 @@ COPY "build-common/Cargo.toml" "build-common/" COPY "crashtracker/Cargo.toml" "crashtracker/" COPY "crashtracker-ffi/Cargo.toml" "crashtracker-ffi/" COPY "ddcommon/Cargo.toml" "ddcommon/" -COPY "ddcommon-ffi/Cargo.toml" "ddcommon-ffi/" -COPY "ddcommon-net1/Cargo.toml" "ddcommon-net1/" +COPY "ddcommon-ffi/Cargo.toml" "ddcommon-ffi/" +COPY "ddcommon-net1/Cargo.toml" "ddcommon-net1/" +COPY "ddcommon-net2/Cargo.toml" "ddcommon-net2/" COPY "ddtelemetry/Cargo.toml" "ddtelemetry/" COPY "ddtelemetry-ffi/Cargo.toml" "ddtelemetry-ffi/" COPY "ddsketch/Cargo.toml" "ddsketch/" @@ -147,7 +148,7 @@ RUN echo \ RUN cargo fetch --locked # extract cargo cache -FROM --platform=$BUILDPLATFORM scratch as ffi_build_platform_agnostic_cache +FROM --platform=$BUILDPLATFORM scratch AS ffi_build_platform_agnostic_cache COPY --from=ffi_build_platform_agnostic_cache_build /root/.cargo /root/.cargo COPY --from=ffi_build_platform_agnostic_cache_build /build /build @@ -164,6 +165,6 @@ RUN cargo build --release --lib --workspace --exclude builder COPY ./ ./ RUN cargo run --bin release --features profiling,telemetry,data-pipeline,symbolizer,crashtracker,datadog-library-config-ffi --release -- --out /build/output -FROM scratch as ffi_build_output +FROM scratch AS ffi_build_output COPY --from=ffi_build /build/output/ ./