|
@@ -26,20 +26,20 @@ plaintext_signature_test_() -> [
|
|
|
?plaintext_signature_test("djr9rjt0jd78jf88", "", "djr9rjt0jd78jf88%26")
|
|
|
].
|
|
|
|
|
|
-hmac_normalize_test_() -> [
|
|
|
+normalize_test_() -> [
|
|
|
% cf. http://wiki.oauth.net/TestCases
|
|
|
- ?hmac_normalize_test("name=", [{name,undefined}]),
|
|
|
- ?hmac_normalize_test("a=b", [{a,b}]),
|
|
|
- ?hmac_normalize_test("a=b&c=d", [{a,b},{c,d}]),
|
|
|
- ?hmac_normalize_test("a=x%20y&a=x%21y", [{a,"x!y"},{a,"x y"}]),
|
|
|
- ?hmac_normalize_test("x=a&x%21y=a", [{"x!y",a},{x,a}])
|
|
|
+ ?normalize_test("name=", [{name,undefined}]),
|
|
|
+ ?normalize_test("a=b", [{a,b}]),
|
|
|
+ ?normalize_test("a=b&c=d", [{a,b},{c,d}]),
|
|
|
+ ?normalize_test("a=x%20y&a=x%21y", [{a,"x!y"},{a,"x y"}]),
|
|
|
+ ?normalize_test("x=a&x%21y=a", [{"x!y",a},{x,a}])
|
|
|
].
|
|
|
|
|
|
-hmac_base_string_test_() -> [
|
|
|
+base_string_test_() -> [
|
|
|
% cf. http://wiki.oauth.net/TestCases
|
|
|
- ?hmac_base_string_test("GET", "http://example.com/", [{n,v}], ["GET&http%3A%2F%2Fexample.com%2F&n%3Dv"]),
|
|
|
- ?hmac_base_string_test("GET", "http://example.com", [{n,v}], ["GET&http%3A%2F%2Fexample.com%2F&n%3Dv"]),
|
|
|
- ?hmac_base_string_test("POST", "https://photos.example.net/request_token", [
|
|
|
+ ?base_string_test("GET", "http://example.com/", [{n,v}], ["GET&http%3A%2F%2Fexample.com%2F&n%3Dv"]),
|
|
|
+ ?base_string_test("GET", "http://example.com", [{n,v}], ["GET&http%3A%2F%2Fexample.com%2F&n%3Dv"]),
|
|
|
+ ?base_string_test("POST", "https://photos.example.net/request_token", [
|
|
|
{oauth_version, "1.0"},
|
|
|
{oauth_consumer_key, "dpf43f3p2l4k3l03"},
|
|
|
{oauth_timestamp, "1191242090"},
|
|
@@ -50,7 +50,7 @@ hmac_base_string_test_() -> [
|
|
|
"%3Ddpf43f3p2l4k3l03%26oauth_nonce%3Dhsu94j3884jdopsl%26oauth_signature_method",
|
|
|
"%3DPLAINTEXT%26oauth_timestamp%3D1191242090%26oauth_version%3D1.0"
|
|
|
]),
|
|
|
- ?hmac_base_string_test("GET", "http://photos.example.net/photos", [
|
|
|
+ ?base_string_test("GET", "http://photos.example.net/photos", [
|
|
|
{file, "vacation.jpg"},
|
|
|
{size, "original"},
|
|
|
{oauth_version, "1.0"},
|