Skip to content

Commit 6962601

Browse files
author
RTLcoil
authored
Test: Ignore URL in AuthToken generation if ACL is provided (#431)
1 parent f249193 commit 6962601

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/unit/authToken/authTokenUtils_spec.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,18 @@ describe("AuthToken tests using utils.generate_auth_token", function () {
2727

2828
expect(token).to.eql("__cld_token__=st=222222222~exp=222222522~acl=%2f*%2ft_foobar~hmac=8e39600cc18cec339b21fe2b05fcb64b98de373355f8ce732c35710d8b10259f");
2929
});
30+
31+
it("should ignore URL in AuthToken generation if ACL is provided", function () {
32+
const token_options = {
33+
start_time: 222222222,
34+
key: "00112233FF99",
35+
duration: 300,
36+
acl: "/*/t_foobar"
37+
}
38+
const token = utils.generate_auth_token(token_options);
39+
40+
token_options.url = "http://res.cloudinary.com/test123/image/upload/v1486020273/sample.jpg";
41+
const token_with_url = utils.generate_auth_token(token_options);
42+
expect(token).to.eql(token_with_url)
43+
});
3044
});

0 commit comments

Comments
 (0)