-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #1684: Update Client and Admin Console #1685
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,7 @@ | |
import io.getlime.core.rest.model.base.response.Response; | ||
import org.springframework.util.MultiValueMap; | ||
|
||
import java.time.Duration; | ||
import java.util.Date; | ||
import java.util.List; | ||
|
||
|
@@ -1154,16 +1155,19 @@ VaultUnlockResponse unlockVault(String activationId, String applicationKey, Stri | |
/** | ||
* Create a new callback URL with given parameters. | ||
* | ||
* @param applicationId Application ID. | ||
* @param name Callback URL display name. | ||
* @param type Callback type. | ||
* @param callbackUrl Callback URL value. | ||
* @param attributes Attributes to send in the callback data. | ||
* @param authentication Callback request authentication. | ||
* @param applicationId Application ID. | ||
* @param name Callback URL display name. | ||
* @param type Callback type. | ||
* @param callbackUrl Callback URL value. | ||
* @param attributes Attributes to send in the callback data. | ||
* @param authentication Callback request authentication. | ||
* @param retentionPeriod Duration after which a completed callback event is automatically removed. | ||
* @param initialBackoff Initial delay before retry attempt following a callback event failure. | ||
* @param maxAttempts Maximum number of attempts to send a callback event. | ||
* @return Information about new callback URL object. | ||
* @throws PowerAuthClientException In case REST API call fails. | ||
*/ | ||
CreateCallbackUrlResponse createCallbackUrl(String applicationId, String name, CallbackUrlType type, String callbackUrl, List<String> attributes, HttpAuthenticationPrivate authentication) throws PowerAuthClientException; | ||
CreateCallbackUrlResponse createCallbackUrl(String applicationId, String name, CallbackUrlType type, String callbackUrl, List<String> attributes, HttpAuthenticationPrivate authentication, Duration retentionPeriod, Duration initialBackoff, Integer maxAttempts) throws PowerAuthClientException; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
In long term, I prefer using methods with request object only and mark these as deprecated. |
||
|
||
/** | ||
* Update a callback URL with given request object. | ||
|
@@ -1188,16 +1192,20 @@ VaultUnlockResponse unlockVault(String activationId, String applicationKey, Stri | |
/** | ||
* Update a callback URL with given parameters. | ||
* | ||
* @param id Callback URL identifier. | ||
* @param applicationId Application ID. | ||
* @param name Callback URL display name. | ||
* @param callbackUrl Callback URL value. | ||
* @param attributes Attributes to send in the callback data. | ||
* @param authentication Callback request authentication. | ||
* @param id Callback URL identifier. | ||
* @param applicationId Application ID. | ||
* @param name Callback URL display name. | ||
* @param type Callback type. | ||
* @param callbackUrl Callback URL value. | ||
* @param attributes Attributes to send in the callback data. | ||
* @param authentication Callback request authentication. | ||
* @param retentionPeriod Duration after which a completed callback event is automatically removed. | ||
* @param initialBackoff Initial delay before retry attempt following a callback event failure. | ||
* @param maxAttempts Maximum number of attempts to send a callback event. | ||
* @return Information about new callback URL object. | ||
* @throws PowerAuthClientException In case REST API call fails. | ||
*/ | ||
UpdateCallbackUrlResponse updateCallbackUrl(String id, String applicationId, String name, String callbackUrl, List<String> attributes, HttpAuthenticationPrivate authentication) throws PowerAuthClientException; | ||
UpdateCallbackUrlResponse updateCallbackUrl(String id, String applicationId, String name, CallbackUrlType type, String callbackUrl, List<String> attributes, HttpAuthenticationPrivate authentication, Duration retentionPeriod, Duration initialBackoff, Integer maxAttempts) throws PowerAuthClientException; | ||
|
||
/** | ||
* Get the response with list of callback URL objects. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,6 +45,7 @@ | |
import org.springframework.util.StringUtils; | ||
|
||
import java.io.IOException; | ||
import java.time.Duration; | ||
import java.util.Date; | ||
import java.util.List; | ||
|
||
|
@@ -866,7 +867,7 @@ public CreateCallbackUrlResponse createCallbackUrl(CreateCallbackUrlRequest requ | |
} | ||
|
||
@Override | ||
public CreateCallbackUrlResponse createCallbackUrl(String applicationId, String name, CallbackUrlType type, String callbackUrl, List<String> attributes, HttpAuthenticationPrivate authentication) throws PowerAuthClientException { | ||
public CreateCallbackUrlResponse createCallbackUrl(String applicationId, String name, CallbackUrlType type, String callbackUrl, List<String> attributes, HttpAuthenticationPrivate authentication, Duration retentionPeriod, Duration initialBackoff, Integer maxAttempts) throws PowerAuthClientException { | ||
final CreateCallbackUrlRequest request = new CreateCallbackUrlRequest(); | ||
request.setApplicationId(applicationId); | ||
request.setName(name); | ||
|
@@ -876,6 +877,9 @@ public CreateCallbackUrlResponse createCallbackUrl(String applicationId, String | |
request.getAttributes().addAll(attributes); | ||
} | ||
request.setAuthentication(authentication); | ||
request.setRetentionPeriod(retentionPeriod); | ||
request.setInitialBackoff(initialBackoff); | ||
request.setMaxAttempts(maxAttempts); | ||
return createCallbackUrl(request, EMPTY_MULTI_MAP, EMPTY_MULTI_MAP); | ||
} | ||
|
||
|
@@ -890,16 +894,20 @@ public UpdateCallbackUrlResponse updateCallbackUrl(UpdateCallbackUrlRequest requ | |
} | ||
|
||
@Override | ||
public UpdateCallbackUrlResponse updateCallbackUrl(String id, String applicationId, String name, String callbackUrl, List<String> attributes, HttpAuthenticationPrivate authentication) throws PowerAuthClientException { | ||
public UpdateCallbackUrlResponse updateCallbackUrl(String id, String applicationId, String name, CallbackUrlType type, String callbackUrl, List<String> attributes, HttpAuthenticationPrivate authentication, Duration retentionPeriod, Duration initialBackoff, Integer maxAttempts) throws PowerAuthClientException { | ||
final UpdateCallbackUrlRequest request = new UpdateCallbackUrlRequest(); | ||
request.setId(id); | ||
request.setApplicationId(applicationId); | ||
request.setName(name); | ||
request.setType(type.toString()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤔 Why is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was thinking about that too, but I didn't want to include this type of change in this PR. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
request.setCallbackUrl(callbackUrl); | ||
if (attributes != null) { | ||
request.getAttributes().addAll(attributes); | ||
} | ||
request.setAuthentication(authentication); | ||
request.setRetentionPeriod(retentionPeriod); | ||
request.setInitialBackoff(initialBackoff); | ||
request.setMaxAttempts(maxAttempts); | ||
return updateCallbackUrl(request, EMPTY_MULTI_MAP, EMPTY_MULTI_MAP); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing URL is not backward compatible but for Admin API we may afford that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think we can assume those are just called internally.