Skip to content

Commit

Permalink
KeyUtil -> KeyUtils (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
unkcpz authored Feb 18, 2025
1 parent a58de95 commit 41e1e86
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ For the fallback support to use only `keyutils`, the key stored will disappear a
from keyringrs import Entry, CredentialType

# Create an entry use only keyutils in linux
entry = Entry("my-service", "my-name", credential_type=CredentialType.KeyUtil)
entry = Entry("my-service", "my-name", credential_type=CredentialType.KeyUtils)
```

This interface follows the same logic as `keyring-rs` to ensure consistency and ease of use.
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub(crate) enum CredentialType {
Default = 0,

#[cfg(target_os = "linux")]
KeyUtil = 1,
KeyUtils = 1,
}

#[pyclass(name = "Entry")]
Expand Down Expand Up @@ -49,7 +49,7 @@ impl PyEntry {
})
}
#[cfg(target_os = "linux")]
CredentialType::KeyUtil => {
CredentialType::KeyUtils => {
let builder = keyutils::default_credential_builder();
let credential = builder.build(target, service, user).map_err(to_py_err)?;
let entry = Entry::new_with_credential(credential);
Expand Down
4 changes: 2 additions & 2 deletions tests/test_keyutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ def test_entry():
# Set a password
pass_str = "0Xl$$K6o2bBwDe"

# The default linux credential is KeyUtil persistence, which require properly set up dbus
# The default linux credential is KeyUtils persistence, which require properly set up dbus
with pytest.raises(Exception):
entry.set_password(pass_str)


def test_entry_keyutil():
entry = Entry("my-service", "my-name", credential_type=CredentialType.KeyUtil)
entry = Entry("my-service", "my-name", credential_type=CredentialType.KeyUtils)

# Set a password
pass_str = "0Xl$$K6o2bBwDe"
Expand Down

0 comments on commit 41e1e86

Please sign in to comment.