-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: change ClientId & Handle format to URIs
- Loading branch information
Showing
8 changed files
with
37 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -971,7 +971,7 @@ test("end-to-end-identity", async () => { | |
"identifiers": [ | ||
{ | ||
"type": "wireapp-id", | ||
"value": "{\"name\":\"Alice Smith\",\"domain\":\"wire.com\",\"client-id\":\"im:wireapp=t6wRpI8BRSeviBwwiFp5MQ/[email protected]\",\"handle\":\"im:wireapp=alice_wire\"}", | ||
"value": "{\"name\":\"Alice Smith\",\"domain\":\"wire.com\",\"client-id\":\"wireapp://t6wRpI8BRSeviBwwiFp5MQ![email protected]\",\"handle\":\"wireapp://%[email protected]\"}", | ||
}, | ||
], | ||
"authorizations": [ | ||
|
@@ -989,7 +989,7 @@ test("end-to-end-identity", async () => { | |
"expires": "2016-01-02T14:09:30Z", | ||
"identifier": { | ||
"type": "wireapp-id", | ||
"value": "{\"name\":\"Alice Smith\",\"domain\":\"wire.com\",\"client-id\":\"im:wireapp=t6wRpI8BRSeviBwwiFp5MQ/[email protected]\",\"handle\":\"im:wireapp=alice_wire\"}", | ||
"value": "{\"name\":\"Alice Smith\",\"domain\":\"wire.com\",\"client-id\":\"wireapp://t6wRpI8BRSeviBwwiFp5MQ![email protected]\",\"handle\":\"wireapp://%[email protected]\"}", | ||
}, | ||
"challenges": [ | ||
{ | ||
|
@@ -1050,7 +1050,7 @@ test("end-to-end-identity", async () => { | |
"identifiers": [ | ||
{ | ||
"type": "wireapp-id", | ||
"value": "{\"name\":\"Alice Smith\",\"domain\":\"wire.com\",\"client-id\":\"im:wireapp=t6wRpI8BRSeviBwwiFp5MQ/[email protected]\",\"handle\":\"im:wireapp=alice_wire\"}", | ||
"value": "{\"name\":\"Alice Smith\",\"domain\":\"wire.com\",\"client-id\":\"wireapp://t6wRpI8BRSeviBwwiFp5MQ![email protected]\",\"handle\":\"wireapp://%[email protected]\"}", | ||
}, | ||
], | ||
"authorizations": [ | ||
|
@@ -1070,7 +1070,7 @@ test("end-to-end-identity", async () => { | |
"identifiers": [ | ||
{ | ||
"type": "wireapp-id", | ||
"value": "{\"name\":\"Alice Smith\",\"domain\":\"wire.com\",\"client-id\":\"im:wireapp=t6wRpI8BRSeviBwwiFp5MQ/[email protected]\",\"handle\":\"im:wireapp=alice_wire\"}", | ||
"value": "{\"name\":\"Alice Smith\",\"domain\":\"wire.com\",\"client-id\":\"wireapp://t6wRpI8BRSeviBwwiFp5MQ![email protected]\",\"handle\":\"wireapp://%[email protected]\"}", | ||
}, | ||
], | ||
"authorizations": [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,7 +67,7 @@ internal class E2EITest { | |
"identifiers": [ | ||
{ | ||
"type": "wireapp-id", | ||
"value": "{\"name\":\"Alice Smith\",\"domain\":\"wire.com\",\"client-id\":\"im:wireapp=t6wRpI8BRSeviBwwiFp5MQ/[email protected]\",\"handle\":\"im:wireapp=alice_wire\"}" | ||
"value": "{\"name\":\"Alice Smith\",\"domain\":\"wire.com\",\"client-id\":\"wireapp://t6wRpI8BRSeviBwwiFp5MQ![email protected]\",\"handle\":\"wireapp://%[email protected]\"}" | ||
} | ||
], | ||
"authorizations": [ | ||
|
@@ -85,7 +85,7 @@ internal class E2EITest { | |
"expires": "2016-01-02T14:09:30Z", | ||
"identifier": { | ||
"type": "wireapp-id", | ||
"value": "{\"name\":\"Alice Smith\",\"domain\":\"wire.com\",\"client-id\":\"im:wireapp=t6wRpI8BRSeviBwwiFp5MQ/[email protected]\",\"handle\":\"im:wireapp=alice_wire\"}" | ||
"value": "{\"name\":\"Alice Smith\",\"domain\":\"wire.com\",\"client-id\":\"wireapp://t6wRpI8BRSeviBwwiFp5MQ![email protected]\",\"handle\":\"wireapp://%[email protected]\"}" | ||
}, | ||
"challenges": [ | ||
{ | ||
|
@@ -126,7 +126,7 @@ internal class E2EITest { | |
"identifiers": [ | ||
{ | ||
"type": "wireapp-id", | ||
"value": "{\"name\":\"Alice Smith\",\"domain\":\"wire.com\",\"client-id\":\"im:wireapp=t6wRpI8BRSeviBwwiFp5MQ/[email protected]\",\"handle\":\"im:wireapp=alice_wire\"}" | ||
"value": "{\"name\":\"Alice Smith\",\"domain\":\"wire.com\",\"client-id\":\"wireapp://t6wRpI8BRSeviBwwiFp5MQ![email protected]\",\"handle\":\"wireapp://%[email protected]\"}" | ||
} | ||
], | ||
"authorizations": [ | ||
|
@@ -146,7 +146,7 @@ internal class E2EITest { | |
"identifiers": [ | ||
{ | ||
"type": "wireapp-id", | ||
"value": "{\"name\":\"Alice Smith\",\"domain\":\"wire.com\",\"client-id\":\"im:wireapp=t6wRpI8BRSeviBwwiFp5MQ/[email protected]\",\"handle\":\"im:wireapp=alice_wire\"}" | ||
"value": "{\"name\":\"Alice Smith\",\"domain\":\"wire.com\",\"client-id\":\"wireapp://t6wRpI8BRSeviBwwiFp5MQ![email protected]\",\"handle\":\"wireapp://%[email protected]\"}" | ||
} | ||
], | ||
"authorizations": [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -532,7 +532,7 @@ pub mod tests { | |
pub const E2EI_DISPLAY_NAME: &str = "Alice Smith"; | ||
pub const E2EI_HANDLE: &str = "alice_wire"; | ||
pub const E2EI_CLIENT_ID: &str = "bd4c7053-1c5a-4020-9559-cd7bf7961954:[email protected]"; | ||
pub const E2EI_CLIENT_ID_URI: &str = "vUxwUxxaQCCVWc1795YZVA/[email protected]"; | ||
pub const E2EI_CLIENT_ID_URI: &str = "vUxwUxxaQCCVWc1795YZVA![email protected]"; | ||
pub const E2EI_EXPIRY: u32 = 90; | ||
|
||
#[apply(all_cred_cipher)] | ||
|
@@ -653,9 +653,9 @@ pub mod tests { | |
let _order_req = enrollment.new_order_request(previous_nonce.to_string()).unwrap(); | ||
|
||
let client_id = client_id | ||
.map(|c| format!("{}{c}", wire_e2e_identity::prelude::E2eiClientId::URI_PREFIX)) | ||
.map(|c| format!("{}{c}", wire_e2e_identity::prelude::E2eiClientId::URI_SCHEME)) | ||
.unwrap_or_else(|| cc.get_e2ei_client_id().to_uri()); | ||
let identifier_value = format!("{{\"name\":\"{display_name}\",\"domain\":\"wire.com\",\"client-id\":\"{client_id}\",\"handle\":\"im:wireapp=%40{handle}@wire.com\"}}"); | ||
let identifier_value = format!("{{\"name\":\"{display_name}\",\"domain\":\"wire.com\",\"client-id\":\"{client_id}\",\"handle\":\"wireapp://%40{handle}@wire.com\"}}"); | ||
let order_resp = json!({ | ||
"status": "pending", | ||
"expires": "2037-01-05T14:09:07.99Z", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ use crate::{CryptoError, CryptoResult}; | |
/// End-to-end Identity re-shuffled that... But we still want to keep this isolated from the rest | ||
/// of the crate that's why this should remain here and be used cautiously, having the context quoted | ||
/// above in mind. | ||
/// For example in `im:wireapp=LcksJb74Tm6N12cDjFy7lQ/[email protected]` the [UserId] is `LcksJb74Tm6N12cDjFy7lQ` | ||
/// For example in `wireapp://LcksJb74Tm6N12cDjFy7lQ![email protected]` the [UserId] is `LcksJb74Tm6N12cDjFy7lQ` | ||
#[derive(Debug, Clone, Copy, Eq, PartialEq, derive_more::Deref)] | ||
pub struct UserId<'a>(&'a [u8]); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters