pub struct SecureRelay {
pub relay: Relay,
pub identity: GitIdentity,
pub ssh_key: Option<PathBuf>,
pub allowed_signers: Option<PathBuf>,
}Expand description
A relay with Git identity + SSH signing.
Messages are signed on send and can be verified on read.
Identity comes from git config.
Fields§
§relay: Relay§identity: GitIdentity§ssh_key: Option<PathBuf>§allowed_signers: Option<PathBuf>Implementations§
Source§impl SecureRelay
impl SecureRelay
Sourcepub fn from_git_repo(relay_dir: PathBuf) -> Result<Self, String>
pub fn from_git_repo(relay_dir: PathBuf) -> Result<Self, String>
Create from the current git repo. Auto-detects identity and SSH key.
Sourcepub fn send_signed(
&self,
session_id: &str,
to_session: Option<&str>,
content: &str,
) -> Result<SignedMessage, String>
pub fn send_signed( &self, session_id: &str, to_session: Option<&str>, content: &str, ) -> Result<SignedMessage, String>
Send a signed message. The content is signed with the user’s SSH key.
Sourcepub fn inbox_verified(
&self,
session_id: &str,
limit: usize,
) -> Vec<SignedMessage>
pub fn inbox_verified( &self, session_id: &str, limit: usize, ) -> Vec<SignedMessage>
Read inbox with signature verification.
Sourcepub fn verify_collaborator(&self, username: &str) -> Result<bool, String>
pub fn verify_collaborator(&self, username: &str) -> Result<bool, String>
Check if a user is a collaborator on the current GitHub repo.
Sourcepub fn init_allowed_signers(&self) -> Result<usize, String>
pub fn init_allowed_signers(&self) -> Result<usize, String>
Initialize the allowed_signers file from GitHub collaborators’ SSH keys.
Auto Trait Implementations§
impl Freeze for SecureRelay
impl RefUnwindSafe for SecureRelay
impl Send for SecureRelay
impl Sync for SecureRelay
impl Unpin for SecureRelay
impl UnsafeUnpin for SecureRelay
impl UnwindSafe for SecureRelay
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more