diff --git a/Cargo.lock b/Cargo.lock index f76c9c406f..47b369a1e6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2420,9 +2420,9 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.2.2" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +checksum = "afa489199eaffb1211795df1c6236ce1ad0d41a6fa45250add73e3b02420f06e" dependencies = [ "percent-encoding", ] @@ -4871,6 +4871,7 @@ dependencies = [ "async-trait", "aws-config", "aws-sdk-sts", + "axum", "chrono", "futures", "hyper-util", @@ -9663,9 +9664,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.8" +version = "2.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +checksum = "f00cd2407bb42c0ef17be88d4cf020f5cceffd121665bac9b8b9493a369b3b1a" dependencies = [ "form_urlencoded", "idna", diff --git a/Cargo.toml b/Cargo.toml index 4b958a1d6a..acae9335c7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -146,7 +146,7 @@ hickory-proto = "0.26.1" pin-project-lite = "0.2" tokio-stream = "0.1" protoc-bin-vendored = "3.2.0" -url = "2" +url = "2.5.9" indexmap = "2" shell-words = "1.1.1" diff --git a/crates/openshell-cli/src/oidc_auth.rs b/crates/openshell-cli/src/oidc_auth.rs index 33edc36169..f05c03d42f 100644 --- a/crates/openshell-cli/src/oidc_auth.rs +++ b/crates/openshell-cli/src/oidc_auth.rs @@ -20,6 +20,7 @@ use oauth2::{ RedirectUrl, Scope, TokenResponse, TokenUrl, }; use openshell_bootstrap::oidc_token::OidcTokenBundle; +use openshell_core::token_endpoint::parse_auth_url; use openshell_sdk::oidc::RefreshTokenInput; use serde::Deserialize; use std::convert::Infallible; @@ -65,6 +66,10 @@ struct DeviceTokenErrorResponse { error_description: String, } +fn parse_oidc_url(raw: &str, field: &str) -> Result { + parse_auth_url(raw).map_err(|reason| miette::miette!("OIDC {field} {reason}")) +} + /// Discover OIDC endpoints from the issuer's well-known configuration. /// /// Validates that the discovery document's `issuer` field matches the @@ -74,7 +79,7 @@ async fn discover(issuer: &str, insecure: bool) -> Result { let url = format!("{normalized_issuer}/.well-known/openid-configuration"); let client = http_client(insecure); let resp: OidcDiscovery = client - .get(&url) + .get(parse_oidc_url(&url, "issuer URL")?) .send() .await .into_diagnostic()? @@ -90,6 +95,7 @@ async fn discover(issuer: &str, insecure: bool) -> Result { discovered_issuer )); } + parse_oidc_url(&resp.token_endpoint, "token endpoint")?; Ok(resp) } @@ -204,7 +210,10 @@ pub async fn oidc_browser_auth_flow( let redirect_uri = callback_redirect_uri(&listener)?; let client = BasicClient::new(ClientId::new(client_id.to_string())) - .set_auth_uri(AuthUrl::new(discovery.authorization_endpoint).into_diagnostic()?) + .set_auth_uri(AuthUrl::from_url(parse_oidc_url( + &discovery.authorization_endpoint, + "authorization endpoint", + )?)) .set_token_uri(TokenUrl::new(discovery.token_endpoint).into_diagnostic()?) .set_redirect_uri(RedirectUrl::new(redirect_uri).into_diagnostic()?); @@ -341,6 +350,9 @@ pub async fn oidc_device_code_flow( ) })?; + let device_auth_endpoint = + parse_oidc_url(device_auth_endpoint, "device authorization endpoint")?; + // Step 1: Request device and user codes let http = http_client(insecure); let scopes_param = build_scopes(scopes) @@ -897,6 +909,45 @@ mod tests { assert!(result.is_err(), "connection to closed port should fail"); } + #[tokio::test] + async fn device_flow_refuses_ambiguous_endpoints_before_requesting_codes() { + let server = MockServer::start().await; + let issuer = server.uri(); + let invalid = format!("{issuer}/private^endpoint"); + for (token, device, field) in [ + (invalid.as_str(), issuer.as_str(), "token endpoint"), + ( + issuer.as_str(), + invalid.as_str(), + "device authorization endpoint", + ), + ] { + server.reset().await; + Mock::given(method("GET")) + .and(path("/.well-known/openid-configuration")) + .respond_with(ResponseTemplate::new(200).set_body_json(serde_json::json!({ + "issuer": issuer, + "authorization_endpoint": issuer, + "token_endpoint": token, + "device_authorization_endpoint": device, + }))) + .expect(1) + .mount(&server) + .await; + + let error = oidc_device_code_flow(&issuer, "cli", None, None, false) + .await + .unwrap_err() + .to_string(); + assert!( + error.contains(field) && error.contains("literal caret"), + "{error}" + ); + assert!(!error.contains("private^endpoint"), "{error}"); + assert_eq!(server.received_requests().await.unwrap().len(), 1); + } + } + #[test] fn discover_validates_issuer_mismatch() { let rt = tokio::runtime::Runtime::new().unwrap(); diff --git a/crates/openshell-core/src/oauth.rs b/crates/openshell-core/src/oauth.rs index 8e31239d97..7a9c2618f8 100644 --- a/crates/openshell-core/src/oauth.rs +++ b/crates/openshell-core/src/oauth.rs @@ -298,7 +298,7 @@ pub fn parse_token_endpoint_url(token_endpoint: &str) -> Result Result { + let parse = |s: &str| url::Url::parse(s).map_err(|_| "must be an absolute URL"); + let url = parse(raw)?; + // Ask the URL parser which carets survive in the path. A caret in the query + // or password, or in a removed dot segment, does not change the destination path. + if raw.contains('^') && parse(&raw.replace('^', "_"))?.path() != url.path() { + return Err( + "contains a literal caret (^) in its path. Confirm the intended destination and reconfigure the URL", + ); + } + Ok(url) +} + /// Normalize a token endpoint for exact comparison. /// /// Accepts absolute `https` URLs, or `http` URLs for loopback hosts (local @@ -17,7 +37,7 @@ /// /// Returns a short description of why the URL is not an acceptable endpoint. pub fn normalize_token_endpoint(raw: &str) -> Result { - parse_token_endpoint(raw).map(Into::into) + parse_token_endpoint(raw.trim()).map(Into::into) } /// Resolve a GitHub App profile's token endpoint while preserving GHES path prefixes. @@ -26,6 +46,22 @@ pub fn normalize_token_endpoint(raw: &str) -> Result { /// /// Rejects invalid installation path templates and disallowed token endpoints. pub fn github_app_installation_url(template: &str, id: u64) -> Result { + parse_token_endpoint(expand_github_app_template(template, id)?.trim()) +} + +/// Check a GitHub App profile template's structure while loading the catalog. +/// Existing profiles with literal carets must stay readable so owners can repair them. +/// +/// # Errors +/// +/// Rejects invalid installation templates, transports, and authorities. +pub fn validate_github_app_template(template: &str) -> Result<(), &'static str> { + let endpoint = expand_github_app_template(template, 1)?; + let url = url::Url::parse(endpoint.trim()).map_err(|_| "must be an absolute URL")?; + validate_token_endpoint(&url) +} + +fn expand_github_app_template(template: &str, id: u64) -> Result { const PLACEHOLDER: &str = "{installation_id}"; if !template.ends_with("/app/installations/{installation_id}/access_tokens") || template.matches(PLACEHOLDER).count() != 1 @@ -34,11 +70,21 @@ pub fn github_app_installation_url(template: &str, id: u64) -> Result Result { - let url = url::Url::parse(raw.trim()).map_err(|_| "must be an absolute URL")?; +/// Parse the request destination when binding a workspace secret to a provider. +/// +/// # Errors +/// +/// Rejects endpoints with ambiguous paths or components disallowed for workspace secrets. +pub fn parse_token_endpoint(raw: &str) -> Result { + let url = parse_auth_url(raw)?; + validate_token_endpoint(&url)?; + Ok(url) +} + +fn validate_token_endpoint(url: &url::Url) -> Result<(), &'static str> { let Some(host) = url.host_str().filter(|host| !host.is_empty()) else { return Err("must include a host"); }; @@ -53,7 +99,7 @@ fn parse_token_endpoint(raw: &str) -> Result { if url.query().is_some() || url.fragment().is_some() { return Err("must not include a query or fragment"); } - Ok(url) + Ok(()) } /// Whether a token endpoint's URL host may use plain HTTP. @@ -78,6 +124,31 @@ mod tests { ); } + #[test] + fn checks_the_effective_path_before_losing_the_caret_spelling() { + for raw in [ + "https://example.com/a^b", + "https://example.com/a^%5E", + r"https:\example.com\a^b", + ] { + assert!( + super::parse_auth_url(raw) + .unwrap_err() + .contains("literal caret") + ); + } + for raw in [ + "https://example.com/%5E/%5e/%255E", + "https://example.com/a^b/../token", + "https://user:p^w@example.com/%5E?x=^#^", + ] { + assert_eq!( + super::parse_auth_url(raw), + Ok(url::Url::parse(raw).unwrap()) + ); + } + } + #[test] fn allows_http_only_for_loopback() { assert!(normalize_token_endpoint("http://127.0.0.1:9000/token").is_ok()); diff --git a/crates/openshell-credential-issuer/Cargo.toml b/crates/openshell-credential-issuer/Cargo.toml index 381f40d524..51b0b8cb3e 100644 --- a/crates/openshell-credential-issuer/Cargo.toml +++ b/crates/openshell-credential-issuer/Cargo.toml @@ -41,6 +41,7 @@ url = { workspace = true } test-support = [] [dev-dependencies] +axum = { workspace = true } rcgen = { workspace = true } tokio-rustls = { workspace = true } tempfile = "3" diff --git a/crates/openshell-credential-issuer/src/refresh/github_app.rs b/crates/openshell-credential-issuer/src/refresh/github_app.rs index 6050fea238..c790c24004 100644 --- a/crates/openshell-credential-issuer/src/refresh/github_app.rs +++ b/crates/openshell-credential-issuer/src/refresh/github_app.rs @@ -470,6 +470,21 @@ mod tests { server.uri() )]]; assert!(mint(&request).await.is_err()); + let base = server.uri(); + for (prefix, grant) in [("/a^b", "/a^b"), ("/a^b", "/a%5Eb"), ("/a%5Eb", "/a^b")] { + let mut request = state(&format!("{base}{prefix}")); + request.secret_endpoint_allowlists = vec![vec![format!( + "{base}{grant}/app/installations/123/access_tokens" + )]]; + let failure = mint(&request).await.err().unwrap(); + assert_eq!(failure.recovery_action, Recovery::FixConfiguration); + if prefix.contains('^') { + assert!( + failure.status.message().contains("literal") + && failure.status.message().contains("caret") + ); + } + } assert!(server.received_requests().await.unwrap().is_empty()); } @@ -519,6 +534,44 @@ mod tests { assert!(!String::from_utf8_lossy(&requests[0].body).contains("PRIVATE KEY")); } + #[tokio::test] + async fn github_app_posts_to_the_exact_encoded_installation_path() { + use axum::http::Uri; + use axum::routing::post; + use axum::{Json, Router}; + + let app = Router::new().fallback_service(post(|uri: Uri, headers: HeaderMap| async move { + assert!( + headers["authorization"] + .to_str() + .unwrap() + .starts_with("Bearer ") + ); + ( + StatusCode::CREATED, + Json(serde_json::json!({ + "token": uri.path(), "expires_at": "2099-01-01T00:00:00Z" + })), + ) + })); + let listener = tokio::net::TcpListener::bind("127.0.0.1:0").await.unwrap(); + let base = format!("http://{}", listener.local_addr().unwrap()); + let exercise = async { + for prefix in ["/a%5Eb", "/a%5eb", "/a%255Eb"] { + let mut input = state(&format!("{base}{prefix}/api/v3")); + let path = format!("{prefix}/api/v3/app/installations/123/access_tokens"); + input.secret_endpoint_allowlists = vec![vec![format!("{base}{path}")]]; + assert_eq!(mint(&input).await.unwrap().access_token, path); + } + }; + tokio::select! { + result = axum::serve(listener, app) => panic!("loopback server stopped: {result:?}"), + result = tokio::time::timeout(Duration::from_secs(10), exercise) => { + result.expect("GitHub App token exchanges timed out"); + } + } + } + #[tokio::test] async fn github_app_mints_using_enterprise_default_api_version() { let server = MockServer::start().await; diff --git a/crates/openshell-credential-issuer/src/refresh/minter.rs b/crates/openshell-credential-issuer/src/refresh/minter.rs index 2cfd9949f1..1a56e0cd8e 100644 --- a/crates/openshell-credential-issuer/src/refresh/minter.rs +++ b/crates/openshell-credential-issuer/src/refresh/minter.rs @@ -604,8 +604,8 @@ async fn request_token( grant_kind: OAuthGrantKind, endpoint_allowlists: &[Vec], ) -> Result { - let parsed = reqwest::Url::parse(token_url) - .map_err(|_| Status::invalid_argument("token_url must be an absolute URL"))?; + let parsed = crate::endpoint::parse_auth_url(token_url) + .map_err(|reason| Status::invalid_argument(format!("token_url {reason}")))?; match parsed.scheme() { "https" => {} "http" if parsed.host_str().is_some_and(is_loopback_host) => {} @@ -622,7 +622,7 @@ async fn request_token( // the body to the new location. let secret_bound = !endpoint_allowlists.is_empty(); if secret_bound { - ensure_endpoint_allowed(token_url, endpoint_allowlists)?; + ensure_endpoint_allowed(parsed.as_str(), endpoint_allowlists)?; } openshell_crypto::tls::ensure_default_provider(); let mut client = reqwest::Client::builder().timeout(Duration::from_secs(30)); @@ -1993,7 +1993,7 @@ KfNSI8uuA8PLqmUY30I9KFWzN6VDLu00eKa90F4w3CeWRRQWXW1+007tTz3V1mNw pM2zFU8SeVkvHKlEuoHaP0s= -----END PRIVATE KEY-----"; - fn secret_bound_refresh_request(token_url: String, allowed: &str) -> MintRequest { + fn secret_bound_refresh_request(token_url: String, stored_endpoint: &str) -> MintRequest { MintRequest { strategy: ProviderCredentialRefreshStrategy::Oauth2RefreshToken as i32, material: HashMap::from([ @@ -2002,30 +2002,55 @@ pM2zFU8SeVkvHKlEuoHaP0s= ("refresh_token".into(), "refresh-token".into()), ]), token_url, - secret_endpoint_allowlists: vec![vec![ - crate::endpoint::normalize_token_endpoint(allowed).unwrap(), - ]], + secret_endpoint_allowlists: vec![vec![stored_endpoint.to_owned()]], ..Default::default() } } #[test] - fn persisted_endpoint_allowlists_distinguish_literal_and_encoded_carets() { + fn an_encoded_path_requires_an_explicitly_encoded_grant() { let literal = "https://login.example/a^b"; let encoded = "https://login.example/a%5Eb"; - for (allowed, denied) in [(literal, encoded), (encoded, literal)] { - let stored = [vec![allowed.to_string()]]; - assert!( - ensure_endpoint_allowed(allowed, &stored).is_ok(), - "{allowed}" - ); - assert!( - ensure_endpoint_allowed(denied, &stored).is_err(), - "{denied}" + for endpoint in [literal, encoded] { + let stored = [vec![endpoint.to_owned()]]; + assert!(ensure_endpoint_allowed(literal, &stored).is_err()); + assert_eq!( + ensure_endpoint_allowed(encoded, &stored).is_ok(), + endpoint == encoded ); } } + #[tokio::test] + async fn secret_bound_mint_sends_the_exact_persisted_path() { + use axum::http::Uri; + use axum::routing::post; + use axum::{Form, Json, Router}; + + // The handler returns the HTTP target before any URL parsing can change its spelling. + let app = Router::new().fallback_service(post( + |uri: Uri, Form(form): Form>| async move { + assert_eq!(form["client_secret"], "shared-client-secret"); + Json(serde_json::json!({"access_token": uri.path(), "expires_in": 3600})) + }, + )); + let listener = tokio::net::TcpListener::bind("127.0.0.1:0").await.unwrap(); + let address = listener.local_addr().unwrap(); + let exercise = async { + for path in ["/a%5Eb", "/a%5eb", "/a%255Eb", "/mixed%5E%5e%255E"] { + let endpoint = format!("http://{address}{path}"); + let request = secret_bound_refresh_request(endpoint.clone(), &endpoint); + assert_eq!(mint_credential(&request).await.unwrap().access_token, path); + } + }; + tokio::select! { + result = axum::serve(listener, app) => panic!("loopback server stopped: {result:?}"), + result = tokio::time::timeout(Duration::from_secs(10), exercise) => { + result.expect("loopback token exchanges timed out"); + } + } + } + #[tokio::test] async fn secret_bound_mint_reaches_an_allowed_endpoint() { let mock_server = MockServer::start().await; @@ -2048,21 +2073,51 @@ pM2zFU8SeVkvHKlEuoHaP0s= #[tokio::test] async fn secret_bound_mint_never_contacts_a_disallowed_endpoint() { let mock_server = MockServer::start().await; - Mock::given(method("POST")) + Mock::given(wiremock::matchers::any()) .respond_with(ResponseTemplate::new(200)) .expect(0) .mount(&mock_server) .await; - let request = secret_bound_refresh_request( - format!("{}/token", mock_server.uri()), - "https://login.example.com/token", - ); - let failure = mint_credential(&request).await.err().unwrap(); - assert_eq!(failure.failure_code, "secret_endpoint_not_allowed"); - assert_eq!( - failure.recovery_action, - ProviderCredentialRefreshRecoveryAction::FixConfiguration - ); + let base = mock_server.uri(); + let literal = format!("{base}/a^b"); + let encoded = format!("{base}/a%5Eb"); + let mut request = secret_bound_refresh_request(literal.clone(), &literal); + for grants in [ + vec![vec![literal.clone()]], + vec![vec![encoded.clone()]], + Vec::new(), + ] { + request.secret_endpoint_allowlists = grants; + let failure = mint_credential(&request).await.err().unwrap(); + assert_eq!( + failure.recovery_action, + ProviderCredentialRefreshRecoveryAction::FixConfiguration + ); + assert!( + failure.status.message().contains("literal") + && failure.status.message().contains("caret") + ); + } + + for (requested, stored) in [ + ( + format!("{base}/token"), + "https://login.example.com/token".to_owned(), + ), + (encoded.clone(), literal), + (format!("{base}/a%5eb"), encoded), + ] { + let mut request = secret_bound_refresh_request(requested.clone(), &stored); + // Every referenced secret must authorize the exact endpoint. + request + .secret_endpoint_allowlists + .insert(0, vec![requested]); + let failure = mint_credential(&request).await.err().unwrap(); + assert_eq!( + failure.recovery_action, + ProviderCredentialRefreshRecoveryAction::FixConfiguration + ); + } } #[tokio::test] @@ -2168,13 +2223,13 @@ pM2zFU8SeVkvHKlEuoHaP0s= strategy: ProviderCredentialRefreshStrategy::GithubAppInstallation as i32, material: HashMap::from([("installation_id".into(), "123".into())]), token_url: - "https://github.example/a^b/api/v3/app/installations/{installation_id}/access_tokens" + "https://github.example/a%5Eb/api/v3/app/installations/{installation_id}/access_tokens" .into(), ..Default::default() }; assert_eq!( effective_token_endpoint(&github).unwrap(), - "https://github.example/a^b/api/v3/app/installations/123/access_tokens" + "https://github.example/a%5Eb/api/v3/app/installations/123/access_tokens" ); let aws = MintRequest { strategy: ProviderCredentialRefreshStrategy::AwsStsAssumeRole as i32, diff --git a/crates/openshell-providers/src/lib.rs b/crates/openshell-providers/src/lib.rs index 87ac5d8007..91224a5d51 100644 --- a/crates/openshell-providers/src/lib.rs +++ b/crates/openshell-providers/src/lib.rs @@ -22,7 +22,8 @@ pub use profiles::{ CredentialRefreshProfile, ProfileError, ProfileValidationDiagnostic, ProviderTypeProfile, is_gateway_mintable_strategy, normalize_profile_id, parse_profile_json, parse_profile_yaml, profile_to_json, profile_to_yaml, profiles_to_json, profiles_to_yaml, strategy_output_env_key, - strategy_output_spec, strategy_primary_env_key, validate_profile_set, + strategy_output_spec, strategy_primary_env_key, validate_catalog_profiles, + validate_profile_set, }; pub const VERTEX_AI_PROJECT_ID_KEY: &str = "VERTEX_AI_PROJECT_ID"; diff --git a/crates/openshell-providers/src/profiles.rs b/crates/openshell-providers/src/profiles.rs index b5aac1a5ec..84e982c372 100644 --- a/crates/openshell-providers/src/profiles.rs +++ b/crates/openshell-providers/src/profiles.rs @@ -2045,7 +2045,7 @@ pub fn profiles_to_json(profiles: &[ProviderTypeProfile]) -> Result bool { #[must_use] pub fn validate_profile_set( profiles: &[(String, ProviderTypeProfile)], +) -> Vec { + let mut diagnostics = validate_catalog_profiles(profiles); + for (source, profile) in profiles { + for credential in &profile.credentials { + let refresh = credential + .refresh + .as_ref() + .map(|refresh| ("credentials.refresh.token_url", &refresh.token_url)); + let grant = credential.token_grant.as_ref().map(|grant| { + ( + "credentials.token_grant.token_endpoint", + &grant.token_endpoint, + ) + }); + for (field, raw) in [refresh, grant].into_iter().flatten() { + if raw.contains('^') + && let Err(reason) = openshell_core::token_endpoint::parse_auth_url(raw) + { + diagnostics.push(ProfileValidationDiagnostic::error( + source, + &profile.id, + field, + format!("URL {reason}"), + )); + } + } + } + } + diagnostics +} + +/// Validate a loaded catalog without preventing owners from reading and +/// replacing legacy credential endpoint paths. Minting checks the original URL. +#[must_use] +pub fn validate_catalog_profiles( + profiles: &[(String, ProviderTypeProfile)], ) -> Vec { let mut diagnostics = Vec::new(); let mut ids = HashSet::new(); @@ -2444,10 +2480,11 @@ pub fn validate_profile_set( "github_app_installation requires at least one environment alias", )); } - if let Err(reason) = openshell_core::token_endpoint::github_app_installation_url( - &refresh.token_url, - 1, - ) { + if let Err(reason) = + openshell_core::token_endpoint::validate_github_app_template( + &refresh.token_url, + ) + { diagnostics.push(ProfileValidationDiagnostic::error( source, profile_id, diff --git a/crates/openshell-sdk/src/oidc.rs b/crates/openshell-sdk/src/oidc.rs index 0d41d94079..3c8183cbef 100644 --- a/crates/openshell-sdk/src/oidc.rs +++ b/crates/openshell-sdk/src/oidc.rs @@ -9,6 +9,7 @@ use crate::error::{Result, SdkError}; use oauth2::basic::BasicClient; use oauth2::{ClientId, RefreshToken, Scope, TokenResponse, TokenUrl}; +use openshell_core::token_endpoint::parse_auth_url; use serde::Deserialize; /// OIDC discovery document (subset of fields callers consume). @@ -116,7 +117,10 @@ pub async fn discover(issuer: &str, insecure: bool) -> Result { let url = format!("{normalized_issuer}/.well-known/openid-configuration"); let client = http_client(insecure); let resp: OidcDiscovery = client - .get(&url) + .get( + parse_auth_url(&url) + .map_err(|reason| SdkError::auth(format!("OIDC issuer URL {reason}")))?, + ) .send() .await .map_err(|e| SdkError::auth(format!("OIDC discovery request failed: {e}")))? @@ -130,6 +134,8 @@ pub async fn discover(issuer: &str, insecure: bool) -> Result { "OIDC discovery issuer mismatch: expected '{normalized_issuer}', got '{discovered_issuer}'" ))); } + parse_auth_url(&resp.token_endpoint) + .map_err(|reason| SdkError::auth(format!("OIDC token endpoint {reason}")))?; Ok(resp) } @@ -215,6 +221,40 @@ mod tests { assert!(rendered.contains("has_refresh_token")); } + #[tokio::test] + async fn refresh_refuses_ambiguous_issuer_and_token_paths() { + let server = MockServer::start().await; + let issuer = server.uri(); + let ambiguous = format!("{issuer}/private^endpoint"); + let input = RefreshTokenInput::new("refresh-secret", &ambiguous, "cli"); + let error = refresh_token(&input).await.unwrap_err().to_string(); + assert!( + error.contains("issuer URL") && error.contains("literal caret"), + "{error}" + ); + assert!(!error.contains("private^endpoint"), "{error}"); + assert!(server.received_requests().await.unwrap().is_empty()); + + Mock::given(method("GET")) + .and(path("/.well-known/openid-configuration")) + .respond_with(ResponseTemplate::new(200).set_body_json(serde_json::json!({ + "issuer": issuer, + "authorization_endpoint": issuer, + "token_endpoint": ambiguous, + }))) + .expect(1) + .mount(&server) + .await; + let input = RefreshTokenInput::new("refresh-secret", &issuer, "cli"); + let error = refresh_token(&input).await.unwrap_err().to_string(); + assert!( + error.contains("token endpoint") && error.contains("literal caret"), + "{error}" + ); + assert!(!error.contains("private^endpoint"), "{error}"); + assert_eq!(server.received_requests().await.unwrap().len(), 1); + } + #[tokio::test] async fn refresh_sends_configured_scopes() { let server = MockServer::start().await; diff --git a/crates/openshell-server/src/auth/oidc.rs b/crates/openshell-server/src/auth/oidc.rs index 65ae043576..c1b10a6255 100644 --- a/crates/openshell-server/src/auth/oidc.rs +++ b/crates/openshell-server/src/auth/oidc.rs @@ -124,8 +124,8 @@ fn validate_oidc_url( description: &str, dangerously_allow_insecure_http: bool, ) -> Result { - let parsed = url::Url::parse(value) - .map_err(|error| format!("{description} must be an absolute URL: {error}"))?; + let parsed = openshell_core::token_endpoint::parse_auth_url(value) + .map_err(|reason| format!("{description} {reason}"))?; if parsed.host_str().is_none() || !parsed.username().is_empty() || parsed.password().is_some() { return Err(format!( @@ -639,11 +639,14 @@ impl JwksCache { } // Discover JWKS URI from the OIDC discovery endpoint. - let discovery_url = url::Url::parse(&format!( - "{}/.well-known/openid-configuration", - config.issuer.trim_end_matches('/') - )) - .map_err(|error| format!("failed to construct OIDC discovery URL: {error}"))?; + let discovery_url = validate_oidc_url( + &format!( + "{}/.well-known/openid-configuration", + config.issuer.trim_end_matches('/') + ), + "OIDC discovery URL", + config.dangerously_allow_insecure_http, + )?; info!(url = %discovery_url, "Discovering OIDC configuration"); let discovery: OidcDiscovery = fetch_bounded_json( @@ -1137,6 +1140,25 @@ mod tests { ); } + #[tokio::test] + async fn oidc_refuses_ambiguous_discovery_and_signing_key_paths() { + for issuer in [ + "https://issuer.example/a^b", + "https://issuer.example/a^b/.. ", + ] { + let config = transport_test_config(issuer); + let error = JwksCache::new(&config).await.unwrap_err(); + assert!(error.contains("literal caret"), "{error}"); + } + + let issuer = url::Url::parse("https://issuer.example/a%5Eb").unwrap(); + let config = transport_test_config(issuer.as_str()); + assert!(validate_jwks_url("https://issuer.example/keys^old", &issuer, &config).is_err()); + let jwks = + validate_jwks_url("https://issuer.example/keys%5Eold", &issuer, &config).unwrap(); + assert_eq!(jwks.path(), "/keys%5Eold"); + } + #[test] fn oidc_rejects_http_jwks_from_https_discovery() { let issuer = url::Url::parse("https://idp.example.com/issuer").unwrap(); diff --git a/crates/openshell-server/src/grpc/provider.rs b/crates/openshell-server/src/grpc/provider.rs index fb14346234..277174f49c 100644 --- a/crates/openshell-server/src/grpc/provider.rs +++ b/crates/openshell-server/src/grpc/provider.rs @@ -3956,10 +3956,9 @@ async fn bind_material_secrets( token_url: token_url.to_string(), ..Default::default() })?; - let endpoint = openshell_credential_issuer::endpoint::normalize_token_endpoint(&endpoint) - .map_err(|reason| { - Status::failed_precondition(format!("refresh token endpoint {reason}")) - })?; + let endpoint = openshell_credential_issuer::endpoint::parse_token_endpoint(&endpoint) + .map_err(|reason| Status::failed_precondition(format!("refresh token endpoint {reason}")))? + .to_string(); for (material_key, name) in material_secrets { let secret = super::secret::get_live_secret(&state.store, workspace, name) .await? @@ -7544,6 +7543,79 @@ pub(super) mod tests { assert!(response.imported, "{:?}", response.diagnostics); } + #[tokio::test] + async fn legacy_credential_endpoints_remain_visible_and_can_be_repaired() { + let state = test_server_state().await; + let id = "legacy-endpoints"; + let profile = |prefix: &str| { + let mut profile = openshell_providers::example_profiles::load("github-app").to_proto(); + profile.id = id.into(); + let base = format!("https://auth.example.com/{prefix}"); + profile.credentials[0].refresh.as_mut().unwrap().token_url = + format!("{base}/app/installations/{{installation_id}}/access_tokens"); + let mut grant = token_grant_credential("dynamic"); + grant.token_grant.as_mut().unwrap().token_endpoint = format!("{base}/exchange"); + profile.credentials.push(grant); + let mut oauth = refreshable_credential("oauth", "OAUTH_TOKEN"); + oauth.refresh.as_mut().unwrap().token_url = format!("{base}/oauth"); + profile.credentials.push(oauth); + profile + }; + let legacy = profile("a^b"); + state + .store + .put_message(&stored_provider_profile(legacy.clone())) + .await + .unwrap(); + + let listed = handle_list_provider_profiles( + &state, + authed_request(ListProviderProfilesRequest { + page_size: 100, + workspace_scope: Some(default_workspace_selector()), + ..Default::default() + }), + ) + .await + .unwrap() + .into_inner() + .profiles; + assert!(listed.iter().any(|profile| profile.id == "github")); + let fetched = listed.into_iter().find(|profile| profile.id == id).unwrap(); + assert_eq!(fetched.credentials, legacy.credentials); + + let update = |profile: ProviderProfile| { + authed_request(UpdateProviderProfilesRequest { + id: id.into(), + workspace_scope: Some(default_workspace_selector()), + expected_resource_version: fetched.resource_version, + profile: Some(ProviderProfileImportItem { + profile: Some(profile), + source: "repair.yaml".into(), + }), + ..Default::default() + }) + }; + let rejected = handle_update_provider_profiles(&state, update(legacy)) + .await + .unwrap() + .into_inner(); + assert!(!rejected.updated); + assert_eq!(rejected.diagnostics.len(), 3, "{:?}", rejected.diagnostics); + assert!( + rejected + .diagnostics + .iter() + .all(|d| d.message.contains("literal caret")) + ); + + let repaired = handle_update_provider_profiles(&state, update(profile("a%5Eb"))) + .await + .unwrap() + .into_inner(); + assert!(repaired.updated, "{:?}", repaired.diagnostics); + } + #[tokio::test] async fn update_provider_profile_replaces_custom_profile_and_preserves_metadata() { let state = test_server_state().await; diff --git a/crates/openshell-server/src/grpc/secret.rs b/crates/openshell-server/src/grpc/secret.rs index ff531454dc..3b37571257 100644 --- a/crates/openshell-server/src/grpc/secret.rs +++ b/crates/openshell-server/src/grpc/secret.rs @@ -166,7 +166,7 @@ fn normalize_allowed_endpoints(endpoints: &[String]) -> Result, Stat ))); } let mut normalized = BTreeSet::new(); - for endpoint in endpoints { + for (index, endpoint) in endpoints.iter().enumerate() { if endpoint.len() > MAX_ENDPOINT_LEN { return Err(Status::invalid_argument(format!( "allowed_endpoints entry exceeds maximum length ({} > {MAX_ENDPOINT_LEN})", @@ -174,7 +174,7 @@ fn normalize_allowed_endpoints(endpoints: &[String]) -> Result, Stat ))); } let value = normalize_token_endpoint(endpoint).map_err(|reason| { - Status::invalid_argument(format!("allowed_endpoints entry '{endpoint}' {reason}")) + Status::invalid_argument(format!("allowed_endpoints[{index}] {reason}")) })?; normalized.insert(value); } diff --git a/crates/openshell-server/src/grpc/secret_refresh_tests.rs b/crates/openshell-server/src/grpc/secret_refresh_tests.rs index 72efe36d3e..34059a3b34 100644 --- a/crates/openshell-server/src/grpc/secret_refresh_tests.rs +++ b/crates/openshell-server/src/grpc/secret_refresh_tests.rs @@ -9,7 +9,7 @@ use std::sync::Arc; use openshell_core::proto::datamodel::v1::ObjectMeta; use openshell_core::proto::{ ConfigureProviderRefreshRequest, CreateSecretRequest, DeleteSecretRequest, - GetProviderRefreshStatusRequest, ImportProviderProfilesRequest, + GetProviderRefreshStatusRequest, GetSecretRequest, ImportProviderProfilesRequest, InlineProviderRefreshSecretsRequest, Provider, ProviderCredentialRefresh, ProviderCredentialRefreshMaterial, ProviderCredentialRefreshStatus, ProviderCredentialRefreshStrategy, ProviderProfile, ProviderProfileCategory, @@ -27,7 +27,9 @@ use super::provider::{ handle_import_provider_profiles, handle_inline_provider_refresh_secrets, handle_rotate_provider_credential, }; -use super::secret::{handle_create_secret, handle_delete_secret, handle_update_secret}; +use super::secret::{ + handle_create_secret, handle_delete_secret, handle_get_secret, handle_update_secret, +}; use super::test_support::{authed_request, test_server_state}; use crate::ServerState; @@ -249,6 +251,43 @@ async fn mount_token(server: &MockServer, client_secret: &str, access_token: &st .await; } +#[tokio::test] +async fn creating_a_literal_caret_grant_requires_an_explicit_new_destination() { + let state = enabled_state().await; + let encoded = "https://login.example/a%5Eb"; + let error = handle_create_secret( + &state, + authed_request(CreateSecretRequest { + workspace_scope: Some(default_workspace()), + name: "acme".to_string(), + value: "dummy-secret".to_string(), + refresh_use: Some(SecretRefreshUse { + allowed_endpoints: vec!["https://login.example/a^b".to_owned(), encoded.to_owned()], + }), + ..Default::default() + }), + ) + .await + .unwrap_err(); + assert_eq!(error.code(), Code::InvalidArgument); + assert!(error.message().contains("literal") && error.message().contains("caret")); + + create_secret(&state, "dummy-secret", encoded).await; + let secret = handle_get_secret( + &state, + authed_request(GetSecretRequest { + workspace_scope: Some(default_workspace()), + name: "acme".to_string(), + }), + ) + .await + .unwrap() + .into_inner() + .secret + .unwrap(); + assert_eq!(secret.refresh_use.unwrap().allowed_endpoints, [encoded]); +} + #[tokio::test] async fn refresh_uses_the_current_secret_value_and_survives_inlining() { let server = MockServer::start().await; diff --git a/crates/openshell-server/src/provider_profile_sources.rs b/crates/openshell-server/src/provider_profile_sources.rs index 0c5715def0..ab97884e59 100644 --- a/crates/openshell-server/src/provider_profile_sources.rs +++ b/crates/openshell-server/src/provider_profile_sources.rs @@ -19,7 +19,8 @@ use openshell_gateway_interceptors::{ ProviderProfileSourceSnapshot as InterceptorProfileSnapshot, }; use openshell_providers::{ - ProfileValidationDiagnostic, ProviderTypeProfile, normalize_profile_id, validate_profile_set, + ProfileValidationDiagnostic, ProviderTypeProfile, normalize_profile_id, + validate_catalog_profiles, }; use prost::Message as _; use sha2::{Digest, Sha256}; @@ -1026,7 +1027,7 @@ fn validate_source_profiles( source_id: &str, profiles: &[(String, ProviderTypeProfile)], ) -> Result<(), Status> { - let diagnostics = validate_profile_set(profiles); + let diagnostics = validate_catalog_profiles(profiles); if let Some(diagnostic) = diagnostics .into_iter() .find(|diagnostic| diagnostic.severity == "error") diff --git a/deny.toml b/deny.toml index 5b31f96741..912e31b7fe 100644 --- a/deny.toml +++ b/deny.toml @@ -19,11 +19,6 @@ ignore = [ # oauth2, oci-client, russh-sftp, and russh-util. # https://github.com/chronotope/chrono/issues/1768 { id = "RUSTSEC-2026-0543", reason = "chrono is unmaintained; remove after first-party time APIs and all covered dependency graphs migrate to maintained alternatives and pass validation" }, - # The root and its aligned test workspaces retain url 2.5.8. Version 2.5.9 - # encodes a literal caret in a credential endpoint path as %5E, changing - # both the persisted allowlist entry and the HTTP request target. - # https://github.com/servo/rust-url/commit/25137be1fc1d35cc8ea7d43fc0a02166b023a483 - { id = "RUSTSEC-2026-0592", reason = "Remove when a patched url can preserve exact credential request targets and persisted endpoint grants across mixed gateway versions" }, ] # -- Licenses ------------------------------------------------------------------ diff --git a/docs/how-it-works/gateways/authentication.mdx b/docs/how-it-works/gateways/authentication.mdx index d63ef7206d..1167cb5e0f 100644 --- a/docs/how-it-works/gateways/authentication.mdx +++ b/docs/how-it-works/gateways/authentication.mdx @@ -173,6 +173,12 @@ gatewayConfig: scopes_claim: "" ``` +Use OIDC issuer and endpoint URLs whose paths contain no literal caret +(`^`). If a gateway or login client reports a literal-caret error, confirm +the intended route with the identity provider administrator and update the +issuer configuration or discovery document. A literal caret and `%5E` can +reach different routes on the same host. + The gateway requires HTTPS for OIDC discovery and JWKS retrieval, rejects redirects, and trusts the issuer origin for JWKS by default. Add a `jwks_allowed_origins` entry only when the identity provider intentionally serves diff --git a/docs/how-it-works/providers/overview.mdx b/docs/how-it-works/providers/overview.mdx index cec7c2f469..4a75daca6f 100644 --- a/docs/how-it-works/providers/overview.mdx +++ b/docs/how-it-works/providers/overview.mdx @@ -391,6 +391,39 @@ to remove the reference without replacing the provider's current grant. Use If credential storage fails during deletion, `openshell secret list` shows the secret as `deleting`. Rerun `openshell secret delete` to finish the cleanup. +### Replace a token endpoint with a literal caret + +The gateway refuses a refresh endpoint with a literal `^` in its path before +sending credentials. For example, `/a^b` and `/a%5Eb` can reach different +handlers on the same server. A secret granted access to `/a^b` needs a new +grant to reach `/a%5Eb`. + +1. Before upgrading, check each workspace with `openshell secret list` and + follow any `--page-token`. This lists grants without revealing secret values. + Use `openshell profile list` and `openshell profile export ID` to check + refresh and dynamic token-grant URLs, including profiles that use inline + credentials. Add `--global` to inspect platform profiles. An existing refresh + record can still use the URL from an earlier profile revision. +2. Confirm the intended destination with the endpoint operator. For refresh + credentials, update the profile's `token_url` or the material that supplies + the endpoint. Keep `{installation_id}` in a GitHub Enterprise Server + template. For a dynamic token grant, update `token_grant.token_endpoint` + in the profile and verify a new exchange. +3. For an immutable workspace secret grant, create a replacement secret with a + new name, supply the value through `--value-env` or `--value-file`, and set + `--allowed-endpoint` to the exact URL the owner approved. A GitHub App + grant uses the numeric installation ID. +4. For each affected refresh credential, run `openshell provider refresh + configure` with its complete material and any new secret references. Run + `openshell provider refresh rotate NAME --credential-key KEY` and verify a + new successful mint with `openshell provider refresh status NAME`. Restart + workloads that hold the previous credential handle. + +Apply the same steps to any old refresh record that reports a literal-caret +error after the upgrade. During an upgrade or rollback, use one gateway version +at a time against the same refresh records. Update supervisors that perform +dynamic token exchanges as well. Older binaries can still use literal paths. + ### AWS STS The gateway can mint short-lived AWS credentials with `sts:AssumeRole` for diff --git a/tests/suites/conformance/Cargo.lock b/tests/suites/conformance/Cargo.lock index a3c191b327..8fde589ec2 100644 --- a/tests/suites/conformance/Cargo.lock +++ b/tests/suites/conformance/Cargo.lock @@ -984,9 +984,9 @@ checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" [[package]] name = "form_urlencoded" -version = "1.2.2" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +checksum = "afa489199eaffb1211795df1c6236ce1ad0d41a6fa45250add73e3b02420f06e" dependencies = [ "percent-encoding", ] @@ -4279,9 +4279,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.8" +version = "2.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +checksum = "f00cd2407bb42c0ef17be88d4cf020f5cceffd121665bac9b8b9493a369b3b1a" dependencies = [ "form_urlencoded", "idna", diff --git a/tests/suites/continuity/Cargo.lock b/tests/suites/continuity/Cargo.lock index d73a9e10e7..e460821876 100644 --- a/tests/suites/continuity/Cargo.lock +++ b/tests/suites/continuity/Cargo.lock @@ -978,9 +978,9 @@ checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" [[package]] name = "form_urlencoded" -version = "1.2.2" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +checksum = "afa489199eaffb1211795df1c6236ce1ad0d41a6fa45250add73e3b02420f06e" dependencies = [ "percent-encoding", ] @@ -4253,9 +4253,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.8" +version = "2.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +checksum = "f00cd2407bb42c0ef17be88d4cf020f5cceffd121665bac9b8b9493a369b3b1a" dependencies = [ "form_urlencoded", "idna", diff --git a/tests/suites/drivers/podman/Cargo.lock b/tests/suites/drivers/podman/Cargo.lock index b56975e757..5959cded20 100644 --- a/tests/suites/drivers/podman/Cargo.lock +++ b/tests/suites/drivers/podman/Cargo.lock @@ -979,9 +979,9 @@ checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" [[package]] name = "form_urlencoded" -version = "1.2.2" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +checksum = "afa489199eaffb1211795df1c6236ce1ad0d41a6fa45250add73e3b02420f06e" dependencies = [ "percent-encoding", ] @@ -4271,9 +4271,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.8" +version = "2.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +checksum = "f00cd2407bb42c0ef17be88d4cf020f5cceffd121665bac9b8b9493a369b3b1a" dependencies = [ "form_urlencoded", "idna", diff --git a/tests/suites/features/Cargo.lock b/tests/suites/features/Cargo.lock index ba47285c9a..f6838c95d9 100644 --- a/tests/suites/features/Cargo.lock +++ b/tests/suites/features/Cargo.lock @@ -1007,9 +1007,9 @@ checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" [[package]] name = "form_urlencoded" -version = "1.2.2" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +checksum = "afa489199eaffb1211795df1c6236ce1ad0d41a6fa45250add73e3b02420f06e" dependencies = [ "percent-encoding", ] @@ -4358,9 +4358,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.8" +version = "2.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +checksum = "f00cd2407bb42c0ef17be88d4cf020f5cceffd121665bac9b8b9493a369b3b1a" dependencies = [ "form_urlencoded", "idna", diff --git a/tests/support/Cargo.lock b/tests/support/Cargo.lock index 8ba9df07e9..dba56ee458 100644 --- a/tests/support/Cargo.lock +++ b/tests/support/Cargo.lock @@ -979,9 +979,9 @@ checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" [[package]] name = "form_urlencoded" -version = "1.2.2" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +checksum = "afa489199eaffb1211795df1c6236ce1ad0d41a6fa45250add73e3b02420f06e" dependencies = [ "percent-encoding", ] @@ -4291,9 +4291,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.8" +version = "2.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +checksum = "f00cd2407bb42c0ef17be88d4cf020f5cceffd121665bac9b8b9493a369b3b1a" dependencies = [ "form_urlencoded", "idna", diff --git a/tests/testkit/Cargo.lock b/tests/testkit/Cargo.lock index 9874313ea9..278392179e 100644 --- a/tests/testkit/Cargo.lock +++ b/tests/testkit/Cargo.lock @@ -970,9 +970,9 @@ checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" [[package]] name = "form_urlencoded" -version = "1.2.2" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +checksum = "afa489199eaffb1211795df1c6236ce1ad0d41a6fa45250add73e3b02420f06e" dependencies = [ "percent-encoding", ] @@ -4245,9 +4245,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.8" +version = "2.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +checksum = "f00cd2407bb42c0ef17be88d4cf020f5cceffd121665bac9b8b9493a369b3b1a" dependencies = [ "form_urlencoded", "idna",