Add admin API for managing IP blocks (#19065)
This commit is contained in:
parent
ff19dad5a0
commit
b399d79545
5 changed files with 120 additions and 1 deletions
14
app/serializers/rest/admin/ip_block_serializer.rb
Normal file
14
app/serializers/rest/admin/ip_block_serializer.rb
Normal file
|
@ -0,0 +1,14 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class REST::Admin::IpBlockSerializer < ActiveModel::Serializer
|
||||
attributes :id, :ip, :severity, :comment,
|
||||
:created_at, :expires_at
|
||||
|
||||
def id
|
||||
object.id.to_s
|
||||
end
|
||||
|
||||
def ip
|
||||
"#{object.ip}/#{object.ip.prefix}"
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue