Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mozilla-services/remote-settings-client
Remote-Settings Client built using Rust
https://github.com/mozilla-services/remote-settings-client
mozilla remote-settings rust
Last synced: 28 days ago
JSON representation
Remote-Settings Client built using Rust
- Host: GitHub
- URL: https://github.com/mozilla-services/remote-settings-client
- Owner: mozilla-services
- License: mpl-2.0
- Created: 2020-06-18T16:39:57.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-11-07T15:35:57.000Z (about 2 months ago)
- Last Synced: 2024-11-07T16:35:29.893Z (about 2 months ago)
- Topics: mozilla, remote-settings, rust
- Language: Rust
- Homepage:
- Size: 375 KB
- Stars: 5
- Watchers: 5
- Forks: 7
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE-OF-CONDUCT.md
Awesome Lists containing this project
README
# Remote Settings Client
A Rust Remote Settings Client to fetch collection data.
Available features:
- Synchronization of local storage via [`rkv`](https://github.com/mozilla/rkv/), memory, or filesystem
- Signatures and cert chains verification via NSS [`rc_crypto`](https://github.com/mozilla/application-services/tree/main/components/support/rc_crypto) or [`ring`](https://lib.rs/crates/ring)+[`oid-registry`](https://lib.rs/crates/oid-registry)
- Download of attachments
- Write operations on records
- Signoff operations (request review, approve, reject)Relies on Mozilla's [viaduct](https://github.com/mozilla/application-services/tree/v75.0.0/components/viaduct) for its pluggable HTTP backend (eg. `reqwest` or `FFI` on Android).
See also the `Storage` and `Verification` traits to extend or customize the client behaviour.
## Quick start
`Cargo.toml`:
```toml
[dependencies]
remote-settings-client = { version = "0.1", features = ["ring_verifier"] }
viaduct = { git = "https://github.com/mozilla/application-services", rev = "v75.2.0"}
viaduct-reqwest = { git = "https://github.com/mozilla/application-services", rev = "v75.2.0"}
```Minimal example:
```rust
use remote_settings_client::Client;
pub use viaduct::set_backend;
pub use viaduct_reqwest::ReqwestBackend;fn main() {
set_backend(&ReqwestBackend).unwrap();let client = Client::builder()
.collection_name("search-config")
.build();match client.get() {
Ok(records) => println!("{:?}", records),
Err(error) => println!("Error fetching/verifying records: {:?}", error),
};
}
```See also our [demo project](rs-client-demo)!
## Documentation
[Crate documentation](https://docs.rs/remote_settings_client)
## Logging
Using [env_logger](https://docs.rs/env_logger), the log level can be set via an environ variable:
`RUSTLOG={debug/info} cargo run`
```rust
fn main() {
env_logger::init() // initialize logger
..
}
```## License
Licensed under Mozilla Public License, Version 2.0 (https://www.mozilla.org/en-US/MPL/2.0/)