Skip to content

Commit

Permalink
Fix serde for Key and add Key generation methods (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
moubctez authored Dec 12, 2024
1 parent fbb88ee commit 59ea9bd
Show file tree
Hide file tree
Showing 14 changed files with 232 additions and 137 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ on:
branches:
- main
paths-ignore:
- 'LICENSE'
- "LICENSE"
pull_request:
branches:
- main
paths-ignore:
- 'LICENSE'
- "LICENSE"

env:
CARGO_TERM_COLOR: always

jobs:
test:
runs-on: [self-hosted, Linux]
container: rust:1.75
container: rust:1.80

steps:
- name: Debug
Expand Down
124 changes: 77 additions & 47 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 11 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[package]
name = "defguard_wireguard_rs"
version = "0.5.5"
version = "0.6.0"
edition = "2021"
rust-version = "1.80"
description = "A unified multi-platform high-level API for managing WireGuard interfaces"
license = "Apache-2.0"
readme = "README.md"
Expand All @@ -13,12 +14,13 @@ categories = ["network-programming"]
[dependencies]
base64 = "0.22"
log = "0.4"
serde = { version = "1.0", features = ["derive"] }
thiserror = "1.0"
serde = { version = "1.0", features = ["derive"], optional = true }
thiserror = "2.0"
x25519-dalek = { version = "2.0", features = ["getrandom", "static_secrets"] }

[dev-dependencies]
env_logger = "0.11"
x25519-dalek = { version = "2.0", features = ["getrandom", "static_secrets"] }
serde_test = "1.0"

[target.'cfg(target_os = "freebsd")'.dependencies]
libc = { version = "0.2", default-features = false }
Expand All @@ -40,6 +42,11 @@ netlink-packet-utils = "0.5"
netlink-packet-wireguard = "0.2"
netlink-sys = "0.8"

[features]
default = ["serde"]
check_dependencies = []
serde = ["dep:serde"]

[profile.release]
lto = "thin"
strip = "symbols"
4 changes: 2 additions & 2 deletions src/bsd/nvlist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ pub enum NvValue<'a> {
// NvListAUp,
}

impl<'a> NvValue<'a> {
impl NvValue<'_> {
/// Return number of bytes this value occupies when packed.
#[must_use]
pub fn byte_size(&self) -> usize {
Expand Down Expand Up @@ -162,7 +162,7 @@ pub struct NvList<'a> {
is_big_endian: bool,
}

impl<'a> Default for NvList<'a> {
impl Default for NvList<'_> {
fn default() -> Self {
Self::new()
}
Expand Down
Loading

0 comments on commit 59ea9bd

Please sign in to comment.