Skip to content

Commit d739c21

Browse files
Merge pull request open-source-cooperative#10 from brotskydotcom/v4.1
prepare for v4.1 release - expose dbus::Path fields on Items and Collections - allow creation of Items and Collections from a remembered path - update the MSRV to 1.78 (minimum for `Cargo.lock` version 4) - make lifetimes explicit to avoid Clippy complaints
2 parents b3b59a6 + f1d4698 commit d739c21

13 files changed

Lines changed: 105 additions & 234 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 30 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -1,106 +1,41 @@
11
name: CI
2-
permissions:
3-
contents: read
42

5-
on:
6-
workflow_dispatch:
7-
pull_request:
8-
push:
9-
10-
env:
11-
CARGO_NET_RETRY: 3
3+
on: [ workflow_dispatch, push, pull_request ]
124

135
jobs:
14-
fmt:
15-
name: Rustfmt
16-
runs-on: ubuntu-latest
17-
18-
steps:
19-
- uses: actions/checkout@v4
20-
with:
21-
persist-credentials: false
22-
23-
- uses: actions-rust-lang/setup-rust-toolchain@v1
24-
with:
25-
toolchain: stable
26-
components: rustfmt
27-
28-
- name: "Check formatting"
29-
run: cargo fmt --all -- --check
30-
31-
clippy:
32-
name: Clippy
6+
ci_stable:
337
runs-on: ubuntu-latest
348

359
strategy:
3610
matrix:
37-
rust:
38-
- stable
39-
feature:
11+
features:
4012
- ""
41-
- crypto-rust
42-
- crypto-openssl
13+
- "vendored"
14+
- "crypto-rust"
15+
- "crypto-openssl"
16+
- "crypto-rust,vendored"
17+
- "crypto-openssl,vendored"
4318

4419
steps:
4520
- name: install required packages
4621
run: |
4722
sudo apt-get update
4823
sudo apt-get install -y libdbus-1-dev libssl-dev
4924
50-
- uses: actions/checkout@v4
51-
with:
52-
persist-credentials: false
25+
- name: Fetch head
26+
uses: actions/checkout@v5
5327

