From 80397930106d1ccf2e7c55e5e777b46fc7ee6a2c Mon Sep 17 00:00:00 2001 From: Nils Pukropp Date: Tue, 30 Jun 2026 04:33:31 +0200 Subject: [PATCH] added badges + github templates --- .github/ISSUE_TEMPLATE/bug_report.md | 36 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 20 +++++++++++++ .github/pull_request_template.md | 24 +++++++++++++++ README.md | 16 +++++++--- SECURITY.md | 23 +++++++++++++++ crates/proton-drive-rs/src/lib.rs | 1 + crates/proton-sdk/src/lib.rs | 2 ++ rust-toolchain.toml | 3 ++ 8 files changed, 121 insertions(+), 4 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/pull_request_template.md create mode 100644 SECURITY.md create mode 100644 rust-toolchain.toml diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..92a1cf4 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,36 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: bug +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Configure client with '...' +2. Perform '...' +3. See error '...' + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Code Snippet (if applicable)** +```rust +// Paste a minimal code example showing the issue +``` + +**Logs & Traces** +If applicable, run with `RUST_LOG=debug` or `RUST_LOG=trace` and paste the relevant log output here. Please sanitize any private keys or tokens before pasting! + +**Environment Details:** + - OS: [e.g. Linux Ubuntu 22.04] + - Rust Version: [e.g. 1.96.0] + - `proton-sdk-rs` Crate Version: [e.g. 0.1.2] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..11fc491 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: enhancement +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..514e04d --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,24 @@ +## Description + +Please include a summary of the change and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change. + +Fixes # (issue) + +## Type of Change + +- [ ] Bug fix (non-breaking change which fixes an issue) +- [ ] New feature (non-breaking change which adds functionality) +- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) +- [ ] Code style update / formatting / refactoring +- [ ] Documentation update +- [ ] CI/CD or build toolchain changes + +## Checklist + +- [ ] My code follows the style guidelines of this project +- [ ] I have performed a self-review of my own code +- [ ] I have commented my code, particularly in hard-to-understand areas +- [ ] I have made corresponding changes to the documentation +- [ ] My changes generate no new warnings when compiling or running clippy +- [ ] I have run local offline unit tests and verified they pass +- [ ] If applicable, I have verified the changes with the live integration tests (`cargo test --test 'live_*' -- --ignored`) diff --git a/README.md b/README.md index 4796e1d..cbbc96c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,13 @@ # proton-sdk-rs +[![CI](https://github.com/narrrl/proton-sdk-rs/actions/workflows/ci.yml/badge.svg)](https://github.com/narrrl/proton-sdk-rs/actions/workflows/ci.yml) +[![Crates.io (proton-sdk)](https://img.shields.io/crates/v/proton-sdk.svg?label=proton-sdk)](https://crates.io/crates/proton-sdk) +[![Crates.io (proton-drive-rs)](https://img.shields.io/crates/v/proton-drive-rs.svg?label=proton-drive-rs)](https://crates.io/crates/proton-drive-rs) +[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) +[![Rust: 1.96+](https://img.shields.io/badge/rust-1.96%2B-orange.svg)](https://github.com/narrrl/proton-sdk-rs) +[![Dependency Status](https://deps.rs/repo/github/narrrl/proton-sdk-rs/status.svg)](https://deps.rs/repo/github/narrrl/proton-sdk-rs) +[![unsafe forbidden](https://img.shields.io/badge/unsafe-forbidden-success.svg)](https://github.com/narrrl/proton-sdk-rs) + A pure-Rust reimplementation of the [Proton Drive SDK](https://github.com/ProtonDriveApps/sdk). This repository contains two primary crates that replicate the functionality of the official Proton SDKs (available locally in the [sdk/](file:///home/narl/dev/private/proton-sdk-rs/sdk) submodule). Rather than relying on FFI bindings to the official C# NativeAOT core, `proton-sdk-rs` is a **pure-Rust** implementation. It communicates directly with the Proton Drive API over HTTP and performs all OpenPGP cryptographic operations natively using the [`pgp` (rPGP)](https://crates.io/crates/pgp) crate. @@ -21,10 +29,10 @@ This SDK is the core engine powering the following real-world projects: The workspace is divided into two crates, mirroring the separation of concerns in the upstream C# codebase: -| Crate | Analogue | Description | Key Modules / Entrypoint | -| --- | --- | --- | --- | -| **[crates/proton-sdk](file:///home/narl/dev/private/proton-sdk-rs/crates/proton-sdk)** | `Proton.Sdk` | Foundational account, session, HTTP client, and OpenPGP cryptography. | [`ProtonApiSession`](file:///home/narl/dev/private/proton-sdk-rs/crates/proton-sdk/src/session.rs) | -| **[crates/proton-drive-rs](file:///home/narl/dev/private/proton-sdk-rs/crates/proton-drive-rs)** | `Proton.Drive.Sdk` | High-level Drive & Photos client operations, folders/links management, uploads/downloads, events, caching. | [`ProtonDriveClient`](file:///home/narl/dev/private/proton-sdk-rs/crates/proton-drive-rs/src/client.rs), [`ProtonPhotosClient`](file:///home/narl/dev/private/proton-sdk-rs/crates/proton-drive-rs/src/photos.rs) | +| Crate | Version | Docs | Analogue | Description | Key Modules / Entrypoint | +| --- | --- | --- | --- | --- | --- | +| [**`crates/proton-sdk`**](file:///home/narl/dev/private/proton-sdk-rs/crates/proton-sdk) | [![crates.io](https://img.shields.io/crates/v/proton-sdk.svg)](https://crates.io/crates/proton-sdk) | [![docs.rs](https://img.shields.io/docsrs/proton-sdk)](https://docs.rs/proton-sdk) | `Proton.Sdk` | Foundational account, session, HTTP client, and OpenPGP cryptography. | [`ProtonApiSession`](file:///home/narl/dev/private/proton-sdk-rs/crates/proton-sdk/src/session.rs) | +| [**`crates/proton-drive-rs`**](file:///home/narl/dev/private/proton-sdk-rs/crates/proton-drive-rs) | [![crates.io](https://img.shields.io/crates/v/proton-drive-rs.svg)](https://crates.io/crates/proton-drive-rs) | [![docs.rs](https://img.shields.io/docsrs/proton-drive-rs)](https://docs.rs/proton-drive-rs) | `Proton.Drive.Sdk` | High-level Drive & Photos client operations, folders/links management, uploads/downloads, events, caching. | [`ProtonDriveClient`](file:///home/narl/dev/private/proton-sdk-rs/crates/proton-drive-rs/src/client.rs), [`ProtonPhotosClient`](file:///home/narl/dev/private/proton-sdk-rs/crates/proton-drive-rs/src/photos.rs) | OpenPGP features are powered by rPGP (version `0.20`), and HTTP requests are built on `reqwest`. diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..3150810 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,23 @@ +# Security Policy + +## Supported Versions + +Only the latest release of `proton-sdk-rs` receives security updates. If you discover a vulnerability, please update to the latest version before reporting. + +| Version | Supported | +| ------- | --------- | +| >= 0.1.x | :white_check_mark: | +| < 0.1.0 | :x: | + +## Reporting a Vulnerability + +We take the security of this project seriously. Because this SDK handles highly sensitive account credentials, session tokens, and zero-knowledge cryptographic keys, we request that security vulnerabilities be reported responsibly. + +**Please do not open a public GitHub issue for security-related bugs.** + +To report a vulnerability: +1. Send an email to the project maintainer at `contact@narl.io` (referencing the email in `Cargo.toml`). +2. Provide a detailed description of the vulnerability, including steps to reproduce, code snippets, or a proof of concept if available. +3. We will acknowledge receipt of your report within 48 hours and work with you to coordinate a security release. + +Thank you for helping keep this SDK secure! diff --git a/crates/proton-drive-rs/src/lib.rs b/crates/proton-drive-rs/src/lib.rs index fd95b9c..06e53b5 100644 --- a/crates/proton-drive-rs/src/lib.rs +++ b/crates/proton-drive-rs/src/lib.rs @@ -31,6 +31,7 @@ //! # Ok(()) //! # } //! ``` +#![forbid(unsafe_code)] mod cache; mod client; diff --git a/crates/proton-sdk/src/lib.rs b/crates/proton-sdk/src/lib.rs index 0fe0d2f..f8c0134 100644 --- a/crates/proton-sdk/src/lib.rs +++ b/crates/proton-sdk/src/lib.rs @@ -9,6 +9,7 @@ //! Login/SRP is provided behind [`session::ProtonApiSession::begin`] but read //! workflows can be driven entirely through //! [`session::ProtonApiSession::resume`] with pre-obtained tokens. +#![forbid(unsafe_code)] pub mod account; pub mod api; @@ -23,3 +24,4 @@ pub mod telemetry; pub use error::{ProtonApiError, ProtonError, Result}; pub use session::ProtonApiSession; + diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..4f0430e --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,3 @@ +[toolchain] +channel = "1.96.0" +components = ["rustfmt", "clippy"]