File tree Expand file tree Collapse file tree 3 files changed +25
-14
lines changed
Expand file tree Collapse file tree 3 files changed +25
-14
lines changed Original file line number Diff line number Diff line change @@ -39,3 +39,17 @@ appengine-web.xml
3939
4040cloudinary-android-test /src /main /AndroidManifest.xml
4141
42+ # Maven
43+
44+ target /
45+ pom.xml.tag
46+ pom.xml.releaseBackup
47+ pom.xml.versionsBackup
48+ pom.xml.next
49+ release.properties
50+ dependency-reduced-pom.xml
51+ buildNumber.properties
52+ .mvn /timing.properties
53+
54+ # Avoid ignoring Maven wrapper jar file (.jar files are usually ignored)
55+ ! /.mvn /wrapper /maven-wrapper.jar
Original file line number Diff line number Diff line change @@ -22,15 +22,15 @@ public class AuthToken {
2222 * A null AuthToken, which can be passed to a method to override global settings.
2323 */
2424 public static final AuthToken NULL_AUTH_TOKEN = new AuthToken ().setNull ();
25- public static final String AUTH_TOKEN_NAME = "__cld_token__" ;
25+ private static final String AUTH_TOKEN_NAME = "__cld_token__" ;
2626
27- public String tokenName = AUTH_TOKEN_NAME ;
28- public String key ;
29- public long startTime ;
30- public long expiration ;
31- public String ip ;
32- public String acl ;
33- public long duration ;
27+ private String tokenName = AUTH_TOKEN_NAME ;
28+ private String key ;
29+ private long startTime ;
30+ private long expiration ;
31+ private String ip ;
32+ private String acl ;
33+ private long duration ;
3434 private boolean isNullToken = false ;
3535
3636 public AuthToken () {
Original file line number Diff line number Diff line change @@ -95,18 +95,15 @@ public void testAuthenticatedUrl() {
9595 @ Test
9696 public void testConfiguration () {
9797 cloudinary = new Cloudinary ("cloudinary://a:b@test123?load_strategies=false&auth_token[key]=aabbcc112233&auth_token[duration]=200" );
98-
99- assertEquals (cloudinary .config .authToken .key , "aabbcc112233" );
100- assertEquals (cloudinary .config .authToken .duration , 200 );
101-
98+ assertEquals (cloudinary .config .authToken , new AuthToken ("aabbcc112233" ).duration (200 ));
10299 }
103100
104101 @ Test
105102 public void testTokenGeneration (){
106103 AuthToken token = new AuthToken (KEY );
107- token .duration = 300 ;
104+ token .duration ( 300 ) ;
108105 String user = "foobar" ; // username taken from elsewhere
109- token .acl = "/*/t_" + user ;
106+ token .acl ( "/*/t_" + user ) ;
110107 token .startTime (222222222 ); // we can't rely on the default "now" value in tests
111108 String cookieToken = token .generate ();
112109 assertEquals ("__cld_token__=st=222222222~exp=222222522~acl=%2f*%2ft_foobar~hmac=8e39600cc18cec339b21fe2b05fcb64b98de373355f8ce732c35710d8b10259f" , cookieToken );
You can’t perform that action at this time.
0 commit comments