// Sources/Core/Auth/SidecarCredential.swift
// T-2.2: Pairing flow — credential model

import Foundation

/// Persisted after a successful pairing exchange.
/// Stored in Keychain under `Keychain.credentialKey`.
struct SidecarCredential: Codable, Sendable {
    let sidecarId: String
    let host: String
    let port: Int
    let bearerToken: String
    /// SHA-256 hex fingerprint of the sidecar's self-signed TLS cert (from QR).
    /// Used by `PinnedTrust` (wired in T-2.5) to validate the TLS handshake.
    let tlsFingerprint: String
    let sidecarName: String
    let pairedAt: Date
}
