-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
subscription: implement ClientFilterType and ClientFilterFlags
- Loading branch information
Showing
12 changed files
with
276 additions
and
67 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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 |
---|---|---|
|
@@ -178,6 +178,10 @@ impl From<ClientFilterOperation> for crate::subscription::ClientFilterOperation | |
#[serde(deny_unknown_fields)] | ||
struct ClientFilter { | ||
pub operation: ClientFilterOperation, | ||
#[serde(rename = "type", default)] | ||
pub kind: crate::subscription::ClientFilterType, | ||
#[serde(default)] | ||
pub flags: crate::subscription::ClientFilterFlags, | ||
#[serde(alias = "cert_subjects", alias = "princs")] | ||
pub targets: HashSet<String>, | ||
} | ||
|
@@ -186,7 +190,7 @@ impl TryFrom<ClientFilter> for crate::subscription::ClientFilter { | |
type Error = anyhow::Error; | ||
|
||
fn try_from(value: ClientFilter) -> std::prelude::v1::Result<Self, Self::Error> { | ||
Ok(crate::subscription::ClientFilter::new(value.operation.into(), value.targets)) | ||
crate::subscription::ClientFilter::try_new(value.operation.into(), value.kind, value.flags, value.targets) | ||
} | ||
} | ||
|
||
|
@@ -506,7 +510,9 @@ path = "/whatever/you/{ip}/want/{principal}/{ip:2}/{node}/end" | |
let mut targets = HashSet::new(); | ||
targets.insert("[email protected]".to_string()); | ||
targets.insert("[email protected]".to_string()); | ||
let filter = crate::subscription::ClientFilter::new(crate::subscription::ClientFilterOperation::Only, targets); | ||
let kind = crate::subscription::ClientFilterType::KerberosPrinc; | ||
let flags = crate::subscription::ClientFilterFlags::empty(); | ||
let filter = crate::subscription::ClientFilter::try_new(crate::subscription::ClientFilterOperation::Only, kind, flags, targets)?; | ||
|
||
expected.set_client_filter(Some(filter)); | ||
|
||
|
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
Oops, something went wrong.