Skip to content

Commit

Permalink
Fix signature creation/test
Browse files Browse the repository at this point in the history
  • Loading branch information
jaymell committed Nov 18, 2022
1 parent 40188f6 commit dfa027c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 59 deletions.
27 changes: 0 additions & 27 deletions java/lib/src/main/java/com/svix/Main.java

This file was deleted.

33 changes: 1 addition & 32 deletions server/svix-server/src/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,7 @@ fn generate_msg_headers(
encryption: &Encryption,
whitelabel_headers: bool,
) -> Result<HeaderMap> {
let signatures = sign_msg(
encryption,
Utc::now().timestamp(),
body,
msg_id,
endpoint_signing_keys,
);
let signatures = sign_msg(encryption, timestamp, body, msg_id, endpoint_signing_keys);

let mut headers = HeaderMap::new();
let id = msg_id
Expand Down Expand Up @@ -887,15 +881,6 @@ mod tests {
/// accounted for
fn mock_headers() -> (HeaderMap, MessageId) {
let id = MessageId::new(None, None);

let signatures = sign_msg(
&Encryption::new_noop(),
TIMESTAMP,
BODY,
&id,
ENDPOINT_SIGNING_KEYS,
);

(
generate_msg_headers(
TIMESTAMP,
Expand Down Expand Up @@ -925,14 +910,6 @@ mod tests {
let (mut expected, id) = mock_headers();
let _ = expected.insert("test_key", "value".parse().unwrap());

let signatures = sign_msg(
&Encryption::new_noop(),
TIMESTAMP,
BODY,
&id,
ENDPOINT_SIGNING_KEYS,
);

let actual = generate_msg_headers(
TIMESTAMP,
&BODY,
Expand Down Expand Up @@ -963,14 +940,6 @@ mod tests {

let expected_signature_str = "v1,g0hM9SsE+OTPJTGt/tmIKtSyZlE3uFJELVlNIOLJ1OE=";

let signatures = sign_msg(
&Encryption::new_noop(),
test_timestamp,
test_body,
&test_message_id,
&[&test_key],
);

let actual = generate_msg_headers(
test_timestamp,
&test_body,
Expand Down

0 comments on commit dfa027c

Please sign in to comment.