summaryrefslogtreecommitdiff
path: root/test/webrick/test_httpauth.rb
AgeCommit message (Collapse)Author
2020-12-10Move webrick library into internal test toolchainHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/3729
2019-10-01Loop with String#scan without creating substringsNobuyoshi Nakada
Create the substrings necessary parts only, instead of cutting the rest of the buffer. Also removed a useless, probable typo, regexp.
2019-08-11Adjust indent [ci skip]Nobuyoshi Nakada
2019-06-01Update String#crypt tests to work on OpenBSDJeremy Evans
Skip the webrick httpauth tests that use crypt when testing on OpenBSD. Fixes [Bug #11363]
2018-07-26Add missing escapekazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64066 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-26webrick: Support bcrypt password hashingnormal
This adds a password_hash keyword argument to WEBrick::HTTPAuth::Htpasswd#initialize. If set to :bcrypt, it will create bcrypt hashes instead of crypt hashes, and will raise an exception if the .htpasswd file uses crypt hashes. If :bcrypt is used, then instead of calling BasicAuth.make_passwd (which uses crypt), WEBrick::HTTPAuth::Htpasswd#set_passwd will set the bcrypt password directly. It isn't possible to change the make_passwd API to accept the password hash format, as that would break configurations who use Htpasswd#auth_type= to set a custom auth_type. This modifies WEBrick::HTTPAuth::BasicAuth to handle checking both crypt and bcrypt hashes. There are commented out requires for 'string/crypt', to handle when String#crypt is deprecated and the undeprecated version is moved to a gem. There is also a commented out warning for the case when the password_hash keyword is not specified and 'string/crypt' cannot be required. I think the warning makes sense to nudge users to using bcrypt. I've updated the tests to test nil, :crypt, and :bcrypt values for the password_hash keyword, skipping the bcrypt tests if the bcrypt library cannot be required. [ruby-core:88111] [Feature #14940] From: Jeremy Evans <code@jeremyevans.net> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64060 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-03adjust indent [ci skip]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63076 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-03repatch r62966 and r62969.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-03adjust indent [ci skip]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63070 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-03Revert r62966 and r62969naruse
It breaks mswin's test-all git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-28adjust indents [ci skip]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-28webrick: add test for Digest auth-intnormal
No changes to the actual code, this is a new test for a feature for which no tests existed. I don't understand the Digest authentication code well at all, but this is necessary for the subsequent change. * test/webrick/test_httpauth.rb (test_digest_auth_int): new test (credentials_for_request): support bodies with POST git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-14lib/webrick/log.rb: sanitize any type of logsmame
It had failed to sanitize some type of exception messages. Reported and patched by Yusuke Endoh (mame) at https://hackerone.com/reports/223363 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-05leakchecker.rb: remove temporary measurenobu
* lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler#watcher): make watcher thread restartable. * lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler#terminate): new method to terminate watcher thread. * test/lib/leakchecker.rb (LeakChecker#find_threads): revert r46941. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16Add frozen_string_literal: false for all filesnaruse
When you change this to true, you may need to add more tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-09* test/open-uri: Test server log in server thread.akr
* test/webrick: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-09* test/webrick: Store log in an array.akr
* test/net/http: Ditto. * test/open-uri: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48341 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-09Fix previous change.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-09* test/webrick: Refine log tests.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48326 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-08* test/webrick: Examine log and use assert_join_threads.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48318 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-20* test/csv/test_features.rb, test/logger/test_logger.rbakr
test/mkmf/test_have_macro.rb, test/net/http/test_http.rb, test/openssl/test_config.rb, test/psych/test_encoding.rb, test/psych/test_exception.rb, test/psych/test_psych.rb, test/psych/test_tainted.rb, test/readline/test_readline.rb, test/rexml/test_contrib.rb, test/ruby/test_autoload.rb, test/ruby/test_beginendblock.rb, test/ruby/test_exception.rb, test/ruby/test_file.rb, test/ruby/test_io.rb, test/ruby/test_marshal.rb, test/ruby/test_process.rb, test/ruby/test_require.rb, test/ruby/test_rubyoptions.rb, test/syslog/test_syslog_logger.rb, test/webrick/test_httpauth.rb, test/zlib/test_zlib.rb: Use Tempfile.create. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-02Suppress warningsnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-24* test/ruby/test_require.rb: Remove temporally files in the tests.akr
* test/ruby/test_rubyoptions.rb: Ditto. * test/logger/test_logger.rb: Ditto. * test/psych/test_psych.rb: Ditto. * test/readline/test_readline.rb: Ditto. * test/syslog/test_syslog_logger.rb: Ditto. * test/webrick/test_httpauth.rb: Ditto. * test/zlib/test_zlib.rb: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39899 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-05Remove debug print of r32410.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-05* lib/webrick/httpauth/digestauth.rb (_authenticate):naruse
Literal texts in HTTP ABNF is case-insensitive (RFC2616 2.1), and a ample implementation in RFC2617 also ignores the case of algorithms. So now this ignores those cases. [ruby-dev:43965] [Feature #4936] * lib/webrick/httpauth/digestauth.rb (initialize): Because of above, opera_hack is useless and removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-02use require_relative.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26542 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-06* {ext,lib,test}/**/*.rb: removed trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-29* test/webrick/utils.rb (start_server): provide a reference to log ofmame
webrick. * test/webrick/test_httpproxy.rb, test/webrick/test_httpauth.rb, test/webrick/test_cgi.rb, test/webrick/test_httpserver.rb, test/webrick/test_server.rb, test/webrick/test_filehandler.rb: use webrick log as an assertion message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-24* test: assert_raises has been deprecated since a long time ago.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-01-07* lib/webrick/httpproxy.rb (WEBrick::HTTPProxyServer#proxy_service):gotoyuzo
should delete trailing LF from the result of pack("m*"). * lib/webrick/httpproxy.rb (WEBrick::HTTPProxyServer#proxy_connect): - should delete trailing LF from the result of pack("m*"). - clear Request-Line not to send the sesponse by HTTPServer#run. * lib/webrick/httputils (WEBrick::HTTPUtils.parse_qvalues): refine regexp (and change the name of a local variable). * lib/webrick/server.rb (WEBrick::Daemon.start): prepared stdio don't allow changing its mode. * test/webrick/*, sample/webrick/httpproxy.rb: add new files. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-01-02* lib/webrick/httpauth/htpasswd.rb (WEBrick::Htpasswd#reload):gotoyuzo
raise NotImplementedError if password is encrypted by digest algorithms. This patch is contributed by sheepman. [ruby-list:40467] * lib/webrick/httpauth/digestauth.rb (WEBrick::HTTPAuth::DigestAuth#_authenticate): fix digest calculation. This patch is contributed by sheepman. [ruby-list:40482] * lib/webrick/{httpauth.rb,httpauth/basicauth.rb,httpproxy.rb}: use pack/unpack-template char "m" instead of lib/base64.rb to do base64 encoding/decoding. fixed: [ruby-dev:25336] * test/webrick/test_httpauth.rb: new file. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7708 b2dd03c8-39d4-4d8f-98ff-823fe69b080e