Module | OAuth::Helper |
In: |
lib/oauth/helper.rb
|
Escape value by URL encoding all non-reserved character.
See Also: OAuth core spec version 1.0, section 5.1
Generate a random key of up to size bytes. The value returned is Base64 encoded with non-word characters removed.
Normalize a Hash of parameter values. Parameters are sorted by name, using lexicographical byte value ordering. If two or more parameters share the same name, they are sorted by their value. Parameters are concatenated in their sorted order into a single string. For each parameter, the name is separated from the corresponding value by an "=" character, even if the value is empty. Each name-value pair is separated by an "&" character.
Parse an Authorization / WWW-Authenticate header into a hash. Takes care of unescaping and removing surrounding quotes. Raises a OAuth::Problem if the header is not parsable into a valid hash. Does not validate the keys or values.
hash = parse_header(headers['Authorization'] || headers['WWW-Authenticate']) hash['oauth_timestamp'] #=>"1234567890"