diff --git a/CHANGELOG.md b/CHANGELOG.md index d63c31a..687380a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Correct `pesde.toml` inclusion message in `publish` command by @daimond113 - Allow writes to files when `link` is false in PackageFS::write_to by @daimond113 - Handle missing revisions in AnyPackageIdentifier::from_str by @daimond113 +- Make GitHub OAuth client ID config optional by @daimond113 ## [0.5.0-rc.5] - 2024-10-12 ### Added diff --git a/src/cli/commands/auth/login.rs b/src/cli/commands/auth/login.rs index b451777..c430e1d 100644 --- a/src/cli/commands/auth/login.rs +++ b/src/cli/commands/auth/login.rs @@ -95,7 +95,9 @@ impl LoginCommand { let config = source .config(project) .context("failed to read index config")?; - let client_id = config.github_oauth_client_id; + let Some(client_id) = config.github_oauth_client_id else { + anyhow::bail!("index not configured for Github oauth."); + }; let response = reqwest .post(Url::parse_with_params( diff --git a/src/source/pesde/mod.rs b/src/source/pesde/mod.rs index 3dac8e0..c281dbb 100644 --- a/src/source/pesde/mod.rs +++ b/src/source/pesde/mod.rs @@ -364,7 +364,8 @@ pub struct IndexConfig { #[serde(default)] pub wally_allowed: bool, /// The OAuth client ID for GitHub - pub github_oauth_client_id: String, + #[serde(default)] + pub github_oauth_client_id: Option, /// The maximum size of an archive in bytes #[serde(default = "default_archive_size")] pub max_archive_size: usize,