From 72504a34fca1808bf96ed78a2a29a9b20d35051d Mon Sep 17 00:00:00 2001 From: PubNub Release Bot <120067856+pubnub-release-bot@users.noreply.github.com> Date: Mon, 16 Oct 2023 14:22:21 +0000 Subject: [PATCH] PubNub SDK 0.4.0 release. --- .pubnub.yml | 7 +++++- Cargo.toml | 2 +- README.md | 63 +++++++++++++++++++++++++++++++---------------------- src/lib.rs | 10 ++++----- 4 files changed, 49 insertions(+), 33 deletions(-) diff --git a/.pubnub.yml b/.pubnub.yml index 67a2b768..502b2912 100644 --- a/.pubnub.yml +++ b/.pubnub.yml @@ -1,9 +1,14 @@ name: rust -version: 0.3.0 +version: 0.4.0 schema: 1 scm: github.com/pubnub/rust files: [] changelog: + - date: 2023-10-16 + version: 0.4.0 + changes: + - type: feature + text: "Update the crypto module structure and add enhanced AES-CBC cryptor." - date: 2023-08-30 version: 0.3.0 changes: diff --git a/Cargo.toml b/Cargo.toml index bd83436b..fa95dd0f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pubnub" -version = "0.3.0" +version = "0.4.0" edition = "2021" license = "MIT" license-file = "LICENSE" diff --git a/README.md b/README.md index 370bec9c..ea8e056b 100644 --- a/README.md +++ b/README.md @@ -17,8 +17,9 @@ This is the official PubNub Rust SDK repository. [PubNub](https://www.pubnub.com/) takes care of the infrastructure and APIs needed for the realtime -communication layer of your application. Work on your app's logic and let PubNub handle sending and receiving -data across the world in less than 100ms. +communication layer of your application. Work on your app's logic and let +PubNub handle sending and receiving data across the world in less than +100ms. ## Getting started @@ -35,11 +36,11 @@ Add `pubnub` to your Rust project in the `Cargo.toml` file: ```toml # default features [dependencies] -pubnub = "0.3.0" +pubnub = "0.4.0" # all features [dependencies] -pubnub = { version = "0.3.0", features = ["full"] } +pubnub = { version = "0.4.0", features = ["full"] } ``` ### Example @@ -125,24 +126,25 @@ You can find more examples in our [examples](https://github.com/pubnub/rust/tree ## Features -The `pubnub` crate is split into multiple features. You can enable or disable them in the `Cargo.toml` file, like so: +The `pubnub` crate is split into multiple features. You can enable or +disable them in the `Cargo.toml` file, like so: ```toml # only blocking and access + default features [dependencies] -pubnub = { version = "0.3.0", features = ["blocking", "access"] } +pubnub = { version = "0.4.0", features = ["blocking", "access"] } # only parse_token + default features [dependencies] -pubnub = { version = "0.3.0", features = ["parse_token"] } +pubnub = { version = "0.4.0", features = ["parse_token"] } ``` ### Available features | Feature name | Description | Available PubNub APIs | | :------------ | :---------- | :------------- | -| `full` | Enables all non-conflicting features | Configuration, Publish, Subscribe, Access Manager, Parse Token, Presence | -| `default` | Enables default features: `publish`, `subscribe`, `serde`, `reqwest`, `aescbc`, `std` | Configuration, Publish, Subscribe | +| `full` | Enables all non-conflicting features | Configuration, Publish, Subscribe, Access Manager, Parse Token, Presence, Crypto Module | +| `default` | Enables default features: `publish`, `subscribe`, `serde`, `reqwest`, `std` | Configuration, Publish, Subscribe | | `publish` | Enables Publish API | Configuration, Publish | | `access` | Enables Access Manager API | Configuration, Access Manager | | `parse_token` | Enables parsing Access Manager tokens | Configuration, Parse Token | @@ -152,7 +154,7 @@ pubnub = { version = "0.3.0", features = ["parse_token"] } | `serde` | Uses [serde](https://github.com/serde-rs/serde) for serialization | n/a | | `reqwest` | Uses [reqwest](https://github.com/seanmonstar/reqwest) as a transport layer | n/a | | `blocking` | Enables blocking executions of APIs | n/a | -| `aescbc` | Enables AES-CBC encryption | n/a | +| `crypto` | Enables crypto module for data encryption and decryption | n/a | | `std` | Enables `std` library | n/a | ## Documentation @@ -162,16 +164,18 @@ pubnub = { version = "0.3.0", features = ["parse_token"] } ## Wasm support -The `pubnub` crate is compatible with WebAssembly. You can use it in your Wasm project. +The `pubnub` crate is compatible with WebAssembly. You can use it in your +Wasm project. ## `no_std` support -The `pubnub` crate is `no_std` compatible. To use it in a `no_std` environment, you have to disable the default -features and enable the ones you need, for example: +The `pubnub` crate is `no_std` compatible. To use it in a `no_std` +environment, you have to disable the default features and enable the ones +you need, for example: ```toml [dependencies] -pubnub = { version = "0.3.0", default-features = false, features = ["serde", "publish", +pubnub = { version = "0.4.0", default-features = false, features = ["serde", "publish", "blocking"] } ``` @@ -179,35 +183,42 @@ pubnub = { version = "0.3.0", default-features = false, features = ["serde", "pu The `no_std` support is limited by the implementation details of the SDK. -The SDK uses the `alloc` crate to allocate memory for some operations, which means that -certain targets aren't supported. Additionally, as we provide a synchronous API, we use -some parts of the `alloc::sync` module, which is also not supported in certain `no_std` environments. +The SDK uses the `alloc` crate to allocate memory for some operations, which +means that certain targets aren't supported. Additionally, as we provide a +synchronous API, we use some parts of the `alloc::sync` module, which is +also not supported in certain `no_std` environments. Some SDK features aren't supported in a `no_std` environment: * partially `access` module (because of lack of timestamp support) -* partially `reqwest` transport (because of the reqwest implementation details) -* partially `subscribe` module (because of the spawning tasks and time dependence) -* partially `presence` module (because of the spawning tasks and time dependence) +* partially `reqwest` transport (because of the reqwest implementation + details) +* partially `subscribe` module (because of the spawning tasks and time + dependence) +* partially `presence` module (because of the spawning tasks and time + dependence) * `std` feature (because of the `std` library) -We depend on a random number generator to generate data for debugging purposes. -If you want to use the SDK in a `no_std` environment, you'll have to provide -your own random number generator implementation for certain targets. +We depend on a random number generator to generate data for debugging +purposes. If you want to use the SDK in a `no_std` environment, you'll have +to provide your own random number generator implementation for certain +targets. See more: * [`getrandom` crate](https://docs.rs/getrandom/latest/getrandom/) * [no_std examples](https://github.com/pubnub/rust/tree/master/examples/no_std/) -If you're having problems compiling this crate for more exotic targets, you can try to use the -`extra_platforms` feature. Be aware that this feature is **not supported** and we do not recommend using it. +If you're having problems compiling this crate for more exotic targets, you +can try to use the `extra_platforms` feature. Be aware that this feature is +**not supported** and we do not recommend using it. For more information about this feature. refer to [Cargo.toml](https://github.com/pubnub/rust/blob/master/Cargo.toml) in the `[features]` section. ## Support -If you **need help** or have a **general question**, contact support@pubnub.com. +If you **need help** or have a **general question**, contact +support@pubnub.com. ## License diff --git a/src/lib.rs b/src/lib.rs index 1d20ad62..8fc95901 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -39,11 +39,11 @@ //! ```toml //! # default features //! [dependencies] -//! pubnub = "0.3.0" +//! pubnub = "0.4.0" //! //! # all features //! [dependencies] -//! pubnub = { version = "0.3.0", features = ["full"] } +//! pubnub = { version = "0.4.0", features = ["full"] } //! ``` //! //! ### Example @@ -135,11 +135,11 @@ //! ```toml //! # only blocking and access + default features //! [dependencies] -//! pubnub = { version = "0.3.0", features = ["blocking", "access"] } +//! pubnub = { version = "0.4.0", features = ["blocking", "access"] } //! //! # only parse_token + default features //! [dependencies] -//! pubnub = { version = "0.3.0", features = ["parse_token"] } +//! pubnub = { version = "0.4.0", features = ["parse_token"] } //! ``` //! //! ### Available features @@ -178,7 +178,7 @@ //! //! ```toml //! [dependencies] -//! pubnub = { version = "0.3.0", default-features = false, features = ["serde", "publish", +//! pubnub = { version = "0.4.0", default-features = false, features = ["serde", "publish", //! "blocking"] } //! ``` //!