Digest authorizer is a stateful entity that maintains the state from previous challenges and calculates the digest according to RFC.
| RCOLON | = | /: / |
| SCOLON | = | /;/ |
| NUMERIC_CSEQ | = | /\d+\s?/ |
| SUCC_RANGE | = | 200..299 |
| RPROV_RANGE | = | 101..199 |
| BOOL_MAP | = | { :true=>true, :false=>false } |
Converts the given file name into a well formed classname. Assumes that file names are underscore separated and class names are camel case -4 to remove .rb
does reverse of classify, i.e generates a filename compliant with Ruby conventions from a class name.
Returns true of the named parameter is present, false otherwise. Can be used for valueless parameter like "lr" matching a string not a header. For a Header object we can check using the hash access Header.has_key?
Takes a hash and populates the instance variables of the name as keys and value as hash values eg. hash = {:b=>2, :a=>1} results in the population of the instance variables "b" and "a" to 2 and 1 respectively in the object obj.
converts the header names like p_asserted_identity to P-Asserted_Identity. — Here is an ugly handling for WWW-Authenticate header todo fix this and also Call-ID handling, as Call-Id is valid yet some tools such as sipp does not handle it. ++
take the expectaion string like "< INVITE, > 100 {2,}, > 200" and returns "< INVITE% > 100 {2,}% > 200". Such that it can be split without any ambiguity.
If there are parameters then returns them in a hash with header value. Takes full header and also just separated params and returns the array with header value and params hash. with "My-Header: myvalue" returns ["myvalue", {}] with "My-Header: myvalue;a=1;b=2" returns ["myvalue", {"a"=>"1", "b"=>"2"}] with "a=1;b=2" returns [nil, {"a"=>"1", "b"=>"2"}]
Takes a string or a primitive array and prints it in the standard array form and returns a string that is properly formatted ruby style array code eg. ["a", "b", "c"], with elements as strings.