Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR release v0.5.0 #95

Merged
merged 24 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
d67ceb7
Refactor to desired structure (#93)
toelo3 Dec 17, 2024
ee2bfb2
Feature/schema store api (#96)
toelo3 Dec 24, 2024
8cc424f
Dsh kafka config (#97)
toelo3 Jan 3, 2025
17c552b
Fix missing rdkafka-config default features
toelo3 Jan 3, 2025
bfcd922
Feature/update examples (#103)
toelo3 Jan 8, 2025
f284882
Merge branch 'main' into release/0.5.0
toelo3 Jan 8, 2025
2fd8301
restore original Properties to have proper deprecation warnings
toelo3 Jan 8, 2025
5344c6f
restore deprectated code to original to have proper deprecated warnin…
toelo3 Jan 8, 2025
2f6ec80
Untangle errors enum and update documentation (#105)
toelo3 Jan 9, 2025
19403ab
Feature/remove metrics (#106)
toelo3 Jan 10, 2025
e164f48
improving README.md (#108)
Arend-Jan Jan 13, 2025
a04f85f
110 improve in code documentation (#111)
Arend-Jan Jan 13, 2025
cf118f4
move platform
toelo3 Jan 13, 2025
beed01a
bump to 0.5.0-rc.2
toelo3 Jan 13, 2025
36135f7
FQDN links so it is compatible on docs.rs
toelo3 Jan 13, 2025
c9f2f9b
restore dlq for deprecation warning
toelo3 Jan 13, 2025
3b21159
update changelog and dlq documentation
toelo3 Jan 13, 2025
cfe6bf0
fmt
toelo3 Jan 13, 2025
93e45ad
cargo clippy
toelo3 Jan 13, 2025
b681c2a
112 improve in code documentation 2 (#113)
Arend-Jan Jan 14, 2025
e1ce115
rename platform methods to meaningful names (#115)
toelo3 Jan 15, 2025
21888ed
114 review protocol token fetcher (#116)
toelo3 Jan 22, 2025
0b92924
Finalize release, minor improvements (#117)
toelo3 Jan 22, 2025
97d7cfb
Update CHANGELOG.md
toelo3 Jan 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ test_files/
*.iws
*.iml
*.ipr

.env
4 changes: 2 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ The following versions of this project are currently being supported with securi

| Version | Supported |
| ------- | ------------------ |
| 0.4.x | :white_check_mark: |
| 0.5.x | :white_check_mark: |
| 0.4.x | :white_check_mark: (till 28/02/2025) |
| 0.3.x | :x: |
| 0.2.x | :x: |
| 0.1.x | :x: |
Expand All @@ -25,7 +26,6 @@ The following versions of this project are currently being supported with securi
[![dependency status](https://deps.rs/repo/github/kpn-dsh/dsh-sdk-platform-rs/status.svg)](https://deps.rs/repo/github/kpn-dsh/dsh-sdk-platform-rs).



## Reporting a Vulnerability

If you have found a vulnerability or bug, you can report it to unibox@kpn.com.
Expand Down
8 changes: 4 additions & 4 deletions dsh_rest_api_client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ It is recommended to use the Rest Token Fetcher from the `dsh_sdk` crate. To do

```toml
[dependencies]
dsh_rest_api_client = "0.2.0"
dsh_sdk = { version = "0.4", features = ["rest-token-fetcher"], default-features = false }
dsh_rest_api_client = "0.3.0"
dsh_sdk = { version = "0.5", features = ["management-api-token-fetcher"], default-features = false }
tokio = { version = "1", features = ["full"] }
```

To use the client in your project:
```rust
use dsh_rest_api_client::Client;
use dsh_sdk::{Platform, RestTokenFetcherBuilder};
use dsh_sdk::{Platform, ManagementApiTokenFetcherBuilder};

const CLIENT_SECRET: &str = "";
const TENANT: &str = "tenant-name";
Expand All @@ -55,7 +55,7 @@ async fn main() {
let platform = Platform::NpLz;
let client = Client::new(platform.endpoint_rest_api());

let tf = RestTokenFetcherBuilder::new(platform)
let tf = ManagementApiTokenFetcherBuilder::new(platform)
.tenant_name(TENANT.to_string())
.client_secret(CLIENT_SECRET.to_string())
.build()
Expand Down
43 changes: 43 additions & 0 deletions dsh_sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,49 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.5.0] - 2025-01-22
### Added
- DSH Kafka Config trait to configure kafka client with RDKafka implementation
- DSH Schema store API Client
- New public functions `dsh_sdk::certificates::Cert`
- Bootstrap to DSH
- Read certificates from PKI_CONFIG_DIR
- Add support reading private key in DER format when reading from PKI_CONFIG_DIR
- Implement `TryFrom<&Str>` and `RryFrom<String>` for `dsh_sdk::Platform`

### Changed
- **Breaking change:** `DshError` is now split into error enums per feature flag to untangle mess
- `dsh_sdk::DshError` only applies on `bootstrap` feature flag
- **Breaking change:** `dsh_sdk::Dsh::reqwest_client_config` now returns `reqwest::ClientConfig` instead of `Result<reqwest::ClientConfig>`
- **Breaking change:** `dsh_sdk::Dsh::reqwest_blocking_client_config` now returns `reqwest::ClientConfig` instead of `Result<reqwest::ClientConfig>`
- **Breaking change:** `dsh_sdk::utils::Dlq` does not require `Dsh`/`Properties` as argument anymore
- **Breaking change:** `dsh_sdk::utils::Dlq::new` is removed and replaced with `dsh_sdk::utils::Dlq::start` which starts the DLQ and returns a channel to send dlq messages
- **Breaking change:** Deprecated `dsh_sdk::dsh::properties` module
- **Breaking change:** Moved `dsh_sdk::rest_api_token_fetcher` to `dsh_sdk::management_api::token_fetcher` and renamed `RestApiTokenFetcher` to `ManagementApiTokenFetcher`
- **Breaking change:** `dsh_sdk::error::DshRestTokenError` renamed to `dsh_sdk::management_api::error::ManagementApiTokenError`
- **NOTE** Cargo.toml feature flag `rest-token-fetcher` renamed to`management-api-token-fetcher`
- Moved `dsh_sdk::dsh::datastream` to `dsh_sdk::datastream`
- Moved `dsh_sdk::dsh::certificates` to `dsh_sdk::certificates`
- Private module `dsh_sdk::dsh::bootstrap` and `dsh_sdk::dsh::pki_config_dir` are now part of `certificates` module
- **Breaking change:** Moved `dsh_sdk::mqtt_token_fetcher` to `dsh_sdk::protocol_adapters::token` and renamed to `ApiClientTokenFetcher`
- **NOTE** The code is refactored to follow the partial mediation and full mediation pattern
- **NOTE** Cargo.toml feature flag `mqtt-token-fetcher` renamed to `protocol-token`
- **Breaking change:** Renamed `dsh_sdk::Platform` methods to more meaningful names
- **Breaking change:** Moved `dsh_sdk::dlq` to `dsh_sdk::utils::dlq`
- **Breaking change:** Moved `dsh_sdk::graceful_shutdown` to `dsh_sdk::utils::graceful_shutdown`
- **Breaking change:** Moved `dsh_sdk::metrics` to `dsh_sdk::utils::metrics`
- **Breaking change:** `dsh_sdk::utils::metrics::start_metrics_server` requires `fn() -> String` which gathers and encodes metrics

### Removed
- Removed `dsh_sdk::rdkafka` public re-export, import `rdkafka` directly
- **NOTE** Feature-flag `rdkafka-ssl` and `rdkafka-ssl-vendored` are removed!
- Removed re-export of `prometheus` and `lazy_static` in `metrics` module, if needed import them directly
- **NOTE** See [examples](./examples/expose_metrics.rs) how to use the http server

- Removed `Default` trait for `Dsh` (original `Properties`) struct as this should be public

### Fixed

## [0.4.11] -2024-09-30
### Fixed
- Retry mechanism for when PKI endpoint is not yet avaialble during rolling restart DSH ([#101](https://github.com/kpn-dsh/dsh-sdk-platform-rs/issues/101))
Expand Down
62 changes: 41 additions & 21 deletions dsh_sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,49 +9,69 @@ license.workspace = true
name = "dsh_sdk"
readme = 'README.md'
repository.workspace = true
version = "0.4.11"
version = "0.5.0"

[package.metadata.docs.rs]
all-features = true

[dependencies]
apache-avro = {version = "0.17", optional = true }
base64 = {version = "0.22", optional = true }
bytes = { version = "1.6", optional = true }
dashmap = {version = "6.0", optional = true}
http-body-util = { version = "0.1", optional = true }
hyper = { version = "1.3", features = ["server", "http1"], optional = true }
hyper-util = { version = "0.1", features = ["tokio"], optional = true }
lazy_static = { version = "1.5", optional = true }
hyper = { version = "1.5", features = ["client", "http1"], optional = true }
hyper-util = { version = "0.1", features = ["tokio","client-legacy"], optional = true }
hyper-rustls = { version = "0.27",features = ["ring","http1", "native-tokio", "logging"], default-features = false, optional = true }
http = { version = "1.2", optional = true }
rustls = { version = "0.23", features = ["ring", "tls12", "logging"], default-features = false, optional = true }
rustls-pemfile = { version = "2.2", optional = true }
log = "0.4"
pem = "3"
prometheus = { version = "0.13", features = ["process"], optional = true }
pem = {version = "3", optional = true }
protofish = { version = "0.5.2", optional = true }
rcgen = { version = "0.13", optional = true }
reqwest = { version = "0.12", default-features = false, features = ["rustls-tls", "json", "blocking"], optional = true }
rdkafka = { version = "0.36", features = ["cmake-build"], optional = true }
rdkafka = { version = "0.37", default-features = false, optional = true }
serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1.0", optional = true }
serde_json = { version = "1.0", features = ["preserve_order"], optional = true }
sha2 = { version = "0.10", optional = true}
thiserror = "2.0"
tokio = { version = "^1.35", features = ["signal", "sync", "time", "macros"], optional = true }
tokio-util = { version = "0.7", default-features = false, optional = true }

[features]
default = ["bootstrap", "graceful_shutdown", "metrics", "rdkafka-ssl"]
# default = ["bootstrap", "graceful-shutdown", "metrics", "rdkafka-ssl", "schema-store"]
default = ["bootstrap", "kafka", "rdkafka-config"]

bootstrap = ["rcgen", "reqwest", "pem", "serde_json", "tokio/rt-multi-thread"]
kafka = ["bootstrap"]
rdkafka-config = ["rdkafka", "kafka"] # Impl of config trait only
schema-store = ["bootstrap", "reqwest", "serde_json", "apache-avro", "protofish"]
graceful-shutdown = ["tokio", "tokio-util"]
management-api-token-fetcher = ["reqwest"]
protocol-token = ["base64", "reqwest", "serde_json", "sha2", "tokio/sync"]
metrics = [ "hyper/server", "hyper/http1" , "hyper-util", "http-body-util", "tokio", "bytes"]
dlq = ["tokio", "bootstrap", "rdkafka-config", "rdkafka/cmake-build", "rdkafka/ssl-vendored", "rdkafka/libz", "rdkafka/tokio", "graceful-shutdown"]

# http-protocol-adapter = ["protocol-token"]
# mqtt-protocol-adapter = ["protocol-token"]
# hyper-client = ["hyper", "hyper-util", "hyper-rustls", "rustls", "http", "rustls-pemfile"]
# deprecated!
mqtt-token-fetcher = ["protocol-token"]
rest-token-fetcher = ["management-api-token-fetcher"]

bootstrap = ["rcgen", "serde_json", "reqwest", "tokio/rt-multi-thread"]
metrics = ["prometheus", "hyper", "hyper-util", "http-body-util", "lazy_static", "tokio", "bytes"]
dlq = ["tokio", "bootstrap", "rdkafka-ssl", "graceful_shutdown"]
graceful_shutdown = ["tokio", "tokio-util"]
rdkafka-ssl-vendored = ["rdkafka", "rdkafka/ssl-vendored"]
rdkafka-ssl = ["rdkafka", "rdkafka/ssl"]
rest-token-fetcher = ["reqwest"]
mqtt-token-fetcher = ["base64","dashmap","reqwest","serde_json","sha2","tokio/sync"]

[dev-dependencies]
# Dependencies for the test
mockito = "1.1.1"
openssl = "0.10"
tokio = { version = "^1.35", features = ["full"] }
hyper = { version = "1.2.0", features = ["full"]}
hyper = { version = "1.3", features = ["full"] }
serial_test = "3.1.0"
dsh_rest_api_client = { path = "../dsh_rest_api_client", version = "0.3.0-rc.1" }
dsh_sdk = { features = ["dlq"], path = "." }
dsh_rest_api_client = { path = "../dsh_rest_api_client", version = "0.3.0" }
# Dependencies for the examples
dsh_sdk = { features = ["dlq"], path = "." }
env_logger = "0.11"
rdkafka = { version = "0.37", features = ["cmake-build", "ssl-vendored"], default-features = true }
lazy_static = { version = "1.5" }
prometheus = { version = "0.13", features = ["process"] }
rumqttc = { version = "0.24", features = ["websocket"] }
Loading
Loading