chore(vulnerability): Insertion of sensitive information into log files (#11088)

This commit is contained in:
Pinaki Bhattacharjee 2024-08-03 18:32:43 +05:30 committed by GitHub
parent c572d39bbf
commit aeef69cbaf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 7 deletions

View File

@ -41,7 +41,7 @@ public class RevokeAccessTokenResolver implements DataFetcher<CompletableFuture<
final QueryContext context = environment.getContext(); final QueryContext context = environment.getContext();
final String tokenId = bindArgument(environment.getArgument("tokenId"), String.class); final String tokenId = bindArgument(environment.getArgument("tokenId"), String.class);
log.info("User {} revoking access token {}", context.getActorUrn(), tokenId); log.info("User {} revoking access token", context.getActorUrn());
if (isAuthorizedToRevokeToken(context, tokenId)) { if (isAuthorizedToRevokeToken(context, tokenId)) {
try { try {

View File

@ -23,16 +23,16 @@ public class DeleteSecretResolver implements DataFetcher<CompletableFuture<Strin
public CompletableFuture<String> get(final DataFetchingEnvironment environment) throws Exception { public CompletableFuture<String> get(final DataFetchingEnvironment environment) throws Exception {
final QueryContext context = environment.getContext(); final QueryContext context = environment.getContext();
if (IngestionAuthUtils.canManageSecrets(context)) { if (IngestionAuthUtils.canManageSecrets(context)) {
final String secretUrn = environment.getArgument("urn"); final String inputUrn = environment.getArgument("urn");
final Urn urn = Urn.createFromString(secretUrn); final Urn urn = Urn.createFromString(inputUrn);
return GraphQLConcurrencyUtils.supplyAsync( return GraphQLConcurrencyUtils.supplyAsync(
() -> { () -> {
try { try {
_entityClient.deleteEntity(context.getOperationContext(), urn); _entityClient.deleteEntity(context.getOperationContext(), urn);
return secretUrn; return inputUrn;
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException( throw new RuntimeException(
String.format("Failed to perform delete against secret with urn %s", secretUrn), String.format("Failed to perform delete against secret with urn %s", inputUrn),
e); e);
} }
}, },

View File

@ -54,10 +54,10 @@ public class SearchUtil {
public static FilterValue createFilterValue(String value, Long facetCount, Boolean isFilteredOn) { public static FilterValue createFilterValue(String value, Long facetCount, Boolean isFilteredOn) {
// TODO(indy): test this // TODO(indy): test this
String[] aggregationTokens = value.split(AGGREGATION_SEPARATOR_CHAR); String[] aggregations = value.split(AGGREGATION_SEPARATOR_CHAR);
FilterValue result = FilterValue result =
new FilterValue().setValue(value).setFacetCount(facetCount).setFiltered(isFilteredOn); new FilterValue().setValue(value).setFacetCount(facetCount).setFiltered(isFilteredOn);
String lastValue = aggregationTokens[aggregationTokens.length - 1]; String lastValue = aggregations[aggregations.length - 1];
if (lastValue.startsWith(URN_PREFIX)) { if (lastValue.startsWith(URN_PREFIX)) {
try { try {
result.setEntity(Urn.createFromString(lastValue)); result.setEntity(Urn.createFromString(lastValue));