server-util: make destination parameter of XMatrix::new mandatory
This commit is contained in:
parent
d91e6d7e63
commit
a8025de761
@ -1,5 +1,10 @@
|
||||
# [unreleased]
|
||||
|
||||
Breaking changes:
|
||||
|
||||
- The `XMatrix::new` method now takes `OwnedServerName` instead of `Option<OwnedServerName>`
|
||||
for the destination, since servers must always set the destination.
|
||||
|
||||
# 0.3.0
|
||||
|
||||
Breaking changes:
|
||||
|
@ -31,11 +31,11 @@ impl XMatrix {
|
||||
/// Construct a new X-Matrix Authorization header.
|
||||
pub fn new(
|
||||
origin: OwnedServerName,
|
||||
destination: Option<OwnedServerName>,
|
||||
destination: OwnedServerName,
|
||||
key: OwnedServerSigningKeyId,
|
||||
sig: String,
|
||||
) -> Self {
|
||||
Self { origin, destination, key, sig }
|
||||
Self { origin, destination: Some(destination), key, sig }
|
||||
}
|
||||
}
|
||||
|
||||
@ -259,7 +259,7 @@ mod tests {
|
||||
assert_eq!(credentials.key, key);
|
||||
assert_eq!(credentials.sig, sig);
|
||||
|
||||
let credentials = XMatrix::new(origin, None, key, sig);
|
||||
let credentials = XMatrix { origin, destination: None, key, sig };
|
||||
|
||||
assert_eq!(credentials.encode(), header);
|
||||
}
|
||||
@ -277,7 +277,7 @@ mod tests {
|
||||
assert_eq!(credentials.key, key);
|
||||
assert_eq!(credentials.sig, sig);
|
||||
|
||||
let credentials = XMatrix::new(origin, Some(destination), key, sig);
|
||||
let credentials = XMatrix::new(origin, destination, key, sig);
|
||||
|
||||
assert_eq!(credentials.encode(), header);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user