Sha256: 71f636232613c8e440d27fb96e120cfb16c2f7926c19c88b1c88e1ea4940ca0c

Contents?: true

Size: 1.05 KB

Versions: 28

Compression:

Stored size: 1.05 KB

Contents

module Net
  module SSH
    module Authentication
      # Loads ED25519 support which requires optinal dependecies like
      # ed25519, bcrypt_pbkdf
      module ED25519Loader
        begin
          require 'net/ssh/authentication/ed25519'
          LOADED = true
          ERROR = nil
        rescue LoadError => e
          ERROR = e
          LOADED = false
        end

        def self.raiseUnlessLoaded(message)
          description = ERROR.is_a?(LoadError) ? dependenciesRequiredForED25519 : ''
          description << "#{ERROR.class} : \"#{ERROR.message}\"\n" if ERROR
          raise NotImplementedError, "#{message}\n#{description}" unless LOADED
        end

        def self.dependenciesRequiredForED25519
          result = "net-ssh requires the following gems for ed25519 support:\n"
          result << " * ed25519 (>= 1.2, < 2.0)\n"
          result << " * bcrypt_pbkdf (>= 1.0, < 2.0)\n" unless RUBY_PLATFORM == "java"
          result << "See https://github.com/net-ssh/net-ssh/issues/565 for more information\n"
        end
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 6 rubygems

Version Path
net-ssh-7.3.0 lib/net/ssh/authentication/ed25519_loader.rb
net-ssh-7.3.0.rc1 lib/net/ssh/authentication/ed25519_loader.rb
harbr-2.8.1 vendor/bundle/ruby/3.2.0/gems/net-ssh-7.2.1/lib/net/ssh/authentication/ed25519_loader.rb
net-ssh-7.2.3 lib/net/ssh/authentication/ed25519_loader.rb
net-ssh-backports-6.3.6.backports lib/net/ssh/authentication/ed25519_loader.rb
net-ssh-backports-6.3.5.backports lib/net/ssh/authentication/ed25519_loader.rb
net-ssh-backports-6.3.4.backports lib/net/ssh/authentication/ed25519_loader.rb
net-ssh-backports-6.3.3.backports lib/net/ssh/authentication/ed25519_loader.rb
net-ssh-backports-6.3.2.backports lib/net/ssh/authentication/ed25519_loader.rb
net-ssh-backports-6.3.1.backports lib/net/ssh/authentication/ed25519_loader.rb
net-ssh-backports-6.3.0.backports lib/net/ssh/authentication/ed25519_loader.rb
net-ssh-7.2.2.rc1 lib/net/ssh/authentication/ed25519_loader.rb
net-ssh-7.2.1 lib/net/ssh/authentication/ed25519_loader.rb
net-ssh-7.2.1.rc1 lib/net/ssh/authentication/ed25519_loader.rb
honeybadger-5.4.0 vendor/bundle/ruby/3.2.0/gems/net-ssh-7.2.0/lib/net/ssh/authentication/ed25519_loader.rb
honeybadger-5.3.0 vendor/bundle/ruby/3.2.0/gems/net-ssh-7.2.0/lib/net/ssh/authentication/ed25519_loader.rb
net-ssh-7.2.0 lib/net/ssh/authentication/ed25519_loader.rb
net-ssh-7.2.0.rc1 lib/net/ssh/authentication/ed25519_loader.rb
net-ssh-7.2.0.beta1 lib/net/ssh/authentication/ed25519_loader.rb
net-ssh-7.1.0 lib/net/ssh/authentication/ed25519_loader.rb