Skip to content

Commit

Permalink
log a warning when paths are not allowed (#3316)
Browse files Browse the repository at this point in the history
log a warning when paths are not allowed.
  • Loading branch information
johrstrom authored Jan 25, 2024
1 parent 2cd4a67 commit 7ac4846
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion apps/dashboard/app/models/allowlist_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ def permitted?(path)
# @raises ArgumentError if any allowlist path or permitted? argument
# has the form ~user/some/path where user doesn't exist
def validate!(path)
raise AllowlistPolicy::Forbidden, "#{path} does not have an ancestor directory specified in ALLOWLIST_PATH" unless permitted?(path.to_s)
return if permitted?(path.to_s)

msg = "#{path} does not have an ancestor directory specified in ALLOWLIST_PATH"
Rails.logger.warn(msg)
raise AllowlistPolicy::Forbidden, msg
end

protected
Expand Down

0 comments on commit 7ac4846

Please sign in to comment.