mirror of
https://github.com/ubicloud/ubicloud.git
synced 2025-10-04 22:02:18 +08:00
Previously, project_id and subject_id needed to be a uuid, and object_id could be a uuid or ubid. This allows accepting an object for all three. This simplifies almost all callers of these methods. It also doesn't require either parsing a ubid or generating a ubid. Previously, even if a uuid was given, it would turn it into a ubid in order to extract the class, and guess ApiKey if it was an et ubid.
29 lines
671 B
Ruby
29 lines
671 B
Ruby
# frozen_string_literal: true
|
|
|
|
class Clover
|
|
hash_branch(:project_prefix, "firewall") do |r|
|
|
r.get true do
|
|
dataset = firewall_list_dataset
|
|
|
|
if api?
|
|
firewall_list_api_response(dataset)
|
|
else
|
|
@firewalls = dataset.eager(:location).all
|
|
view "networking/firewall/index"
|
|
end
|
|
end
|
|
|
|
r.web do
|
|
r.get "create" do
|
|
authorize("Firewall:create", @project)
|
|
view "networking/firewall/create"
|
|
end
|
|
|
|
r.post true do
|
|
handle_validation_failure("networking/firewall/create")
|
|
check_visible_location
|
|
firewall_post(typecast_params.nonempty_str("name"))
|
|
end
|
|
end
|
|
end
|
|
end
|