Skip to main content

upload_github_ssh_signing_key

Function upload_github_ssh_signing_key 

Source
pub async fn upload_github_ssh_signing_key<U: SshSigningKeyUploader + ?Sized>(
    uploader: &U,
    access_token: &str,
    public_key: &str,
    key_alias: &str,
    hostname: &str,
    identity_storage: &(dyn IdentityStorage + Send + Sync),
    now: DateTime<Utc>,
) -> Result<(), PlatformError>
Expand description

Upload the SSH signing key for the identity to GitHub.

Stores metadata about the uploaded key (key ID, GitHub username, timestamp) in the identity metadata for future reference and idempotency.

Args:

  • uploader: HTTP implementation of SSH key uploader.
  • access_token: GitHub OAuth access token with write:ssh_signing_key scope.
  • public_key: SSH public key in OpenSSH format (ssh-ed25519 AAAA…).
  • key_alias: Keychain alias for the device key.
  • hostname: Machine hostname for the key title.
  • identity_storage: Storage backend for persisting metadata.
  • now: Current time (injected by caller; SDK does not call Utc::now()).

Returns: Ok(()) on success, PlatformError on failure (non-fatal; init continues).

Usage:

upload_github_ssh_signing_key(
    &uploader,
    "ghu_token...",
    "ssh-ed25519 AAAA...",
    "main",
    "MacBook-Pro.local",
    &identity_storage,
    Utc::now(),
).await?;