pub struct GitHubBinding {
pub user_pubkey: UserPublic,
pub ssh_pubkey: [u8; 32],
pub github_username: Option<String>,
pub signature: Signature,
}Expand description
Cross-signature: “this agent-mesh UserKey belongs to the
holder of this SSH key”.
Fields§
§user_pubkey: UserPublicThe agent-mesh user public key being bound.
ssh_pubkey: [u8; 32]The GitHub SSH ed25519 public key (raw 32 bytes).
github_username: Option<String>Optional GitHub username hint — used by amesh verify to
pick the right .keys URL. NOT load-bearing for the actual
signature check.
signature: SignatureSignature over BINDING_TAG || user_pubkey_bytes, produced
by the SSH private key.
Implementations§
Source§impl GitHubBinding
impl GitHubBinding
Sourcepub fn sign(
user: &UserPublic,
ssh_key: &SshPrivateKey,
github_username: Option<String>,
) -> Result<Self>
pub fn sign( user: &UserPublic, ssh_key: &SshPrivateKey, github_username: Option<String>, ) -> Result<Self>
Create a binding by signing the user pubkey with an SSH ed25519 private key.
Returns MeshError::InvalidKey if the SSH key isn’t
ed25519 (RSA / ECDSA are explicitly out of scope).
Sourcepub fn verify(&self, candidate_ssh_pubkey: &[u8; 32]) -> Result<()>
pub fn verify(&self, candidate_ssh_pubkey: &[u8; 32]) -> Result<()>
Verify the binding against a candidate SSH ed25519 public key.
The candidate must come from a trusted source (e.g.
https://github.com/<u>.keys). The binding’s embedded
ssh_pubkey is treated as untrusted self-description; if it
doesn’t match the candidate we reject before doing any crypto
work.
Trait Implementations§
Source§impl Clone for GitHubBinding
impl Clone for GitHubBinding
Source§fn clone(&self) -> GitHubBinding
fn clone(&self) -> GitHubBinding
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GitHubBinding
impl Debug for GitHubBinding
Source§impl<'de> Deserialize<'de> for GitHubBinding
impl<'de> Deserialize<'de> for GitHubBinding
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for GitHubBinding
Source§impl PartialEq for GitHubBinding
impl PartialEq for GitHubBinding
Source§fn eq(&self, other: &GitHubBinding) -> bool
fn eq(&self, other: &GitHubBinding) -> bool
self and other values to be equal, and is used by ==.