Class: Installation::Clients::SecurityProposal
- Inherits:
-
ProposalClient
- Object
- ProposalClient
- Installation::Clients::SecurityProposal
- Includes:
- Yast::I18n, Yast::Logger
- Defined in:
- src/lib/installation/clients/security_proposal.rb
Overview
Firewall and SSH installation proposal client
Constant Summary collapse
- SERVICES_LINKS =
[ LINK_ENABLE_FIREWALL = "security--enable_firewall".freeze, LINK_DISABLE_FIREWALL = "security--disable_firewall".freeze, LINK_OPEN_SSH_PORT = "security--open_ssh".freeze, LINK_BLOCK_SSH_PORT = "security--close_ssh".freeze, LINK_ENABLE_SSHD = "security--enable_sshd".freeze, LINK_DISABLE_SSHD = "security--disable_sshd".freeze, LINK_OPEN_VNC = "security--open_vnc".freeze, LINK_CLOSE_VNC = "security--close_vnc".freeze, LINK_CPU_MITIGATIONS = "security--cpu_mitigations".freeze ].freeze
- LINK_DIALOG =
"security".freeze
Instance Attribute Summary collapse
-
#settings ⇒ Object
[Installation::SecuritySettings] Stores the proposal settings.
Instance Method Summary collapse
- #ask_user(param) ⇒ Object
- #description ⇒ Object
-
#initialize ⇒ SecurityProposal
constructor
Constructor.
- #make_proposal(_attrs) ⇒ Object
- #preformatted_proposal ⇒ Object
- #warning ⇒ Object
- #write ⇒ Object
Constructor Details
#initialize ⇒ SecurityProposal
Constructor
58 59 60 61 62 63 64 65 |
# File 'src/lib/installation/clients/security_proposal.rb', line 58 def initialize super Yast.import "UI" Yast.import "HTML" textdomain "installation" @settings ||= ::Installation::SecuritySettings.instance end |
Instance Attribute Details
#settings ⇒ Object
[Installation::SecuritySettings] Stores the proposal settings
41 42 43 |
# File 'src/lib/installation/clients/security_proposal.rb', line 41 def settings @settings end |
Instance Method Details
#ask_user(param) ⇒ Object
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'src/lib/installation/clients/security_proposal.rb', line 99 def ask_user(param) chosen_link = param["chosen_id"] result = :next log.info "User clicked #{chosen_link}" if SERVICES_LINKS.include?(chosen_link) call_proposal_action_for(chosen_link) elsif chosen_link == LINK_DIALOG result = ::Installation::Dialogs::Security.new(@settings).run else raise "INTERNAL ERROR: unknown action '#{chosen_link}' for proposal client" end { "workflow_sequence" => result } end |
#description ⇒ Object
67 68 69 70 71 72 73 74 75 |
# File 'src/lib/installation/clients/security_proposal.rb', line 67 def description { # Proposal title "rich_text_title" => _("Security"), # Menu entry label "menu_title" => _("&Security"), "id" => LINK_DIALOG } end |
#make_proposal(_attrs) ⇒ Object
77 78 79 80 81 82 83 84 |
# File 'src/lib/installation/clients/security_proposal.rb', line 77 def make_proposal(_attrs) { "preformatted_proposal" => preformatted_proposal, "warning_level" => :warning, "links" => SERVICES_LINKS, "warning" => warning } end |
#preformatted_proposal ⇒ Object
86 87 88 |
# File 'src/lib/installation/clients/security_proposal.rb', line 86 def preformatted_proposal Yast::HTML.List(proposals) end |
#warning ⇒ Object
90 91 92 93 94 95 96 97 |
# File 'src/lib/installation/clients/security_proposal.rb', line 90 def warning return nil unless @settings.access_problem? # TRANSLATORS: proposal warning text preventing the user to block # the root login by error. _("The 'root' user uses only SSH key-based authentication. <br>" \ "With the current settings the user might not be allowed to login.") end |
#write ⇒ Object
115 116 117 |
# File 'src/lib/installation/clients/security_proposal.rb', line 115 def write { "success" => true } end |