scs_server: log service identity from parameters

Summary:
Currently we rely on an implicit log when we obtain the service identity
permissions.  That will be going away, so move to an explicit log from the
request parameters.

Reviewed By: kris1319

Differential Revision: D36127862

fbshipit-source-id: 30b47533657b3437ec5a2beb189aeb1d972bb29a
This commit is contained in:
Mark Juggurnauth-Thomas 2022-05-04 12:14:49 -07:00 committed by Facebook GitHub Bot
parent 9d9a3e3e82
commit 7c566e21b0
2 changed files with 15 additions and 2 deletions

View File

@ -1493,7 +1493,6 @@ impl RepoContext {
self.ctx = self.ctx.with_mutated_scuba(|mut scuba| {
scuba.add("write_permissions_model", "service");
scuba.add("service_identity", service_identity.as_str());
scuba
});
@ -1553,7 +1552,6 @@ impl RepoContext {
self.ctx = self.ctx.with_mutated_scuba(|mut scuba| {
scuba.add("write_permissions_model", "service");
scuba.add("service_identity", service_identity.as_str());
scuba
});

View File

@ -62,6 +62,9 @@ impl AddScubaParams for thrift::RepoCreateCommitParams {
scuba.add("param_changes_count", self.changes.len() - deletes_count);
scuba.add("param_deletes_count", deletes_count);
self.identity_schemes.add_scuba_params(scuba);
if let Some(service_identity) = self.service_identity.as_deref() {
scuba.add("service_identity", service_identity);
}
}
}
@ -69,6 +72,9 @@ impl AddScubaParams for thrift::RepoCreateBookmarkParams {
fn add_scuba_params(&self, scuba: &mut MononokeScubaSampleBuilder) {
scuba.add("bookmark_name", self.bookmark.as_str());
scuba.add("commit", self.target.to_string());
if let Some(service_identity) = self.service_identity.as_deref() {
scuba.add("service_identity", service_identity);
}
}
}
@ -83,6 +89,9 @@ impl AddScubaParams for thrift::RepoMoveBookmarkParams {
"param_allow_non_fast_forward_move",
self.allow_non_fast_forward_move as i32,
);
if let Some(service_identity) = self.service_identity.as_deref() {
scuba.add("service_identity", service_identity);
}
}
}
@ -92,6 +101,9 @@ impl AddScubaParams for thrift::RepoDeleteBookmarkParams {
if let Some(old_target) = &self.old_target {
scuba.add("param_old_target", old_target.to_string());
}
if let Some(service_identity) = self.service_identity.as_deref() {
scuba.add("service_identity", service_identity);
}
}
}
@ -110,6 +122,9 @@ impl AddScubaParams for thrift::RepoLandStackParams {
.collect::<ScubaValue>(),
);
}
if let Some(service_identity) = self.service_identity.as_deref() {
scuba.add("service_identity", service_identity);
}
}
}