File tree Expand file tree Collapse file tree
src/main/java/com/github/dockerjava Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88import com .github .dockerjava .core .InvocationBuilder ;
99import com .github .dockerjava .core .RemoteApiVersion ;
1010import com .github .dockerjava .core .WebTarget ;
11- import org . apache . commons . codec . binary . Base64 ;
11+ import com . google . common . io . BaseEncoding ;
1212
1313import javax .annotation .CheckForNull ;
1414import javax .annotation .Nonnull ;
@@ -42,7 +42,7 @@ protected AuthConfigurations getBuildAuthConfigs() {
4242
4343 protected String registryAuth (@ Nonnull AuthConfig authConfig ) {
4444 try {
45- return Base64 . encodeBase64String (new ObjectMapper ().writeValueAsString (authConfig ).getBytes ());
45+ return BaseEncoding . base64Url (). encode (new ObjectMapper ().writeValueAsString (authConfig ).getBytes ());
4646 } catch (IOException e ) {
4747 throw new RuntimeException (e );
4848 }
@@ -65,8 +65,7 @@ protected String registryConfigs(@Nonnull AuthConfigurations authConfigs) {
6565 } else {
6666 json = objectMapper .writeValueAsString (authConfigs );
6767 }
68-
69- return Base64 .encodeBase64String (json .getBytes ());
68+ return BaseEncoding .base64Url ().encode (json .getBytes ());
7069 } catch (IOException e ) {
7170 throw new RuntimeException (e );
7271 }
Original file line number Diff line number Diff line change 66import com .github .dockerjava .api .model .AuthConfigurations ;
77import com .github .dockerjava .core .DockerClientConfig ;
88import com .github .dockerjava .core .RemoteApiVersion ;
9- import org . apache . commons . codec . binary . Base64 ;
9+ import com . google . common . io . BaseEncoding ;
1010
1111import javax .ws .rs .client .Invocation ;
1212import javax .ws .rs .client .WebTarget ;
@@ -39,7 +39,7 @@ protected AuthConfigurations getBuildAuthConfigs() {
3939
4040 protected String registryAuth (AuthConfig authConfig ) {
4141 try {
42- return Base64 . encodeBase64String (new ObjectMapper ().writeValueAsString (authConfig ).getBytes ());
42+ return BaseEncoding . base64Url (). encode (new ObjectMapper ().writeValueAsString (authConfig ).getBytes ());
4343 } catch (IOException e ) {
4444 throw new RuntimeException (e );
4545 }
@@ -74,7 +74,7 @@ protected String registryConfigs(AuthConfigurations authConfigs) {
7474 json = objectMapper .writeValueAsString (authConfigs );
7575 }
7676
77- return Base64 . encodeBase64String (json .getBytes ());
77+ return BaseEncoding . base64Url (). encode (json .getBytes ());
7878 } catch (IOException e ) {
7979 throw new RuntimeException (e );
8080 }
You can’t perform that action at this time.
0 commit comments