New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kitsune host logic #1267
Kitsune host logic #1267
Conversation
a286538
to
45826da
Compare
…ixup-owners release-automation: extract ensure-crate-owners as subcommand and add github action test
45826da
to
7cfa4c1
Compare
7cfa4c1
to
6ef1d2f
Compare
|
||
/// The interface to be implemented by the host, which handles various requests | ||
/// for data | ||
pub trait KitsuneHost { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I vote for putting some additional explicit bounds on this trait, it tends to move any compile errors inwards closer to where the actual coding issue is.
pub trait KitsuneHost { | |
pub trait KitsuneHost: 'static + Send + Sync { |
/// A supertrait of KitsuneHost convenient for defining test handlers. | ||
/// Allows only specifying the methods you care about, and letting all the rest | ||
/// panic if called | ||
pub trait KitsuneHostPanicky: KitsuneHost { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 I like this idea
use std::collections::{HashMap, HashSet}; | ||
|
||
use anyhow::bail; | ||
use anyhow::{bail, Context}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are the changes in this file / crate a weird merge conflict?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Must be because this PR isn't based on develop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, I think this'll be easier to work with 👍
Summary
Add a trait-based way for kitsune to make requests of its host, rather than ghost_actor.
Converts both KGenReq sub-methods, as well as get_agent_info_signed (chosen somewhat at random) to this new method, to prove that it works. The rest of the methods can be converted at another time.
TODO:
CHANGELOG(s) updated with appropriate info