54-
- uses: actions-rust-lang/setup-rust-toolchain@v1
28+
- name: Install rust stable
29+
uses: actions-rust-lang/setup-rust-toolchain@v1
5530
with:
56-
toolchain: ${{ matrix.rust }}
57-
components: clippy
58-
59-
- uses: actions/cache@v4
60-
with:
61-
path: |
62-
~/.cargo/registry
63-
~/.cargo/git
64-
target
65-
key: $clippy-cache-${{ steps.toolchain.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.lock') }}
66-
67-
- name: "Clippy ${{ matrix.rust }}"
68-
run: cargo clippy --features=${{ matrix.feature }} --all-targets --workspace -- -D warnings
69-
70-
test:
71-
name: Tests
72-
runs-on: ubuntu-latest
73-
74-
strategy:
75-
matrix:
76-
rust:
77-
- stable
78-
feature:
79-
- ""
80-
- crypto-rust
81-
- crypto-openssl
82-
83-
steps:
84-
- name: install required packages
85-
run: |
86-
sudo apt-get update
87-
sudo apt-get install -y libdbus-1-dev libssl-dev
88-
89-
- uses: actions/checkout@v4
90-
with:
91-
persist-credentials: false
31+
toolchain: stable
32+
components: rustfmt, clippy
9233

93-
- uses: actions-rust-lang/setup-rust-toolchain@v1
94-
with:
95-
toolchain: ${{ matrix.rust }}
34+
- name: Format check
35+
run: cargo fmt --check
9636

97-
- uses: actions/cache@v4
98-
with:
99-
path: |
100-
~/.cargo/registry
101-
~/.cargo/git
102-
target
103-
key: $test-cache-${{ steps.toolchain.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.lock') }}
37+
- name: Clippy check
38+
run: cargo clippy --no-deps --all-targets -- -D warnings
10439

10540
- name: Install gnome-keyring
10641
run: sudo apt-get install -y gnome-keyring
@@ -111,51 +46,29 @@ jobs:
11146
# the login password doesn't matter, but the keyring must be unlocked for the tests to work
11247
run: gnome-keyring-daemon --components=secrets --daemonize --unlock <<< 'foobar'
11348

114-
- name: Run tests
115-
# run tests single-threaded to avoid race conditions
116-
run: cargo test --features=${{ matrix.feature }} -- --test-threads=1
49+
- name: Build and Test
50+
run: cargo test --no-default-features --features=${{ matrix.features }} --verbose
11751

118-
- name: Run example
119-
run: cargo run --features=${{ matrix.feature }} --example example
52+
- name: Build examples
53+
run: cargo build --examples --verbose
12054

121-
# MSRV, taken from matching secret-service.
122-
check_msrv:
123-
name: Check MSRV
55+
ci_msrv:
12456
runs-on: ubuntu-latest
12557

126-
strategy:
127-
matrix:
128-
feature:
129-
- ""
130-
- crypto-rust
131-
- crypto-openssl
132-
13358
steps:
13459
- name: install required packages
13560
run: |
13661
sudo apt-get update
13762
sudo apt-get install -y libdbus-1-dev libssl-dev
13863
139-
- uses: actions/checkout@v4
140-
with:
141-
persist-credentials: false
64+
- name: Fetch head
65+
uses: actions/checkout@v5
14266

143-
- uses: actions-rust-lang/setup-rust-toolchain@v1
67+
- name: Install rust MSRV
68+
uses: actions-rust-lang/setup-rust-toolchain@v1
14469
with:
145-
toolchain: "1.75.0"
70+
toolchain: 1.78
14671
components: clippy
14772

148-
- uses: actions/cache@v4
149-
with:
150-
path: |
151-
~/.cargo/registry
152-
~/.cargo/git
153-
target
154-
key: $clippy-cache-${{ steps.toolchain.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.lock') }}
155-
156-
- name: Generate lockfile
157-
run: |
158-
cargo generate-lockfile
159-
160-
- name: Clippy MSRV
161-
run: cargo clippy --features=${{ matrix.feature }} --all-targets --workspace -- -D warnings
73+
- name: Clippy check
74+
run: cargo clippy --no-deps --all-targets -- -D warnings

CHANGELOG.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,15 @@
1-
The detailed list of changes in each release can be found at https://github.com/hwchen/secret-service-rs/releases.
1+
## v4.1.0
2+
- expose dbus::Path fields on Items and Collections
3+
- allow creation of Items and Collections from a remembered path
4+
- update the MSRV to 1.78 (minimum for `Cargo.lock` version 4)
5+
- make lifetimes explicit to avoid Clippy complaints
6+
7+
### v4.0.3
8+
- doc updates only (no code changes)
9+
10+
### v4.0.2 API and doc fixes
11+
- add `Sync` to the error API
12+
- fix repository URL in `Cargo.toml`
13+
14+
# v4.0.0 first public release
15+
- same API as v4 of the secret-service crate.

Cargo.toml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,29 @@ repository = "https://github.com/brotskydotcom/dbus-secret-service.git"
77
keywords = ["secret-service", "password", "linux", "dbus"]
88
license = "MIT OR Apache-2.0"
99
name = "dbus-secret-service"
10-
version = "4.0.3"
10+
version = "4.1.0"
1111
edition = "2021"
12-
rust-version = "1.70"
12+
rust-version = "1.78" # required for Cargo.lock v4
1313
exclude = [".github/"]
1414

1515
[features]
1616
vendored = ["dbus/vendored", "openssl?/vendored"]
17-
crypto-rust = ["dep:aes", "dep:block-padding", "dep:cbc", "dep:fastrand", "dep:hkdf", "dep:sha2"]
18-
crypto-openssl = ["dep:fastrand", "dep:openssl"]
17+
crypto-rust = ["dep:aes", "dep:block-padding", "dep:cbc", "dep:fastrand", "dep:hkdf", "dep:num", "dep:once_cell", "dep:sha2"]
18+
crypto-openssl = ["dep:fastrand", "dep:num", "dep:once_cell", "dep:openssl"]
1919

2020
[dependencies]
2121
aes = { version = "0.8", optional = true }
2222
block-padding = { version = "0.3", features = ["std"], optional = true }
2323
cbc = { version = "0.1", features = ["block-padding", "alloc"], optional = true }
2424
dbus = "0.9"
2525
fastrand = { version = "2.3", optional = true }
26-
futures-util = "0.3"
2726
hkdf = { version = "0.12", optional = true }
28-
num = "0.4"
29-
once_cell = "1"
27+
num = { version = "0.4", optional = true }
28+
once_cell = { version = "1", optional = true }
3029
openssl = { version = "0.10.55", optional = true }
3130
sha2 = { version = "0.10", optional = true }
32-
zeroize = { version = "1.8.1", features = ["derive"] }
33-
34-
[dev-dependencies]
35-
test-with = { version = "0.12", default-features = false }
31+
zeroize = { version = "1.8", features = ["derive"] }
3632

3733
[package.metadata.docs.rs]
3834
features = ["crypto-rust"]
35+
targets = ["x86_64-unknown-linux-gnu"]

NOTES_ON_PORT.md

Lines changed: 0 additions & 32 deletions
This file was deleted.

README.md

Lines changed: 14 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -5,55 +5,37 @@
55
[![crates.io](https://img.shields.io/crates/v/dbus-secret-service.svg?style=flat-square)](https://crates.io/crates/dbus-secret-service)
66
[![docs.rs](https://docs.rs/dbus-secret-service/badge.svg)](https://docs.rs/dbus-secret-service)
77

8-
This crate is a knock-off of the [hwchen/secret-service](https://crates.io/crates/secret-service) crate, which is
9-
currently at version 4 and uses [zbus](https://crates.io/crates/zbus) to access the secret service. The basic
10-
collection, item and search APIs in this crate are meant to work the same as the blocking APIs in the zbus-based crate.
11-
If they don't, please file a bug.
8+
This crate started as a knock-off of the [secret-service](https://crates.io/crates/secret-service) crate, which uses [zbus](https://crates.io/crates/zbus) to access the secret service. The basic collection, item and search APIs in this crate are meant to work the same as the blocking APIs in the zbus-based crate. If they don't, please file a bug.
129

13-
Why do a knock-off? So that folks who write synchronous Rust apps that access the secret service (typically through
14-
the [hwchen/keyring](https://crates.io/crates/keyring) crate) are not required to add an async runtime. Because this
15-
knock-off uses lib-dbus, it doesn't require an async runtime.
16-
17-
Why is this crate starting at version 4? Since its API matches a particular version of the dbus-based crate, I figured
18-
it would be clearest if its version number matched that version as well.
10+
Why do a knock-off? So that folks who write synchronous Rust apps that access the secret service (for example, [Keyring](https://open-source-cooperative/keyring-rs/wiki/Keyring) clients) are not required to add an async runtime. Because this knock-off uses lib-dbus, it doesn't require an async runtime.
1911

2012
## Usage
2113

22-
For code usage examples, see the [documentation](https://docs.rs/dbus-secret-service).
14+
For code usage examples, see the [documentation](https://docs.rs/dbus-secret-service) and the [example program](https://github.com/open-source-cooperative/dbus-secret-service/blob/main/examples/example.rs).
2315

24-
This crate has no default features, and requires no features to run. If you need your secrets to be encrypted on their
25-
way to and from the secret service, then add one of the crypto features:
16+
This crate has no default features, and requires no features to run. If you want your secrets to be encrypted on their
17+
way to and from the secret service (highly recommended), then add one of the crypto features:
2618

2719
* `crypto-rust` uses pure Rust crates for encryption.
2820
* `crypto-openssl` uses the openssl libraries for encryption (which must be installed).
2921

30-
See the [documentation](https://docs.rs/dbus-secret-service) for details on how to specify use of an encrypted session.
22+
See the [documentation](https://docs.rs/dbus-secret-service) for details on how to connect to the Secret Service with an encrypted session.
3123

32-
To _build_ a project that uses this crate, your development machine will need
33-
to have the dbus development headers installed,
34-
and the openssl development headers for the `crypto-openssl` feature.
35-
To _run_ an application that uses this crate,
36-
your machine will need to have `libdbus` installed
37-
(almost all do),
38-
and the openssl libraries for the `crypto-openssl` feature.
39-
If you want to avoid this runtime requirement,
40-
you can specify the `vendored` feature at build time:
41-
this will statically link the needed libraries with your executable.
24+
To _build_ a project that uses this crate, your development machine will need to have the dbus development headers installed, and the openssl development headers for the `crypto-openssl` feature. To _run_ an application that uses this crate, your machine will need to have `libdbus` installed (almost all do), and the openssl libraries for the `crypto-openssl` feature. If you want to avoid this runtime requirement on clients, you can specify the `vendored` feature at build time: this will build and statically link the needed libraries with your executable.
4225

4326
### Functionality
4427

45-
- SecretService: initialize dbus, create plain/encrypted session.
46-
- Collections: create, delete, search.
47-
- Items: create, delete, search, get/set secret.
28+
* SecretService: initialize dbus, create plain or encrypted session connection.
29+
* Collections: create, delete, search.
30+
* Items: create, delete, search, get/set secret.
4831

49-
## Changelog
32+
## Change History
5033

51-
v4.0.0: first release, same API as secret-service v4.0.
34+
See [CHANGELOG.md](CHANGELOG.md).
5235

5336
## License
5437

55-
The copyright to all material in this repository belongs to the collective
56-
of contributors who have checked material into this repository.
38+
The copyright to all material in this repository belongs to the collective of contributors who have checked material into this repository.
5739

5840
All material is this repository is licensed under either of
5941

@@ -64,8 +46,4 @@ at your option.
6446

6547
## Contribution
6648

67-
Unless you explicitly state otherwise,
68-
any contribution intentionally submitted for inclusion in the work by you,
69-
as defined in the Apache-2.0 license,
70-
shall be dual licensed as above,
71-
without any additional terms or conditions.
49+
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

justfile

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)