From 0157177f5b21594936052f1292eea07c98948afd Mon Sep 17 00:00:00 2001 From: Michael Cuevas Date: Fri, 6 Dec 2024 16:12:48 -0800 Subject: [PATCH] add x2p field to payload Summary: # This diff Adds a "x2p" field to the clicat payload that specifies whether x2p should be used or not. # Context Currently, calls to the XInternGraphCommitCloudPollWorkspaceUpdateInternGraphJsonController on interngraph are functioning very unreliably. It's an X2P request to interngraph that isn't marked as such or supported. It's crucial that we fix this so we can unblock another team fixing a X2P vulnerability. Differential Revision: D66901312 fbshipit-source-id: 204e0e59be334cfc66695ec111c74c0bdf1c4764 --- eden/scm/lib/commitcloudsubscriber/src/util.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/eden/scm/lib/commitcloudsubscriber/src/util.rs b/eden/scm/lib/commitcloudsubscriber/src/util.rs index bbcb1bd537b5e..375432b6d1b59 100644 --- a/eden/scm/lib/commitcloudsubscriber/src/util.rs +++ b/eden/scm/lib/commitcloudsubscriber/src/util.rs @@ -205,18 +205,15 @@ pub fn read_or_generate_access_token(user_token_path: &Option) -> Resul // Try to issue a CAT token automatically. // These tokens generation work differently for Icebreaker and InternGraph - let clicat_tool = if hostcaps::is_prod() { - "clicat" - } else { - "corp_clicat" - }; + let from_prod = hostcaps::is_prod(); + let clicat_tool = if from_prod { "clicat" } else { "corp_clicat" }; info!( "Token Lookup: generating a CAT token via {} ...", clicat_tool ); let token_timeout_seconds = 1200; let payload = base64::engine::general_purpose::STANDARD - .encode(json!({"app":COMMIT_CLOUD_APP_ID}).to_string()); + .encode(json!({"app":COMMIT_CLOUD_APP_ID, "x2p": !from_prod}).to_string()); let output = Command::new(clicat_tool) .args(vec![ "create",