diff --git a/adminapi/src/main/java/io/minio/admin/MinioAdminClient.java b/adminapi/src/main/java/io/minio/admin/MinioAdminClient.java index 622e0e4cd..2c0367546 100644 --- a/adminapi/src/main/java/io/minio/admin/MinioAdminClient.java +++ b/adminapi/src/main/java/io/minio/admin/MinioAdminClient.java @@ -681,6 +681,7 @@ private Map buildServiceAccount( * @param policy Policy as JSON string . * @param name Service account name. * @param expiryTime Expiry time , Example : 2023-12-02T15:04:05Z. + * @return Service account info for the specified accessKey. * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. * @throws IOException thrown to indicate I/O error on MinIO REST operation. @@ -754,12 +755,13 @@ public Credentials addServiceAccount( * @param newName New service account name. * @param newDescription New description. * @param newExpiration New expiry time , Example : 2023-12-02T15:04:05Z. + * @return Service account info for the specified accessKey. * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. * @throws IOException thrown to indicate I/O error on MinIO REST operation. * @throws InvalidCipherTextException thrown to indicate data cannot be encrypted/decrypted. */ - public void updateServiceAccount( + public Credentials updateServiceAccount( @Nullable String newName, @Nullable String newSecretKey, @Nullable String accessKey, @@ -800,7 +802,9 @@ public void updateServiceAccount( newPolicy, newDescription, true, - newExpiration))))) {} + newExpiration))))) { + return new Credentials(accessKey, newSecretKey, null, ResponseDate.fromString(newExpiration)); + } } /**