Skip to content

Commit 97f4827

Browse files
authored
Merge pull request docker-java#727 from Baqend/new-auth-config
implement new docker config file format for authentication
2 parents 03c4586 + b05b1bb commit 97f4827

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+750
-550
lines changed

src/main/java/com/github/dockerjava/api/DockerClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ public interface DockerClient extends Closeable {
236236

237237
TopContainerCmd topContainerCmd(String containerId);
238238

239-
TagImageCmd tagImageCmd(String imageId, String repository, String tag);
239+
TagImageCmd tagImageCmd(String imageId, String imageNameWithRepository, String tag);
240240

241241
PauseContainerCmd pauseContainerCmd(String containerId);
242242

src/main/java/com/github/dockerjava/api/command/AuthCmd.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
package com.github.dockerjava.api.command;
22

3-
import javax.annotation.CheckForNull;
4-
import javax.annotation.Nonnull;
5-
63
import com.github.dockerjava.api.exception.UnauthorizedException;
74
import com.github.dockerjava.api.model.AuthConfig;
85
import com.github.dockerjava.api.model.AuthResponse;
96

7+
import javax.annotation.CheckForNull;
8+
109
/**
1110
*
1211
* Authenticate with the server, useful for checking authentication.
@@ -17,7 +16,7 @@ public interface AuthCmd extends SyncDockerCmd<AuthResponse> {
1716
@CheckForNull
1817
AuthConfig getAuthConfig();
1918

20-
AuthCmd withAuthConfig(@Nonnull AuthConfig authConfig);
19+
AuthCmd withAuthConfig(AuthConfig authConfig);
2120

2221
/**
2322
* @return The status. Based on it's value you may mean you need to authorise your account, e.g.: "Account created. Please see the

src/main/java/com/github/dockerjava/api/command/CreateContainerCmd.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import com.github.dockerjava.api.exception.ConflictException;
44
import com.github.dockerjava.api.exception.NotFoundException;
5+
import com.github.dockerjava.api.model.AuthConfig;
56
import com.github.dockerjava.api.model.Bind;
67
import com.github.dockerjava.api.model.Capability;
78
import com.github.dockerjava.api.model.Device;
@@ -23,6 +24,9 @@
2324

2425
public interface CreateContainerCmd extends SyncDockerCmd<CreateContainerResponse> {
2526

27+
@CheckForNull
28+
AuthConfig getAuthConfig();
29+
2630
@CheckForNull
2731
List<String> getAliases();
2832

@@ -197,6 +201,14 @@ public interface CreateContainerCmd extends SyncDockerCmd<CreateContainerRespons
197201
@CheckForNull
198202
Boolean isTty();
199203

204+
/**
205+
* While using swarm classic, you can provide an optional auth config which will be used to pull images from a private registry,
206+
* if the swarm node does not already have the docker image.
207+
* Note: This option does not have any effect in normal docker
208+
* @param authConfig The optional auth config
209+
*/
210+
CreateContainerCmd withAuthConfig(AuthConfig authConfig);
211+
200212
/**
201213
* Add network-scoped alias for the container
202214
* @param aliases on ore more aliases

src/main/java/com/github/dockerjava/api/command/PullImageCmd.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package com.github.dockerjava.api.command;
22

3-
import javax.annotation.CheckForNull;
4-
import javax.annotation.Nonnull;
5-
63
import com.github.dockerjava.api.model.AuthConfig;
74
import com.github.dockerjava.api.model.PullResponseItem;
85

6+
import javax.annotation.CheckForNull;
7+
import javax.annotation.Nonnull;
8+
99
/**
1010
*
1111
* Pull image from repository.
@@ -22,6 +22,7 @@ public interface PullImageCmd extends AsyncDockerCmd<PullImageCmd, PullResponseI
2222
@CheckForNull
2323
String getRegistry();
2424

25+
@CheckForNull
2526
AuthConfig getAuthConfig();
2627

2728
PullImageCmd withRepository(@Nonnull String repository);

src/main/java/com/github/dockerjava/core/AuthConfigFile.java

Lines changed: 0 additions & 210 deletions
This file was deleted.

0 commit comments

Comments
 (0)