Skip to content

Commit 0d0bb81

Browse files
Clifford Imhomohmeta-codesync[bot]
authored andcommitted
Enable logging for sub asset classes
Summary: Thrift is a special integration in which it can be the parent asset class of other asset classes. There are instances in which we want to get the logging for the sub classes without creating a standalone PolicyEnforcer class for that sub class. ## This diff Enable thrift policy enforcer to decide which asset class gets returned for logging. Right now we want logging for Cachius, other asset classes will keep defaulting to Thrift Reviewed By: kamleshdhondge Differential Revision: D89681272 fbshipit-source-id: 52a4dc52c9504a7d92f6fd0e04f750bcf2fc6437
1 parent 6f3c992 commit 0d0bb81

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

third-party/thrift/src/thrift/lib/hack/src/ThriftPolicyEnforcer.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,16 @@ protected static function getConditionallyAllowedCallersBitmask(
9191
0;
9292
}
9393

94+
<<__Override>>
95+
protected static function getAssetClassForServiceGraphLogging(
96+
string $asset_type,
97+
)[leak_safe]: PolicyEnforcerAssetClass {
98+
if ($asset_type == 'CachiusService') {
99+
return PolicyEnforcerAssetClass::CACHIUS;
100+
}
101+
return static::ASSET_CLASS;
102+
}
103+
94104
public static function getCallerName(
95105
string $asset_type, // This is actually the service name in this context
96106
?int $caller,

0 commit comments

Comments
 (0)