Class: Karafka::Web::Pro::Ui::Lib::Policies::Messages
- Inherits:
-
Object
- Object
- Karafka::Web::Pro::Ui::Lib::Policies::Messages
- Defined in:
- lib/karafka/web/pro/ui/lib/policies/messages.rb
Overview
Allows for a granular control over what parts of messages are being displayed and operated on. There are scenarios where payload or other parts of messages should not be presented because they may contain sensitive data. This API allows to manage that on a per message basis.
Instance Method Summary collapse
-
#download?(message) ⇒ Boolean
Should it be allowed to download this message raw payload.
-
#export?(message) ⇒ Boolean
Should it be allowed to download the deserialized and sanitized payload as JSON.
-
#headers?(_message) ⇒ Boolean
Should message headers be visible.
-
#key?(_message) ⇒ Boolean
Should message key be visible.
-
#payload?(message) ⇒ Boolean
Should message payload be visible.
-
#republish?(_message) ⇒ Boolean
Should we allow to republish given message.
Instance Method Details
#download?(message) ⇒ Boolean
Should it be allowed to download this message raw payload
48 49 50 |
# File 'lib/karafka/web/pro/ui/lib/policies/messages.rb', line 48 def download?() payload?() end |
#export?(message) ⇒ Boolean
Should it be allowed to download the deserialized and sanitized payload as JSON
56 57 58 |
# File 'lib/karafka/web/pro/ui/lib/policies/messages.rb', line 56 def export?() payload?() end |
#headers?(_message) ⇒ Boolean
Returns should message headers be visible.
34 35 36 |
# File 'lib/karafka/web/pro/ui/lib/policies/messages.rb', line 34 def headers?() true end |
#key?(_message) ⇒ Boolean
Returns should message key be visible.
28 29 30 |
# File 'lib/karafka/web/pro/ui/lib/policies/messages.rb', line 28 def key?() true end |
#payload?(message) ⇒ Boolean
Returns should message payload be visible.
40 41 42 |
# File 'lib/karafka/web/pro/ui/lib/policies/messages.rb', line 40 def payload?() !.headers.key?('encryption') end |
#republish?(_message) ⇒ Boolean
This is a simple API that does not provide granular republishing support. You can decide whether to allow for republishing but you cannot say “allow only to X”, etc.
Should we allow to republish given message
67 68 69 |
# File 'lib/karafka/web/pro/ui/lib/policies/messages.rb', line 67 def republish?() true end |