Skip to content

Commit

Permalink
chore: add logs from permissions external command execution
Browse files Browse the repository at this point in the history
  • Loading branch information
Chadin Anuwattanaporn committed Oct 23, 2024
1 parent 10e8f3f commit e11c0e8
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions server/events/external_team_allowlist_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ func (checker *ExternalTeamAllowlistChecker) IsCommandAllowedForTeam(ctx models.
return false
}

return checker.checkOutputResults(out)
outputResults := checker.checkOutputResults(out)
if !outputResults {
ctx.Log.Info("command %q returns %q", cmd, out)
}

return outputResults
}

func (checker *ExternalTeamAllowlistChecker) IsCommandAllowedForAnyTeam(ctx models.TeamAllowlistCheckerContext, teams []string, command string) bool {
Expand All @@ -36,7 +41,12 @@ func (checker *ExternalTeamAllowlistChecker) IsCommandAllowedForAnyTeam(ctx mode
return false
}

return checker.checkOutputResults(out)
outputResults := checker.checkOutputResults(out)
if !outputResults {
ctx.Log.Info("command %q returns %q", cmd, out)
}

return outputResults
}

func (checker *ExternalTeamAllowlistChecker) buildCommandString(ctx models.TeamAllowlistCheckerContext, teams []string, command string) string {
Expand Down

0 comments on commit e11c0e8

Please sign in to comment.