Skip to content
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

Merged
merged 16 commits into from Mar 3, 2022
Merged

Kitsune host logic #1267

merged 16 commits into from Mar 3, 2022

Conversation

maackle
Copy link
Member

@maackle maackle commented Mar 1, 2022

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:

  • Replace HostStub with actual handler suitable for testing
  • Move more methods over from the ghost_actor
  • CHANGELOG(s) updated with appropriate info
  • Just before pressing the merge button, ensure new entries to CHANGELOG(s) are still under the UNRELEASED heading

@maackle maackle changed the base branch from develop to conductor-refactor March 1, 2022 02:49
@maackle maackle changed the base branch from conductor-refactor to conductor-refactor-2 March 2, 2022 22:58
@maackle maackle marked this pull request as ready for review March 2, 2022 22:59
@maackle maackle requested review from neonphog and freesig March 2, 2022 22:59

/// The interface to be implemented by the host, which handles various requests
/// for data
pub trait KitsuneHost {
Copy link
Contributor

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.

Suggested change
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 {
Copy link
Contributor

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};
Copy link
Contributor

@neonphog neonphog Mar 3, 2022

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?

Copy link
Member Author

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

Copy link
Contributor

@neonphog neonphog left a 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 👍

@maackle maackle merged commit e55b8f6 into conductor-refactor-2 Mar 3, 2022
@maackle maackle deleted the kitsune-host-logic branch March 3, 2022 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants