diff --git a/Cargo.toml b/Cargo.toml index d6dc7b4a..12e832d7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,6 +2,7 @@ members = [ "proxmox", "proxmox-api-macro", + "proxmox-http", "proxmox-sortable-macro", ] exclude = [ diff --git a/Makefile b/Makefile index ebaf1138..4f745392 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # Shortcut for common operations: -CRATES=proxmox proxmox-api-macro proxmox-sortable-macro +CRATES=proxmox proxmox-api-macro proxmox-http proxmox-sortable-macro # By default we just run checks: .PHONY: all diff --git a/proxmox-http/Cargo.toml b/proxmox-http/Cargo.toml new file mode 100644 index 00000000..9c2d3c5c --- /dev/null +++ b/proxmox-http/Cargo.toml @@ -0,0 +1,20 @@ +[package] +name = "proxmox-http" +edition = "2018" +version = "0.1.0" +authors = [ + "Dietmar Maurer ", + "Wolfgang Bumiller ", +] +license = "AGPL-3" +description = "Proxmox HTTP library" + +exclude = [ "debian" ] + +[dependencies] + +[features] +default = [] + +client = [] +websocket = [] diff --git a/proxmox-http/debian/changelog b/proxmox-http/debian/changelog new file mode 100644 index 00000000..2ef333f7 --- /dev/null +++ b/proxmox-http/debian/changelog @@ -0,0 +1,5 @@ +rust-proxmox-http (0.1.0-1) unstable; urgency=medium + + * refactor code from proxmox-backup and proxmox into own HTTP crate + + -- Proxmox Support Team Tue, 11 May 2021 10:50:29 +0200 diff --git a/proxmox-http/debian/control b/proxmox-http/debian/control new file mode 100644 index 00000000..f010d6e7 --- /dev/null +++ b/proxmox-http/debian/control @@ -0,0 +1,230 @@ +Source: rust-proxmox-http +Section: rust +Priority: optional +Build-Depends: debhelper (>= 11), + dh-cargo (>= 18), + cargo:native , + rustc:native , + libstd-rust-dev , + librust-anyhow-1+default-dev +Maintainer: Proxmox Support Team +Standards-Version: 4.4.1 +Vcs-Git: git://git.proxmox.com/git/proxmox.git +Vcs-Browser: https://git.proxmox.com/?p=proxmox.git + +Package: librust-proxmox-http-dev +Architecture: any +Multi-Arch: same +Depends: + ${misc:Depends}, + librust-anyhow-1+default-dev +Suggests: + librust-proxmox-http+base64-dev (= ${binary:Version}), + librust-proxmox-http+client-dev (= ${binary:Version}), + librust-proxmox-http+futures-dev (= ${binary:Version}), + librust-proxmox-http+http-dev (= ${binary:Version}), + librust-proxmox-http+http-helpers-dev (= ${binary:Version}), + librust-proxmox-http+hyper-dev (= ${binary:Version}), + librust-proxmox-http+openssl-dev (= ${binary:Version}), + librust-proxmox-http+proxmox-dev (= ${binary:Version}), + librust-proxmox-http+tokio-dev (= ${binary:Version}), + librust-proxmox-http+tokio-openssl-dev (= ${binary:Version}), + librust-proxmox-http+websocket-dev (= ${binary:Version}) +Provides: + librust-proxmox-http+default-dev (= ${binary:Version}), + librust-proxmox-http-0-dev (= ${binary:Version}), + librust-proxmox-http-0+default-dev (= ${binary:Version}), + librust-proxmox-http-0.1-dev (= ${binary:Version}), + librust-proxmox-http-0.1+default-dev (= ${binary:Version}), + librust-proxmox-http-0.1.0-dev (= ${binary:Version}), + librust-proxmox-http-0.1.0+default-dev (= ${binary:Version}) +Description: Proxmox HTTP library - Rust source code + This package contains the source for the Rust proxmox-http crate, packaged by + debcargo for use with cargo and dh-cargo. + +Package: librust-proxmox-http+base64-dev +Architecture: any +Multi-Arch: same +Depends: + ${misc:Depends}, + librust-proxmox-http-dev (= ${binary:Version}), + librust-base64-0.12+default-dev +Provides: + librust-proxmox-http-0+base64-dev (= ${binary:Version}), + librust-proxmox-http-0.1+base64-dev (= ${binary:Version}), + librust-proxmox-http-0.1.0+base64-dev (= ${binary:Version}) +Description: Proxmox HTTP library - feature "base64" + This metapackage enables feature "base64" for the Rust proxmox-http crate, by + pulling in any additional dependencies needed by that feature. + +Package: librust-proxmox-http+client-dev +Architecture: any +Multi-Arch: same +Depends: + ${misc:Depends}, + librust-proxmox-http-dev (= ${binary:Version}), + librust-proxmox-http+http-helpers-dev (= ${binary:Version}), + librust-futures-0.3+default-dev, + librust-openssl-0.10+default-dev +Provides: + librust-proxmox-http-0+client-dev (= ${binary:Version}), + librust-proxmox-http-0.1+client-dev (= ${binary:Version}), + librust-proxmox-http-0.1.0+client-dev (= ${binary:Version}) +Description: Proxmox HTTP library - feature "client" + This metapackage enables feature "client" for the Rust proxmox-http crate, by + pulling in any additional dependencies needed by that feature. + +Package: librust-proxmox-http+futures-dev +Architecture: any +Multi-Arch: same +Depends: + ${misc:Depends}, + librust-proxmox-http-dev (= ${binary:Version}), + librust-futures-0.3+default-dev +Provides: + librust-proxmox-http-0+futures-dev (= ${binary:Version}), + librust-proxmox-http-0.1+futures-dev (= ${binary:Version}), + librust-proxmox-http-0.1.0+futures-dev (= ${binary:Version}) +Description: Proxmox HTTP library - feature "futures" + This metapackage enables feature "futures" for the Rust proxmox-http crate, by + pulling in any additional dependencies needed by that feature. + +Package: librust-proxmox-http+http-dev +Architecture: any +Multi-Arch: same +Depends: + ${misc:Depends}, + librust-proxmox-http-dev (= ${binary:Version}), + librust-http-0.2+default-dev +Provides: + librust-proxmox-http-0+http-dev (= ${binary:Version}), + librust-proxmox-http-0.1+http-dev (= ${binary:Version}), + librust-proxmox-http-0.1.0+http-dev (= ${binary:Version}) +Description: Proxmox HTTP library - feature "http" + This metapackage enables feature "http" for the Rust proxmox-http crate, by + pulling in any additional dependencies needed by that feature. + +Package: librust-proxmox-http+http-helpers-dev +Architecture: any +Multi-Arch: same +Depends: + ${misc:Depends}, + librust-proxmox-http-dev (= ${binary:Version}), + librust-base64-0.12+default-dev, + librust-http-0.2+default-dev, + librust-hyper-0.14+default-dev, + librust-hyper-0.14+full-dev, + librust-proxmox-0.11-dev (>= 0.11.3-~~), + librust-tokio-1+io-util-dev, + librust-tokio-openssl-0.6+default-dev (>= 0.6.1-~~) +Provides: + librust-proxmox-http+simple-client-dev (= ${binary:Version}), + librust-proxmox-http-0+http-helpers-dev (= ${binary:Version}), + librust-proxmox-http-0+simple-client-dev (= ${binary:Version}), + librust-proxmox-http-0.1+http-helpers-dev (= ${binary:Version}), + librust-proxmox-http-0.1+simple-client-dev (= ${binary:Version}), + librust-proxmox-http-0.1.0+http-helpers-dev (= ${binary:Version}), + librust-proxmox-http-0.1.0+simple-client-dev (= ${binary:Version}) +Description: Proxmox HTTP library - feature "http-helpers" and 1 more + This metapackage enables feature "http-helpers" for the Rust proxmox-http + crate, by pulling in any additional dependencies needed by that feature. + . + Additionally, this package also provides the "simple-client" feature. + +Package: librust-proxmox-http+hyper-dev +Architecture: any +Multi-Arch: same +Depends: + ${misc:Depends}, + librust-proxmox-http-dev (= ${binary:Version}), + librust-hyper-0.14+default-dev, + librust-hyper-0.14+full-dev +Provides: + librust-proxmox-http-0+hyper-dev (= ${binary:Version}), + librust-proxmox-http-0.1+hyper-dev (= ${binary:Version}), + librust-proxmox-http-0.1.0+hyper-dev (= ${binary:Version}) +Description: Proxmox HTTP library - feature "hyper" + This metapackage enables feature "hyper" for the Rust proxmox-http crate, by + pulling in any additional dependencies needed by that feature. + +Package: librust-proxmox-http+openssl-dev +Architecture: any +Multi-Arch: same +Depends: + ${misc:Depends}, + librust-proxmox-http-dev (= ${binary:Version}), + librust-openssl-0.10+default-dev +Provides: + librust-proxmox-http-0+openssl-dev (= ${binary:Version}), + librust-proxmox-http-0.1+openssl-dev (= ${binary:Version}), + librust-proxmox-http-0.1.0+openssl-dev (= ${binary:Version}) +Description: Proxmox HTTP library - feature "openssl" + This metapackage enables feature "openssl" for the Rust proxmox-http crate, by + pulling in any additional dependencies needed by that feature. + +Package: librust-proxmox-http+proxmox-dev +Architecture: any +Multi-Arch: same +Depends: + ${misc:Depends}, + librust-proxmox-http-dev (= ${binary:Version}), + librust-proxmox-0.11-dev (>= 0.11.3-~~) +Provides: + librust-proxmox-http-0+proxmox-dev (= ${binary:Version}), + librust-proxmox-http-0.1+proxmox-dev (= ${binary:Version}), + librust-proxmox-http-0.1.0+proxmox-dev (= ${binary:Version}) +Description: Proxmox HTTP library - feature "proxmox" + This metapackage enables feature "proxmox" for the Rust proxmox-http crate, by + pulling in any additional dependencies needed by that feature. + +Package: librust-proxmox-http+tokio-dev +Architecture: any +Multi-Arch: same +Depends: + ${misc:Depends}, + librust-proxmox-http-dev (= ${binary:Version}), + librust-tokio-1+default-dev +Provides: + librust-proxmox-http-0+tokio-dev (= ${binary:Version}), + librust-proxmox-http-0.1+tokio-dev (= ${binary:Version}), + librust-proxmox-http-0.1.0+tokio-dev (= ${binary:Version}) +Description: Proxmox HTTP library - feature "tokio" + This metapackage enables feature "tokio" for the Rust proxmox-http crate, by + pulling in any additional dependencies needed by that feature. + +Package: librust-proxmox-http+tokio-openssl-dev +Architecture: any +Multi-Arch: same +Depends: + ${misc:Depends}, + librust-proxmox-http-dev (= ${binary:Version}), + librust-tokio-openssl-0.6+default-dev (>= 0.6.1-~~) +Provides: + librust-proxmox-http-0+tokio-openssl-dev (= ${binary:Version}), + librust-proxmox-http-0.1+tokio-openssl-dev (= ${binary:Version}), + librust-proxmox-http-0.1.0+tokio-openssl-dev (= ${binary:Version}) +Description: Proxmox HTTP library - feature "tokio-openssl" + This metapackage enables feature "tokio-openssl" for the Rust proxmox-http + crate, by pulling in any additional dependencies needed by that feature. + +Package: librust-proxmox-http+websocket-dev +Architecture: any +Multi-Arch: same +Depends: + ${misc:Depends}, + librust-proxmox-http-dev (= ${binary:Version}), + librust-base64-0.12+default-dev, + librust-futures-0.3+default-dev, + librust-hyper-0.14+default-dev, + librust-hyper-0.14+full-dev, + librust-openssl-0.10+default-dev, + librust-proxmox-0.11+tokio-dev (>= 0.11.3-~~), + librust-tokio-1+io-util-dev, + librust-tokio-1+sync-dev +Provides: + librust-proxmox-http-0+websocket-dev (= ${binary:Version}), + librust-proxmox-http-0.1+websocket-dev (= ${binary:Version}), + librust-proxmox-http-0.1.0+websocket-dev (= ${binary:Version}) +Description: Proxmox HTTP library - feature "websocket" + This metapackage enables feature "websocket" for the Rust proxmox-http crate, + by pulling in any additional dependencies needed by that feature. diff --git a/proxmox-http/debian/copyright b/proxmox-http/debian/copyright new file mode 100644 index 00000000..2c91d38c --- /dev/null +++ b/proxmox-http/debian/copyright @@ -0,0 +1,16 @@ +Copyright (C) 2019,2020 Proxmox Server Solutions GmbH + +This software is written by Proxmox Server Solutions GmbH + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see . diff --git a/proxmox-http/debian/debcargo.toml b/proxmox-http/debian/debcargo.toml new file mode 100644 index 00000000..b7864cdb --- /dev/null +++ b/proxmox-http/debian/debcargo.toml @@ -0,0 +1,7 @@ +overlay = "." +crate_src_path = ".." +maintainer = "Proxmox Support Team " + +[source] +vcs_git = "git://git.proxmox.com/git/proxmox.git" +vcs_browser = "https://git.proxmox.com/?p=proxmox.git" diff --git a/proxmox-http/src/lib.rs b/proxmox-http/src/lib.rs new file mode 100644 index 00000000..e69de29b