|
| 1 | +module WEBrick |
| 2 | + module HTTPAuth |
| 3 | + class DigestAuth |
| 4 | + @config: Hash[Symbol, untyped] |
| 5 | + |
| 6 | + @domain: Array[String]? |
| 7 | + |
| 8 | + @use_opaque: bool |
| 9 | + |
| 10 | + @use_next_nonce: bool |
| 11 | + |
| 12 | + @check_nc: bool |
| 13 | + |
| 14 | + @use_auth_info_header: bool |
| 15 | + |
| 16 | + @nonce_expire_period: Integer |
| 17 | + |
| 18 | + @nonce_expire_delta: Integer |
| 19 | + |
| 20 | + @internet_explorer_hack: bool |
| 21 | + |
| 22 | + @h: singleton(Digest::Base) |
| 23 | + |
| 24 | + @instance_key: String |
| 25 | + |
| 26 | + @opaques: Hash[String, OpaqueInfo] |
| 27 | + |
| 28 | + @last_nonce_expire: Time |
| 29 | + |
| 30 | + @mutex: Thread::Mutex |
| 31 | + |
| 32 | + include Authenticator |
| 33 | + |
| 34 | + AuthScheme: String |
| 35 | + |
| 36 | + class OpaqueInfo < Struct[untyped] |
| 37 | + attr_accessor time(): Time |
| 38 | + attr_accessor nonce(): String? |
| 39 | + attr_accessor nc(): String |
| 40 | + end |
| 41 | + |
| 42 | + attr_reader algorithm: String? |
| 43 | + |
| 44 | + attr_reader qop: Array[String] |
| 45 | + |
| 46 | + def self.make_passwd: (String realm, String user, String pass) -> untyped |
| 47 | + |
| 48 | + def initialize: (Hash[Symbol, untyped] config, ?Hash[Symbol, untyped] default) -> void |
| 49 | + |
| 50 | + def authenticate: (HTTPRequest req, HTTPResponse res) -> void |
| 51 | + |
| 52 | + def challenge: (HTTPRequest req, HTTPResponse res, ?bool stale) -> bot |
| 53 | + |
| 54 | + private |
| 55 | + |
| 56 | + MustParams: Array[String] |
| 57 | + |
| 58 | + MustParamsAuth: Array[String] |
| 59 | + |
| 60 | + def _authenticate: (HTTPRequest req, HTTPResponse res) -> (:nonce_is_stale | bool) |
| 61 | + |
| 62 | + def split_param_value: (String string) -> Hash[String, String] |
| 63 | + |
| 64 | + def generate_next_nonce: (HTTPRequest req) -> String |
| 65 | + |
| 66 | + def check_nonce: (HTTPRequest req, Hash[String, String] auth_req) -> bool |
| 67 | + |
| 68 | + def generate_opaque: (HTTPRequest req) -> String |
| 69 | + |
| 70 | + def check_opaque: (OpaqueInfo opaque_struct, untyped req, Hash[String, String] auth_req) -> bool |
| 71 | + |
| 72 | + def check_uri: (HTTPRequest req, Hash[String, String] auth_req) -> bool |
| 73 | + |
| 74 | + def hexdigest: (*_ToS? args) -> String |
| 75 | + end |
| 76 | + |
| 77 | + class ProxyDigestAuth < DigestAuth |
| 78 | + include ProxyAuthenticator |
| 79 | + |
| 80 | + private |
| 81 | + |
| 82 | + def check_uri: (HTTPRequest req, Hash[String, String] auth_req) -> true |
| 83 | + end |
| 84 | + end |
| 85 | +end |
0 commit comments