Skip to content

Commit b441b01

Browse files
committed
Remove deprecated API for removal.
Closes gh-729
1 parent 800730f commit b441b01

File tree

12 files changed

+19
-194
lines changed

12 files changed

+19
-194
lines changed

spring-vault-core/src/main/java/org/springframework/vault/authentication/AppIdAuthentication.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
* ID</a>
4040
* @deprecated since 2.2. Use {@link AppRoleAuthentication}.
4141
*/
42-
@Deprecated
42+
@Deprecated(since = "2.2", forRemoval = true)
4343
public class AppIdAuthentication implements ClientAuthentication, AuthenticationStepsFactory {
4444

4545
private static final Log logger = LogFactory.getLog(AppIdAuthentication.class);

spring-vault-core/src/main/java/org/springframework/vault/authentication/AppIdAuthenticationOptions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
* @see #builder()
3131
* @deprecated since 2.2. Use {@link AppRoleAuthentication}.
3232
*/
33-
@Deprecated
33+
@Deprecated(since = "2.2", forRemoval = true)
3434
public class AppIdAuthenticationOptions {
3535

3636
public static final String DEFAULT_APPID_AUTHENTICATION_PATH = "app-id";

spring-vault-core/src/main/java/org/springframework/vault/authentication/AppIdUserIdMechanism.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* @see AppIdAuthentication
2525
* @deprecated since 2.2. Use {@link AppRoleAuthentication}.
2626
*/
27-
@Deprecated
27+
@Deprecated(since = "2.2", forRemoval = true)
2828
@FunctionalInterface
2929
public interface AppIdUserIdMechanism {
3030

spring-vault-core/src/main/java/org/springframework/vault/authentication/AppRoleAuthenticationOptions.java

Lines changed: 7 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -65,24 +65,14 @@ public class AppRoleAuthenticationOptions {
6565
*/
6666
private final UnwrappingEndpoints unwrappingEndpoints;
6767

68-
/**
69-
* Token associated for pull mode (retrieval of secretId/roleId).
70-
* @deprecated since 2.0, use {@link RoleId#pull(VaultToken)}/
71-
* {@link SecretId#pull(VaultToken)} to configure pull mode for roleId/secretId.
72-
*/
73-
@Nullable
74-
@Deprecated
75-
private final VaultToken initialToken;
76-
7768
private AppRoleAuthenticationOptions(String path, RoleId roleId, SecretId secretId, @Nullable String appRole,
78-
UnwrappingEndpoints unwrappingEndpoints, @Nullable VaultToken initialToken) {
69+
UnwrappingEndpoints unwrappingEndpoints) {
7970

8071
this.path = path;
8172
this.roleId = roleId;
8273
this.secretId = secretId;
8374
this.appRole = appRole;
8475
this.unwrappingEndpoints = unwrappingEndpoints;
85-
this.initialToken = initialToken;
8676
}
8777

8878
/**
@@ -130,18 +120,6 @@ public UnwrappingEndpoints getUnwrappingEndpoints() {
130120
return this.unwrappingEndpoints;
131121
}
132122

133-
/**
134-
* @return the initial token for roleId/secretId retrieval in pull mode.
135-
* @since 1.1
136-
* @deprecated since 2.0, use {@link #getRoleId()}/{@link #getSecretId()} to obtain
137-
* configuration modes (pull/wrapped) for an AppRole token.
138-
*/
139-
@Nullable
140-
@Deprecated
141-
public VaultToken getInitialToken() {
142-
return this.initialToken;
143-
}
144-
145123
/**
146124
* Builder for {@link AppRoleAuthenticationOptions}.
147125
*/
@@ -166,10 +144,6 @@ public static class AppRoleAuthenticationOptionsBuilder {
166144

167145
private UnwrappingEndpoints unwrappingEndpoints = UnwrappingEndpoints.SysWrapping;
168146

169-
@Nullable
170-
@Deprecated
171-
private VaultToken initialToken;
172-
173147
AppRoleAuthenticationOptionsBuilder() {
174148
}
175149

@@ -201,22 +175,6 @@ public AppRoleAuthenticationOptionsBuilder roleId(RoleId roleId) {
201175
return this;
202176
}
203177

204-
/**
205-
* Configure the RoleId.
206-
* @param roleId must not be empty or {@literal null}.
207-
* @return {@code this} {@link AppRoleAuthenticationOptionsBuilder}.
208-
* @deprecated since 2.0, use
209-
* {@link #roleId(AppRoleAuthenticationOptions.RoleId)}.
210-
*/
211-
@Deprecated
212-
public AppRoleAuthenticationOptionsBuilder roleId(String roleId) {
213-
214-
Assert.hasText(roleId, "RoleId must not be empty");
215-
216-
this.providedRoleId = roleId;
217-
return this;
218-
}
219-
220178
/**
221179
* Configure a {@code secretId}.
222180
* @param secretId must not be empty or {@literal null}.
@@ -231,22 +189,6 @@ public AppRoleAuthenticationOptionsBuilder secretId(SecretId secretId) {
231189
return this;
232190
}
233191

234-
/**
235-
* Configure a {@code secretId}.
236-
* @param secretId must not be empty or {@literal null}.
237-
* @return {@code this} {@link AppRoleAuthenticationOptionsBuilder}.
238-
* @deprecated since 2.0, use
239-
* {@link #secretId(AppRoleAuthenticationOptions.SecretId)}.
240-
*/
241-
@Deprecated
242-
public AppRoleAuthenticationOptionsBuilder secretId(String secretId) {
243-
244-
Assert.hasText(secretId, "SecretId must not be empty");
245-
246-
this.providedSecretId = secretId;
247-
return this;
248-
}
249-
250192
/**
251193
* Configure a {@code appRole}.
252194
* @param appRole must not be empty or {@literal null}.
@@ -275,28 +217,10 @@ public AppRoleAuthenticationOptionsBuilder unwrappingEndpoints(UnwrappingEndpoin
275217
return this;
276218
}
277219

278-
/**
279-
* Configure a {@code initialToken}.
280-
* @param initialToken must not be empty or {@literal null}.
281-
* @return {@code this} {@link AppRoleAuthenticationOptionsBuilder}.
282-
* @since 1.1
283-
* @deprecated since 2.0, use
284-
* {@link #roleId(AppRoleAuthenticationOptions.RoleId)}/{@link #secretId(AppRoleAuthenticationOptions.SecretId)}
285-
* to configure pull mode.
286-
*/
287-
@Deprecated
288-
public AppRoleAuthenticationOptionsBuilder initialToken(VaultToken initialToken) {
289-
290-
Assert.notNull(initialToken, "InitialToken must not be null");
291-
292-
this.initialToken = initialToken;
293-
return this;
294-
}
295-
296220
/**
297221
* Build a new {@link AppRoleAuthenticationOptions} instance. Requires
298-
* {@link #roleId(String)} for push mode or {@link #appRole(String)} and
299-
* {@link #initialToken(VaultToken)} for pull mode to be configured.
222+
* {@link #roleId(RoleId)} for push mode or {@link #appRole(String)} and
223+
* {@link #secretId SecretId.pull(VaultToken)} for pull mode to be configured.
300224
* @return a new {@link AppRoleAuthenticationOptions}.
301225
*/
302226
public AppRoleAuthenticationOptions build() {
@@ -308,25 +232,16 @@ public AppRoleAuthenticationOptions build() {
308232
if (this.providedSecretId != null) {
309233
secretId(SecretId.provided(this.providedSecretId));
310234
}
311-
else if (this.initialToken != null) {
312-
secretId(SecretId.pull(this.initialToken));
313-
}
314235
else {
315236
secretId(SecretId.absent());
316237
}
317238
}
318239

319240
if (this.roleId == null) {
320241

321-
if (this.providedRoleId != null) {
322-
roleId(RoleId.provided(this.providedRoleId));
323-
}
324-
else {
325-
326-
Assert.notNull(this.initialToken,
327-
"AppRole authentication configured for pull mode. InitialToken must not be null (pull mode)");
328-
roleId(RoleId.pull(this.initialToken));
329-
}
242+
Assert.notNull(this.providedRoleId,
243+
"AppRole authentication configured for pull mode. Role Identifier must be provided.");
244+
roleId(RoleId.provided(this.providedRoleId));
330245
}
331246

332247
if (this.roleId instanceof Pull || this.secretId instanceof Pull) {
@@ -335,7 +250,7 @@ else if (this.initialToken != null) {
335250
}
336251

337252
return new AppRoleAuthenticationOptions(this.path, this.roleId, this.secretId, this.appRole,
338-
this.unwrappingEndpoints, this.initialToken);
253+
this.unwrappingEndpoints);
339254
}
340255

341256
}

spring-vault-core/src/main/java/org/springframework/vault/authentication/AwsIamAuthenticationOptions.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -138,17 +138,6 @@ public String getServerId() {
138138
return this.serverId;
139139
}
140140

141-
/**
142-
* @return Server name to mitigate risk of replay attacks, preferably set to Vault
143-
* server's DNS name, may be {@literal null}.
144-
* @deprecated since 2.0, renamed to {@link #getServerId()}.
145-
*/
146-
@Nullable
147-
@Deprecated
148-
public String getServerName() {
149-
return this.serverId;
150-
}
151-
152141
/**
153142
* @return STS server URI.
154143
*/

spring-vault-core/src/main/java/org/springframework/vault/authentication/GcpIamAuthentication.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
* projects.serviceAccounts.signJwt</a>
6969
* @deprecated since 2.3.2, use {@link GcpIamCredentialsAuthentication} instead.
7070
*/
71-
@Deprecated
71+
@Deprecated(since = "2.3.2", forRemoval = true)
7272
public class GcpIamAuthentication extends GcpJwtAuthenticationSupport implements ClientAuthentication {
7373

7474
private static final String SCOPE = "https://www.googleapis.com/auth/iam";

spring-vault-core/src/main/java/org/springframework/vault/authentication/GcpIamAuthenticationOptions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
* @since 2.1
3939
* @deprecated since 2.3.2
4040
*/
41-
@Deprecated
41+
@Deprecated(since = "2.3.2", forRemoval = true)
4242
public class GcpIamAuthenticationOptions extends GcpIamAuthenticationSupport {
4343

4444
public static final String DEFAULT_GCP_AUTHENTICATION_PATH = "gcp";

spring-vault-core/src/main/java/org/springframework/vault/support/Policy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ public enum BuiltinCapabilities implements Capability {
548548
* {@link #CREATE} and {@link #UPDATE}.
549549
* @deprecated since 2.3 and Vault 0.5.
550550
*/
551-
@Deprecated
551+
@Deprecated(since = "2.3")
552552
WRITE,
553553

554554
/**

spring-vault-core/src/main/java/org/springframework/vault/support/SslConfiguration.java

Lines changed: 0 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -68,25 +68,6 @@ public class SslConfiguration {
6868

6969
private final List<String> enabledCipherSuites;
7070

71-
/**
72-
* Create a new {@link SslConfiguration} with the default {@link KeyStore} type.
73-
* @param keyStore the key store resource, must not be {@literal null}.
74-
* @param keyStorePassword the key store password.
75-
* @param trustStore the trust store resource, must not be {@literal null}.
76-
* @param trustStorePassword the trust store password.
77-
* @deprecated Since 1.1, use
78-
* {@link #SslConfiguration(KeyStoreConfiguration, KeyStoreConfiguration)} to prevent
79-
* {@link String} interning and retaining passwords represented as String longer from
80-
* GC than necessary.
81-
*/
82-
@Deprecated
83-
public SslConfiguration(Resource keyStore, @Nullable String keyStorePassword, Resource trustStore,
84-
@Nullable String trustStorePassword) {
85-
86-
this(new KeyStoreConfiguration(keyStore, charsOrNull(keyStorePassword), DEFAULT_KEYSTORE_TYPE),
87-
new KeyStoreConfiguration(trustStore, charsOrNull(trustStorePassword), DEFAULT_KEYSTORE_TYPE));
88-
}
89-
9071
/**
9172
* Create a new {@link SslConfiguration}.
9273
* @param keyStoreConfiguration the key store configuration, must not be
@@ -174,23 +155,6 @@ public SslConfiguration(KeyStoreConfiguration keyStoreConfiguration, KeyStoreCon
174155
enabledCipherSuites);
175156
}
176157

177-
/**
178-
* Create a new {@link SslConfiguration} for the given trust store with the default
179-
* {@link KeyStore} type.
180-
* @param trustStore resource pointing to an existing trust store, must not be
181-
* {@literal null}.
182-
* @param trustStorePassword may be {@literal null}.
183-
* @return the created {@link SslConfiguration}.
184-
* @see java.security.KeyStore
185-
* @deprecated Since 1.1, use {@link #forTrustStore(Resource, char[])} to prevent
186-
* {@link String} interning and retaining passwords represented as String longer from
187-
* GC than necessary.
188-
*/
189-
@Deprecated
190-
public static SslConfiguration forTrustStore(Resource trustStore, @Nullable String trustStorePassword) {
191-
return forTrustStore(trustStore, charsOrNull(trustStorePassword));
192-
}
193-
194158
/**
195159
* Create a new {@link SslConfiguration} for the given trust store with the default
196160
* {@link KeyStore} type.
@@ -222,23 +186,6 @@ public static SslConfiguration forTrustStore(KeyStoreConfiguration trustStore) {
222186
return unconfigured().withTrustStore(trustStore);
223187
}
224188

225-
/**
226-
* Create a new {@link SslConfiguration} for the given key store with the default
227-
* {@link KeyStore} type.
228-
* @param keyStore resource pointing to an existing key store, must not be
229-
* {@literal null}.
230-
* @param keyStorePassword may be {@literal null}.
231-
* @return the created {@link SslConfiguration}.
232-
* @see java.security.KeyStore
233-
* @deprecated Since 1.1, use {@link #forKeyStore(Resource, char[])} to prevent
234-
* {@link String} interning and retaining passwords represented as String longer from
235-
* GC than necessary.
236-
*/
237-
@Deprecated
238-
public static SslConfiguration forKeyStore(Resource keyStore, @Nullable String keyStorePassword) {
239-
return forKeyStore(keyStore, charsOrNull(keyStorePassword));
240-
}
241-
242189
/**
243190
* Create a new {@link SslConfiguration} for the given key store with the default
244191
* {@link KeyStore} type.
@@ -304,27 +251,6 @@ public static SslConfiguration forKeyStore(Resource keyStore, @Nullable char[] k
304251
keyConfiguration, KeyStoreConfiguration.unconfigured());
305252
}
306253

307-
/**
308-
* Create a new {@link SslConfiguration} for the given truststore with the default
309-
* {@link KeyStore} type.
310-
* @param keyStore resource pointing to an existing keystore, must not be
311-
* {@literal null}.
312-
* @param keyStorePassword may be {@literal null}.
313-
* @param trustStore resource pointing to an existing trust store, must not be
314-
* {@literal null}.
315-
* @param trustStorePassword may be {@literal null}.
316-
* @return the created {@link SslConfiguration}.
317-
* @see java.security.KeyStore
318-
* @deprecated Since 1.1, use {@link #create(Resource, char[], Resource, char[])} to
319-
* prevent {@link String} interning and retaining passwords represented as String
320-
* longer from GC than necessary.
321-
*/
322-
@Deprecated
323-
public SslConfiguration create(Resource keyStore, @Nullable String keyStorePassword, Resource trustStore,
324-
@Nullable String trustStorePassword) {
325-
return create(keyStore, charsOrNull(keyStorePassword), trustStore, charsOrNull(trustStorePassword));
326-
}
327-
328254
/**
329255
* Create a new {@link SslConfiguration} for the given truststore with the default
330256
* {@link KeyStore} type.

spring-vault-core/src/main/java/org/springframework/vault/support/VaultSignRequest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public String getSignatureAlgorithm() {
8989
* default algorithm.
9090
* @deprecated since 2.4, use {@link #getSignatureAlgorithm()} instead.
9191
*/
92-
@Deprecated
92+
@Deprecated(since = "2.4")
9393
@Nullable
9494
public String getAlgorithm() {
9595
return getSignatureAlgorithm();
@@ -159,7 +159,7 @@ public VaultSignRequestBuilder signatureAlgorithm(String signatureAlgorithm) {
159159
* @return {@code this} {@link VaultSignRequestBuilder}.
160160
* @deprecated since 2.4, use {@link #signatureAlgorithm(String)} instead.
161161
*/
162-
@Deprecated
162+
@Deprecated(since = "2.4")
163163
public VaultSignRequestBuilder algorithm(String algorithm) {
164164
return signatureAlgorithm(algorithm);
165165
}

0 commit comments

Comments
 (0)