[package]
name = "car-auth"
version.workspace = true
edition.workspace = true
license.workspace = true
description = "Shared Parslee OAuth2 PKCE + token/keychain logic for the CAR CLI and daemon"
repository.workspace = true

# Reusable, headless auth core. Deliberately no browser-open or
# loopback-listener here — those are surface-specific (the CLI runs a
# localhost listener; the daemon hands the authorize URL to a GUI).
# This crate owns: PKCE, the authorize URL, code->token exchange, and
# keychain persistence, so the CLI and `car-server` (auth.* JSON-RPC,
# driven by CAR Host.app) share exactly one implementation.

[dependencies]
car-secrets = { path = "../car-secrets", version = "0.34.0" }
reqwest = { version = "0.12", default-features = false, features = ["rustls-tls"] }
serde = { workspace = true }
serde_json = { workspace = true }
sha2 = { workspace = true }
uuid = { workspace = true }
base64 = "0.22"

[dev-dependencies]
# Drives the async auth fns against an in-test loopback mock server
# (see the `tests` module). Workspace tokio is `features=["full"]`,
# which carries `macros` + `rt` for `#[tokio::test]`.
tokio = { workspace = true }

[lints]
workspace = true
