File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed
src/main/java/com/github/dockerjava Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change 8
8
import com .github .dockerjava .core .InvocationBuilder ;
9
9
import com .github .dockerjava .core .RemoteApiVersion ;
10
10
import com .github .dockerjava .core .WebTarget ;
11
- import org . apache . commons . codec . binary . Base64 ;
11
+ import com . google . common . io . BaseEncoding ;
12
12
13
13
import javax .annotation .CheckForNull ;
14
14
import javax .annotation .Nonnull ;
@@ -42,7 +42,7 @@ protected AuthConfigurations getBuildAuthConfigs() {
42
42
43
43
protected String registryAuth (@ Nonnull AuthConfig authConfig ) {
44
44
try {
45
- return Base64 . encodeBase64String (new ObjectMapper ().writeValueAsString (authConfig ).getBytes ());
45
+ return BaseEncoding . base64Url (). encode (new ObjectMapper ().writeValueAsString (authConfig ).getBytes ());
46
46
} catch (IOException e ) {
47
47
throw new RuntimeException (e );
48
48
}
@@ -65,8 +65,7 @@ protected String registryConfigs(@Nonnull AuthConfigurations authConfigs) {
65
65
} else {
66
66
json = objectMapper .writeValueAsString (authConfigs );
67
67
}
68
-
69
- return Base64 .encodeBase64String (json .getBytes ());
68
+ return BaseEncoding .base64Url ().encode (json .getBytes ());
70
69
} catch (IOException e ) {
71
70
throw new RuntimeException (e );
72
71
}
Original file line number Diff line number Diff line change 6
6
import com .github .dockerjava .api .model .AuthConfigurations ;
7
7
import com .github .dockerjava .core .DockerClientConfig ;
8
8
import com .github .dockerjava .core .RemoteApiVersion ;
9
- import org . apache . commons . codec . binary . Base64 ;
9
+ import com . google . common . io . BaseEncoding ;
10
10
11
11
import javax .ws .rs .client .Invocation ;
12
12
import javax .ws .rs .client .WebTarget ;
@@ -39,7 +39,7 @@ protected AuthConfigurations getBuildAuthConfigs() {
39
39
40
40
protected String registryAuth (AuthConfig authConfig ) {
41
41
try {
42
- return Base64 . encodeBase64String (new ObjectMapper ().writeValueAsString (authConfig ).getBytes ());
42
+ return BaseEncoding . base64Url (). encode (new ObjectMapper ().writeValueAsString (authConfig ).getBytes ());
43
43
} catch (IOException e ) {
44
44
throw new RuntimeException (e );
45
45
}
@@ -74,7 +74,7 @@ protected String registryConfigs(AuthConfigurations authConfigs) {
74
74
json = objectMapper .writeValueAsString (authConfigs );
75
75
}
76
76
77
- return Base64 . encodeBase64String (json .getBytes ());
77
+ return BaseEncoding . base64Url (). encode (json .getBytes ());
78
78
} catch (IOException e ) {
79
79
throw new RuntimeException (e );
80
80
}
You can’t perform that action at this time.
0 commit comments