別のキーワード
種類
- インスタンスメソッド (144)
- 特異メソッド (60)
- クラス (36)
- モジュール関数 (24)
ライブラリ
クラス
モジュール
キーワード
- BasicAuth (12)
- DigestAuth (12)
- Htdigest (12)
-
basic
_ auth (12) -
delete
_ passwd (24) - each (12)
-
get
_ passwd (36) -
make
_ passwd (36) - new (36)
-
proxy
_ basic _ auth (12) -
set
_ passwd (36)
検索結果
先頭5件
- WEBrick
:: HTTPAuth :: BasicAuth - WEBrick
:: HTTPAuth :: BasicAuth . new(config , default = Config :: BasicAuth) -> WEBrick :: HTTPAuth :: BasicAuth - WEBrick
:: HTTPAuth :: DigestAuth - WEBrick
:: HTTPAuth :: Htdigest - WEBrick
:: HTTPAuth :: DigestAuth . new(config , default = WEBrick :: Config :: DigestAuth) -> WEBrick :: HTTPAuth :: DigestAuth
-
WEBrick
:: HTTPAuth :: BasicAuth (24.0) -
HTTP の Basic 認証のためのクラスです。
...HTTP の Basic 認証のためのクラスです。
例
require 'webrick'
realm = "WEBrick's realm"
srv = WEBrick::HTTPServer.new({ :BindAddress => '127.0.0.1', :Port => 10080})
htpd = WEBrick::HTTPAuth::Htpasswd.new('dot.htpasswd')
htpd.set_passwd(nil, 'username', 'supersecre......tpass')
authenticator = WEBrick::HTTPAuth::BasicAuth.new(:UserDB => htpd, :Realm => realm)
srv.mount_proc('/basic_auth') {|req, res|
authenticator.authenticate(req, res)
res.body = "hoge"
}
srv.start # http://127.0.0.1:10080/basic_auth... -
WEBrick
:: HTTPAuth :: BasicAuth . new(config , default = Config :: BasicAuth) -> WEBrick :: HTTPAuth :: BasicAuth (18.0) -
BasicAuth オブジェクトを生成します。config は設定を保存したハッシュです。
...ハッシュです。
config で有効なハッシュキーは以下の通りです。
:Realm =>
:UserDB =>
:Logger =>
:AutoReloadUserDB =>
realm を表す文字列 :Realm には与えます。:UserDB
には WEBrick::HTTPAuth::Htpasswd オブジェクトを与... -
WEBrick
:: HTTPAuth :: DigestAuth (18.0) -
HTTP の Digest 認証のためのクラスです。
...。
2617 も参照してください。
例:
require 'webrick'
config = { :Realm => 'DigestAuth example realm' }
htdigest = WEBrick::HTTPAuth::Htdigest.new 'my_password_file'
htdigest.set_passwd config[:Realm], 'username', 'password'
htdigest.flush
config[:UserDB] = htdigest
diges... -
WEBrick
:: HTTPAuth :: Htdigest (12.0) -
Apache の htdigest 互換のクラス。
...クラス。
例
require 'webrick'
include WEBrick
htd = HTTPAuth::Htdigest.new('dot.htdigest')
htd.set_passwd('realm', 'username', 'supersecretpass')
htd.flush
htd2 = HTTPAuth::Htdigest.new('dot.htdigest')
p htd2.get_passwd('realm', 'username', false) == '65fe03e5b0a199462186848cc7fda42b'... -
WEBrick
:: HTTPAuth :: DigestAuth . new(config , default = WEBrick :: Config :: DigestAuth) -> WEBrick :: HTTPAuth :: DigestAuth (6.0) -
自身を初期化します。
...一のインスタンスを使用してください。
@param config 設定を保持しているハッシュを指定します。
:Realm と :UserDB は必ず指定しなければなりません。
@param default デフォルトは WEBrick::Config::DigestAuth です。
@see WEBrick:... -
WEBrick
:: HTTPProxyServer . new(config , default = WEBrick :: Config :: HTTP) -> WEBrick :: HTTPProxyServer (6.0) -
プロクシオブジェクトを生成して返します。
...webrick'
require 'webrick/httpproxy'
auth_proc = proc{|req, res|
unless c = req['proxy-authorization']
res['Proxy-Authenticate'] = 'Basic realm="WEBrick Proxy"'
raise WEBrick::HTTPStatus::ProxyAuthenticationRequired
else
# 略
end
}
s = WEBrick::HTTPProxyServer.new(ProxyA...