diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 84fca58..e912774 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -9,7 +9,11 @@ updates: directory: "/" # Location of package manifests schedule: interval: "daily" + cooldown: + default-days: 7 - package-ecosystem: "github-actions" # See documentation for possible values directory: "/" # Location of package manifests schedule: interval: "daily" + cooldown: + default-days: 7 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 0bf0fb9..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Continuous integration -on: [push, pull_request] - -jobs: - build: - name: Build, test, check - runs-on: ubuntu-latest - env: - CARGO_REGISTRIES_GEN0SEC_INDEX: sparse+https://crates-internal.g0s.dev/api/v1/crates/ - CARGO_REGISTRIES_GEN0SEC_TOKEN: ${{ secrets.GEN0SEC_CARGO_TOKEN }} - CARGO_REGISTRIES_GEN0SEC_CREDENTIAL_PROVIDER: cargo:token - steps: - - uses: actions/checkout@v6 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - default: true - components: rustfmt, clippy - - name: Cache target - uses: actions/cache@v5 - with: - path: | - ~/.cargo/git/ - ~/.cargo/registry/ - target/ - key: ${{ runner.os }}-proxy-protocol-${{ hashFiles('**/Cargo.toml') }} - restore-keys: ${{ runner.os }}-proxy-protocol - - run: cargo fmt --check - - run: cargo test -- --include-ignored - - run: cargo build - - uses: actions-rs/cargo@v1 - with: - command: clippy - args: -- -D warnings - diff --git a/Cargo.toml b/Cargo.toml index 09e98fe..9da4871 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,13 +1,13 @@ [package] name = "proxy-protocol" -version = "0.5.0" -authors = ["Mariell Hoversholm "] -edition = "2018" +version = "0.5.1" +authors = ["Gen0Sec "] +edition = "2024" license = "MIT OR Apache-2.0" description = "PROXY protocol serializer and deserializer" documentation = "https://docs.rs/proxy-protocol/" -repository = "https://github.com/Proximyst/proxy-protocol.git" +repository = "https://github.com/gen0sec/proxy-protocol" keywords = ["proxy", "proxy-protocol", "haproxy", "networking"] categories = ["network-programming", "parser-implementations"] links = "proxy-protocol" diff --git a/src/lib.rs b/src/lib.rs index 7197dbd..4c2b856 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -14,7 +14,7 @@ pub mod version1; pub mod version2; use bytes::{Buf, BytesMut}; -use snafu::{ensure, ResultExt as _, Snafu}; +use snafu::{ResultExt as _, Snafu, ensure}; #[derive(Debug, Snafu)] #[cfg_attr(not(feature = "always_exhaustive"), non_exhaustive)] // A new version may be added @@ -94,7 +94,9 @@ fn parse_version(buf: &mut impl Buf) -> Result { ensure!(buf.remaining() >= 13, NotProxyHeaderSnafu); ensure!( buf.chunk()[..12] - == [0x0D, 0x0A, 0x0D, 0x0A, 0x00, 0x0D, 0x0A, 0x51, 0x55, 0x49, 0x54, 0x0A], + == [ + 0x0D, 0x0A, 0x0D, 0x0A, 0x00, 0x0D, 0x0A, 0x51, 0x55, 0x49, 0x54, 0x0A + ], NotProxyHeaderSnafu ); buf.advance(12); diff --git a/src/version1.rs b/src/version1.rs index 313e9b5..93d8b8d 100644 --- a/src/version1.rs +++ b/src/version1.rs @@ -1,5 +1,5 @@ use bytes::{Buf, BufMut as _, BytesMut}; -use snafu::{ensure, OptionExt as _, ResultExt as _, Snafu}; +use snafu::{OptionExt as _, ResultExt as _, Snafu, ensure}; use std::{ io::Write as _, net::{AddrParseError, IpAddr, Ipv4Addr, Ipv6Addr, SocketAddrV4, SocketAddrV6}, diff --git a/src/version2.rs b/src/version2.rs index 238085c..eb7264d 100644 --- a/src/version2.rs +++ b/src/version2.rs @@ -1,5 +1,5 @@ use bytes::{Buf, BufMut as _, BytesMut}; -use snafu::{ensure, Snafu}; +use snafu::{Snafu, ensure}; use std::convert::TryInto; use std::net::{Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6};