Skip to content

Commit

Permalink
add x2p field to payload
Browse files Browse the repository at this point in the history
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
  • Loading branch information
MichaelCuevas authored and facebook-github-bot committed Dec 7, 2024
1 parent 58a7234 commit 0157177
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions eden/scm/lib/commitcloudsubscriber/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,18 +205,15 @@ pub fn read_or_generate_access_token(user_token_path: &Option<PathBuf>) -> 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",
Expand Down

0 comments on commit 0157177

Please sign in to comment.