File tree Expand file tree Collapse file tree 3 files changed +41
-0
lines changed
main/java/com/github/dockerjava/api/model
java/com/github/dockerjava/api/model
resources/samples/1.23/other/AuthConfig Expand file tree Collapse file tree 3 files changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,12 @@ public class AuthConfig implements Serializable {
4242 @ JsonProperty ("registrytoken" )
4343 private String registrytoken ;
4444
45+ /**
46+ * @since {@link com.github.dockerjava.core.RemoteApiVersion#VERSION_1_23}
47+ */
48+ @ JsonProperty ("identitytoken" )
49+ private String identitytoken ;
50+
4551 public String getUsername () {
4652 return username ;
4753 }
@@ -87,6 +93,20 @@ public AuthConfig withAuth(String auth) {
8793 return this ;
8894 }
8995
96+ /**
97+ * @see #identitytoken
98+ */
99+ public String getIdentitytoken () {
100+ return identitytoken ;
101+ }
102+ /**
103+ * @see #identitytoken
104+ */
105+ public AuthConfig withIdentityToken (String identitytoken ) {
106+ this .identitytoken = identitytoken ;
107+ return this ;
108+ }
109+
90110 /**
91111 * @see #registrytoken
92112 */
Original file line number Diff line number Diff line change @@ -61,4 +61,21 @@ public void serderDocs2() throws IOException {
6161
6262 assertThat (authConfig1 , equalTo (authConfig ));
6363 }
64+
65+ @ Test
66+ public void compatibleWithIdentitytoken () throws IOException {
67+ final ObjectMapper mapper = new ObjectMapper ();
68+ final JavaType type = mapper .getTypeFactory ().uncheckedSimpleType (AuthConfig .class );
69+ final AuthConfig authConfig = testRoundTrip (RemoteApiVersion .VERSION_1_23 ,
70+ "/other/AuthConfig/docs1.json" ,
71+ type
72+ );
73+ String auth = "YWRtaW46" ;
74+ String identitytoken = "1cba468e-8cbe-4c55-9098-2c2ed769e885" ;
75+ assertThat (authConfig , notNullValue ());
76+ assertThat (authConfig .getAuth (), is (auth ));
77+ assertThat (authConfig .getIdentitytoken (), is (identitytoken ));
78+ final AuthConfig authConfig1 = new AuthConfig ().withAuth (auth ).withIdentityToken (identitytoken );
79+ assertThat (authConfig1 , equalTo (authConfig ));
80+ }
6481}
Original file line number Diff line number Diff line change 1+ {
2+ "auth" : " YWRtaW46" ,
3+ "identitytoken" : " 1cba468e-8cbe-4c55-9098-2c2ed769e885"
4+ }
You can’t perform that action at this time.
0 commit comments