diff --git a/CHANGELOG b/CHANGELOG new file mode 100644 index 0000000..209abf4 --- /dev/null +++ b/CHANGELOG @@ -0,0 +1,5 @@ +# Changelog + +### 0.0.13 + +- Ability to serialize logout requests diff --git a/CONTRIBUTORS b/CONTRIBUTORS index a8ba4de..e33dc2b 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -8,3 +8,4 @@ - luqmana - RavuAlHemio - samueltardieu +- ServiusHack diff --git a/Cargo.lock b/Cargo.lock index 9c48cb1..11b8ac8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -31,11 +31,11 @@ checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" [[package]] name = "bindgen" -version = "0.65.1" +version = "0.68.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfdf7b466f9a4903edc73f95d6d2bcd5baf8ae620638762244d3f60143643cc5" +checksum = "726e4313eb6ec35d2730258ad4e15b547ee75d6afaa1361a922e78e59b7d8078" dependencies = [ - "bitflags", + "bitflags 2.4.0", "cexpr", "clang-sys", "lazy_static", @@ -48,7 +48,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.15", + "syn 2.0.38", "which", ] @@ -58,6 +58,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" + [[package]] name = "bumpalo" version = "3.12.1" @@ -161,7 +167,7 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.15", + "syn 2.0.38", ] [[package]] @@ -178,7 +184,7 @@ checksum = "2345488264226bf682893e25de0769f3360aac9957980ec49361b083ddaa5bc5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.38", ] [[package]] @@ -484,7 +490,7 @@ version = "0.10.52" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "01b8574602df80f7b85fdfc5392fa884a4e3b3f4f35402c070ab34c3d3f78d56" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cfg-if", "foreign-types", "libc", @@ -501,7 +507,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.38", ] [[package]] @@ -548,28 +554,28 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "prettyplease" -version = "0.2.4" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ceca8aaf45b5c46ec7ed39fff75f57290368c1846d33d24a122ca81416ab058" +checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" dependencies = [ "proc-macro2", - "syn 2.0.15", + "syn 2.0.38", ] [[package]] name = "proc-macro2" -version = "1.0.56" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ "unicode-ident", ] [[package]] name = "quick-xml" -version = "0.28.2" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce5e73202a820a31f8a0ee32ada5e21029c81fd9e3ebf668a40832e4219d9d1" +checksum = "eff6510e86862b57b210fd8cbe8ed3f0d7d600b9c2863cd4549a2e033c66e956" dependencies = [ "memchr", "serde", @@ -577,9 +583,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.26" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -637,7 +643,7 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "samael" -version = "0.0.12" +version = "0.0.13" dependencies = [ "base64", "bindgen", @@ -683,7 +689,7 @@ checksum = "291a097c63d8497e00160b166a967a4a79c64f3facdd01cbd7502231688d77df" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.38", ] [[package]] @@ -711,9 +717,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.15" +version = "2.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822" +checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" dependencies = [ "proc-macro2", "quote", @@ -746,7 +752,7 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.38", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 2383ac0..ea812e6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "samael" -version = "0.0.12" +version = "0.0.13" authors = ["Nathan Jaremko "] edition = "2021" license = "MIT" @@ -20,24 +20,24 @@ crate-type = ["staticlib", "rlib"] xmlsec = ["libc", "lazy_static", "libxml"] [build-dependencies] -pkg-config = "^0.3.17" -bindgen = "^0.65.1" +pkg-config = "^0.3.17" +bindgen = "^0.68.1" [dependencies] openssl = "^0.10.0" openssl-sys = "^0.9.0" openssl-probe = "^0.1.2" url = "^2.1.1" -quick-xml = { version = "^0.28.2", features = [ "serialize" ] } +quick-xml = { version = "^0.30.0", features = ["serialize"] } serde = { version = "^1.0.0", features = ["derive"] } chrono = { version = "^0.4.0", features = ["serde"] } base64 = "^0.21.0" flate2 = "^1.0.0" rand = "^0.8.4" derive_builder = "^0.12.0" -libxml = { version = "^0.3.1", optional = true} -uuid = { version = "^1.3.0", features = [ "v4" ] } +libxml = { version = "^0.3.1", optional = true } +uuid = { version = "^1.3.0", features = ["v4"] } data-encoding = "2.2.0" -libc = {version = "^0.2.66", optional = true} -lazy_static = {version = "^1.4.0", optional = true} +libc = { version = "^0.2.66", optional = true } +lazy_static = { version = "^1.4.0", optional = true } thiserror = "^1.0.40" diff --git a/README.md b/README.md index 9e478c3..58770e1 100644 --- a/README.md +++ b/README.md @@ -29,18 +29,20 @@ If you want to use the `"xmlsec"` feature, you'll need to install the following # Build instructions -We use [nix](https://nixos.org/download.html) to faciliate reproducible builds of `samael`. +We use [nix](https://nixos.org) to faciliate reproducible builds of `samael`. It will ensure you have the required libraries installed in a way that won't cause any issues with the rest of your system. If you want to take advantage of this, you'll need to put in a little bit of work. -1. [Install nix](https://nixos.org/download.html) -2. Enable [nix flake support](https://nixos.wiki/wiki/Flakes#Non-NixOS) -3. Install [direnv](https://direnv.net/) -4. Install [cachix](https://docs.cachix.org/installation) -5. Run `cachix use nix-community` to enable a binary cache for the rust toolchain (otherwise you'll build the rust toolchain from scratch) -6. Run `nix-env -f '' -iA nix-direnv` and `echo "source $HOME/.nix-profile/share/nix-direnv/direnvrc" > $HOME/.direnvrc` to improve nix support for direnv -7. `cd` into this repo and run `nix build` then, after that finishes, `direnv allow` -8. Install the [direnv VS Code extension](https://marketplace.visualstudio.com/items?itemName=mkhl.direnv) +1. [Install nix](https://github.com/DeterminateSystems/nix-installer) +1. Install [direnv](https://direnv.net/) and [cachix](https://docs.cachix.org) + ``` + # Add ~/.nix-profile/bin to your path first + nix profile install nixpkgs/release-23.05#direnv + nix profile install nixpkgs/release-23.05#cachix + ``` +1. Run `cachix use nix-community` to enable a binary cache for the rust toolchain (otherwise you'll build the rust toolchain from scratch) +1. `cd` into this repo and run `direnv allow` +1. Install the [direnv VS Code extension](https://marketplace.visualstudio.com/items?itemName=mkhl.direnv) ## Building the library @@ -52,6 +54,7 @@ If you followed the above instructions, just `cd`-ing into the directory will se but if you don't want to install `direnv`, then just run `nix develop`. From their you can build as normal: + ```sh cargo build --features xmlsec cargo test --features xmlsec diff --git a/flake.lock b/flake.lock index c1235bc..3d8cb78 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "advisory-db": { "flake": false, "locked": { - "lastModified": 1681407813, - "narHash": "sha256-Q8KfbkxBsGtR+CGPkxlM7CiYSBhrVnpEm6rHS7OMJ6k=", + "lastModified": 1697295662, + "narHash": "sha256-7bJNs2Db/hWp7PeMDRpLj/CdGubzZ/Ge7QHL56XOoCI=", "owner": "rustsec", "repo": "advisory-db", - "rev": "23ff35f8259aca16ff14e4ce0da0f54cd496a26c", + "rev": "58c33af7fa0900f18653d647b35c204480f289e9", "type": "github" }, "original": { @@ -28,11 +28,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1681680516, - "narHash": "sha256-EB8Adaeg4zgcYDJn9sR6UMjN/OHdIiMMK19+3LmmXQY=", + "lastModified": 1697165857, + "narHash": "sha256-Cho+TPHCIfx/sVo5scjNDP2XUCpUxcyKvoMlJ8w9dgQ=", "owner": "ipetkov", "repo": "crane", - "rev": "54b63c8eae4c50172cb50b612946ff1d2bc1c75c", + "rev": "117ac48319c0dbcff5540781c7c5b18166e33f6a", "type": "github" }, "original": { @@ -44,11 +44,11 @@ "flake-compat": { "flake": false, "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "lastModified": 1696267196, + "narHash": "sha256-AAQ/2sD+0D18bb8hKuEEVpHUYD1GmO2Uh/taFamn6XQ=", "owner": "edolstra", "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "rev": "4f910c9827911b1ec2bf26b5a062cd09f8d89f85", "type": "github" }, "original": { @@ -62,11 +62,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1681202837, - "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", "owner": "numtide", "repo": "flake-utils", - "rev": "cfacdce06f30d2b68473a46042957675eebb3401", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", "type": "github" }, "original": { @@ -77,11 +77,11 @@ }, "nix-filter": { "locked": { - "lastModified": 1681154353, - "narHash": "sha256-MCJ5FHOlbfQRFwN0brqPbCunLEVw05D/3sRVoNVt2tI=", + "lastModified": 1694857738, + "narHash": "sha256-bxxNyLHjhu0N8T3REINXQ2ZkJco0ABFPn6PIe2QUfqo=", "owner": "numtide", "repo": "nix-filter", - "rev": "f529f42792ade8e32c4be274af6b6d60857fbee7", + "rev": "41fd48e00c22b4ced525af521ead8792402de0ea", "type": "github" }, "original": { @@ -92,17 +92,18 @@ }, "nixpkgs": { "locked": { - "lastModified": 1681737997, - "narHash": "sha256-pHhjgsIkRMu80LmVe8QoKIZB6VZGRRxFmIvsC5S89k4=", + "lastModified": 1696983906, + "narHash": "sha256-L7GyeErguS7Pg4h8nK0wGlcUTbfUMDu+HMf1UcyP72k=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "f00994e78cd39e6fc966f0c4103f908e63284780", + "rev": "bd1cde45c77891214131cbbea5b1203e485a9d51", "type": "github" }, "original": { - "id": "nixpkgs", - "ref": "nixos-unstable", - "type": "indirect" + "owner": "NixOS", + "ref": "nixos-23.05", + "repo": "nixpkgs", + "type": "github" } }, "root": { @@ -127,11 +128,11 @@ ] }, "locked": { - "lastModified": 1680488274, - "narHash": "sha256-0vYMrZDdokVmPQQXtFpnqA2wEgCCUXf5a3dDuDVshn0=", + "lastModified": 1696299134, + "narHash": "sha256-RS77cAa0N+Sfj5EmKbm5IdncNXaBCE1BSSQvUE8exvo=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "7ec2ff598a172c6e8584457167575b3a1a5d80d8", + "rev": "611ccdceed92b4d94ae75328148d84ee4a5b462d", "type": "github" }, "original": { @@ -150,11 +151,11 @@ ] }, "locked": { - "lastModified": 1681870826, - "narHash": "sha256-1YEXIdr5wwG8PWntvcjjoVpsAKOKuKEaFIy3vR0FGpo=", + "lastModified": 1697249410, + "narHash": "sha256-OmsnxNsjBB1DJlUuJyzDJJ7psbm4/VzokNT+o0ajzFQ=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "e2f975856a48ebecba4f95846b8f368f3808d4e7", + "rev": "dce60ca7fca201014868c08a612edb73a998310f", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index c29d201..1653d9c 100644 --- a/flake.nix +++ b/flake.nix @@ -1,6 +1,6 @@ { inputs = { - nixpkgs.url = "nixpkgs/nixos-unstable"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05"; flake-utils.url = "github:numtide/flake-utils"; nix-filter.url = "github:numtide/nix-filter"; rust-overlay = {