るりまサーチ

最速Rubyリファレンスマニュアル検索!
66件ヒット [1-66件を表示] (0.175秒)
トップページ > クエリ:i[x] > クエリ:h[x] > クエリ:HTTPAuth[x] > クエリ:realm[x] > クエリ:new[x]

別のキーワード

  1. _builtin to_h
  2. enumerable to_h
  3. hash to_h
  4. array to_h
  5. openstruct to_h

検索結果

WEBrick::HTTPAuth::BasicAuth.new(config, default = Config::BasicAuth) -> WEBrick::HTTPAuth::BasicAuth (30532.0)

BasicAuth オブジェクトを生成します。config は設定を保存したハッシュです。

...BasicAuth オブジェクトを生成します。config は設定を保存したハッシュです。

config で有効なハッシュキーは以下の通りです。

:Realm =>
:UserDB =>
:Logger =>
:AutoReloadUserDB =>

realm
を表す文字列 :Realm には与...
...。:UserDB
には WEBrick::HTTPAuth::Htpasswd オブジェクトを与えます。:Logger には
ロガーオブジェクトを与えます。また、:AutoReloadUserDB には
WEBrick::HTTPAuth::Htpasswd#get_passwd の
reload_db に渡す引数を与えます。

@param config 設定を保持して...
...いるハッシュを指定します。

@param default デフォルトは WEBrick::Config::BasicAuth です。...

WEBrick::HTTPAuth::DigestAuth.new(config, default = WEBrick::Config::DigestAuth) -> WEBrick::HTTPAuth::DigestAuth (27708.0)

自身を初期化します。

...スを使用してください。

@param config 設定を保持しているハッシュを指定します。
:Realm と :UserDB は必ず指定しなければなりません。

@param default デフォルトは WEBrick::Config::DigestAuth です。

@see WEBrick::Config::DigestAuth...

WEBrick::HTTPProxyServer.new(config, default = WEBrick::Config::HTTP) -> WEBrick::HTTPProxyServer (24543.0)

プロクシオブジェクトを生成して返します。

...ます。

@param config 設定を保存したハッシュを指定します。
設定として有効なハッシュのキーとその値は WEBrick::HTTPServer.new と同じです。
それに加えて以下のキーが有効です。

: :ProxyAuthProc
プロクシ認...
...ません。nil を指定した場合すべての接続を
受け付けます。デフォルトは nil です。通常は WEBrick::HTTPAuth::ProxyBasicAuth
WEBrick::HTTPAuth::ProxyDigestAuth を使用します。
//emlist{
require 'webrick'
require 'webrick/httpproxy'
auth_proc = proc{|re...
...'proxy-authorization']
res['Proxy-Authenticate'] = 'Basic realm="WEBrick Proxy"'
raise WEBrick::HTTPStatus::ProxyAuthenticationRequired
else
# 略
end
}
s = WEBrick::HTTPProxyServer.new(ProxyAuthProc: auth_proc, Port: 8080)
//}
: :ProxyContentHandler
接続先の HTTP サー...

WEBrick::HTTPAuth::BasicAuth (18054.0)

HTTP の Basic 認証のためのクラスです。

...HTTP の Basic 認証のためのクラスです。



require 'webrick'
realm
= "WEBrick's realm"
srv = WEBrick::HTTPServer.new({ :BindAddress => '127.0.0.1', :Port => 10080})

h
tpd = WEBrick::HTTPAuth::Htpasswd.new('dot.htpasswd')
h
tpd.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::Htdigest (18036.0)

Apache の htdigest 互換のクラス。

...Apache の htdigest 互換のクラス。



require 'webrick'
i
nclude WEBrick
h
td = HTTPAuth::Htdigest.new('dot.htdigest')
h
td.set_passwd('realm', 'username', 'supersecretpass')
h
td.flush
h
td2 = HTTPAuth::Htdigest.new('dot.htdigest')
p htd2.get_passwd('realm', 'username', false) == '65fe0...

絞り込み条件を変える

WEBrick::HTTPAuth::DigestAuth (15048.0)

HTTP の Digest 認証のためのクラスです。

...HTTP の Digest 認証のためのクラスです。

2617 も参照してください。

例:
require 'webrick'
config = { :Realm => 'DigestAuth example realm' }

h
tdigest = WEBrick::HTTPAuth::Htdigest.new 'my_password_file'
h
tdigest.set_passwd config[:Realm], 'username', 'password'
h
tdi...
...gest.flush

config[:UserDB] = htdigest

digest_auth = WEBrick::HTTPAuth::DigestAuth.new config

サーブレットの initialize メソッドの中でこのクラスのインスタンスを作成
しないようにしてください。デフォルトでは WEBrick はリクエストのたびに...
...サー
ブレットのインスタンスを生成しますが、
WEBrick::HTTPAuth::DigestAuth のオブジェクトはリクエストをまたい
で利用しなければならないためです。...