lib/neo4j/railtie.rb in neo4j-6.0.0.alpha.2 vs lib/neo4j/railtie.rb in neo4j-6.0.0.alpha.3
- old
+ new
@@ -32,21 +32,22 @@
cfg.sessions << {type: cfg.session_type, path: cfg.session_path, options: cfg.session_options}
end
def setup_config_defaults!(cfg)
- cfg.session_type ||= ENV['NEO4J_PATH'] ? :embedded_db : :server_db
- cfg.session_path ||= ENV['NEO4J_URL'] || ENV['NEO4J_PATH'] || 'http://localhost:7474'
+ cfg.session_type ||= default_session_type
+ cfg.session_path ||= default_session_path
cfg.session_options ||= {}
cfg.sessions ||= []
+ end
- uri = URI(cfg.session_path)
- return if uri.user.blank?
-
- cfg.session_options.reverse_merge!(basic_auth: {username: uri.user, password: uri.password})
- cfg.session_path = cfg.session_path.gsub("#{uri.user}:#{uri.password}@", '')
+ def default_session_type
+ ENV['NEO4J_PATH'] ? :embedded_db : :server_db
end
+ def default_session_path
+ ENV['NEO4J_URL'] || ENV['NEO4J_PATH'] || 'http://localhost:7474'
+ end
def start_embedded_session(session)
# See https://github.com/jruby/jruby/wiki/UnlimitedStrengthCrypto
security_class = java.lang.Class.for_name('javax.crypto.JceSecurity')
restricted_field = security_class.get_declared_field('isRestricted')