Skip to content

Commit 09fa8b3

Browse files
authored
Fix a confusing type parameter for generating signatures. (#32)
The `generate_signature_headers_content` method's `signing_key` argument references `PublicKey` as its type. That's semantically wrong - a signing key must be a private key. In this case, `PublicKey` is a type alias for `Vec<u8>`, which is why it works - but there's no reason for us to confuse the public. I have removed the `PublicKey` and replaced it directly with `Vec<u8>`, and bumped Cargo accordingly per semver.
1 parent f6731ee commit 09fa8b3

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ members = [
66
resolver = "2"
77

88
[workspace.package]
9-
version = "0.1.0"
9+
version = "0.1.1"
1010
authors = [
1111
"Akshat Mahajan <akshat@cloudflare.com>",
1212
"Gauri Baraskar <gbaraskar@cloudflare.com>",
@@ -32,4 +32,4 @@ serde_json = "1.0.140"
3232
data-url = "0.3.1"
3333

3434
# workspace dependencies
35-
web-bot-auth = { version = "0.1.0", path = "./crates/web-bot-auth" }
35+
web-bot-auth = { version = "0.1.1", path = "./crates/web-bot-auth" }

crates/web-bot-auth/src/message_signatures.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::components::CoveredComponent;
2-
use crate::keyring::{KeyRing, PublicKey};
2+
use crate::keyring::KeyRing;
33
use indexmap::IndexMap;
44
use sfv::SerializeValue;
55
use std::fmt;
@@ -292,7 +292,7 @@ impl MessageSigner {
292292
&self,
293293
message: &mut impl UnsignedMessage,
294294
expires: Duration,
295-
signing_key: &PublicKey,
295+
signing_key: &Vec<u8>,
296296
) -> Result<(), ImplementationError> {
297297
let components_to_cover = message.fetch_components_to_cover();
298298
let mut sfv_parameters = sfv::Parameters::new();

0 commit comments

Comments
 (0)