Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Defer requirement of securerandom, use regular require #511

Merged
merged 2 commits into from
Jan 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
module ManageIQ::Providers::Vmware::CloudManager::Vm::RemoteConsole
require_dependency 'securerandom'

def console_supported?(type)
%w(WEBMKS).include?(type.upcase)
end
Expand Down Expand Up @@ -39,11 +37,15 @@ def remote_console_acquire_ticket_queue(protocol, userid)
#

def remote_console_webmks_acquire_ticket(userid, originating_server = nil)
require 'securerandom'

validate_remote_console_webmks_support
ticket = nil

ext_management_system.with_provider_connection do |service|
ticket = service.post_acquire_mks_ticket(ems_ref).body
end

raise(MiqException::RemoteConsoleNotSupportedError, 'Could not obtain WebMKS ticket') unless ticket && ticket[:Ticket]

SystemConsole.force_vm_invalid_token(id)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
module ManageIQ::Providers::Vmware::InfraManager::Vm::RemoteConsole
require_dependency 'securerandom'

def console_supported?(type)
%w(VMRC VNC WEBMKS).include?(type.upcase)
end
Expand Down Expand Up @@ -93,6 +91,8 @@ def remote_console_html5_acquire_ticket(userid, originating_server = nil)
# VNC
#
def remote_console_vnc_acquire_ticket(userid, originating_server)
require 'securerandom'

validate_remote_console_acquire_ticket("vnc")

password = SecureRandom.base64[0, 8] # Random password from the Base64 character set
Expand Down