[java-identity-provider] branch maint-4 updated: IDP-995 - Administrative logout features
Scott Cantor
cantor.2 at osu.edu
Fri Aug 5 16:56:34 UTC 2022
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to branch maint-4
in repository java-identity-provider.
View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=6ae702f28c1ce2ae8ed29baa83e259e76fb15e08
The following commit(s) were added to refs/heads/maint-4 by this push:
new 6ae702f28 IDP-995 - Administrative logout features
6ae702f28 is described below
commit 6ae702f28c1ce2ae8ed29baa83e259e76fb15e08
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Fri Aug 5 12:56:31 2022 -0400
IDP-995 - Administrative logout features
https://shibboleth.atlassian.net/browse/IDP-995
Allow for duration to be omitted from insertions.
Allow duration parameter to be in ISO syntax.
---
.../impl/DoRevocationCacheOperation.java | 34 ++++++++++++++++------
1 file changed, 25 insertions(+), 9 deletions(-)
diff --git a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/revocation/impl/DoRevocationCacheOperation.java b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/revocation/impl/DoRevocationCacheOperation.java
index 6dc68bd10..88868e673 100644
--- a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/revocation/impl/DoRevocationCacheOperation.java
+++ b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/revocation/impl/DoRevocationCacheOperation.java
@@ -32,6 +32,7 @@ import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
import net.shibboleth.utilities.java.support.component.ComponentSupport;
import net.shibboleth.utilities.java.support.logic.Constraint;
+import net.shibboleth.utilities.java.support.xml.DOMTypeSupport;
import org.opensaml.profile.action.ActionSupport;
import org.opensaml.profile.action.EventIds;
@@ -245,20 +246,35 @@ public class DoRevocationCacheOperation extends AbstractProfileAction {
final String value = getHttpServletRequest().getParameter("value");
final String duration = getHttpServletRequest().getParameter("duration");
- if (value == null || duration == null) {
- sendError(HttpServletResponse.SC_BAD_REQUEST, "Bad Request", "Request missing value/duration parameters.");
+ if (value == null) {
+ sendError(HttpServletResponse.SC_BAD_REQUEST, "Bad Request", "Request missing value parameter.");
return;
}
- final Long durationSeconds;
- try {
- durationSeconds = Long.valueOf(duration);
- } catch (final NumberFormatException e) {
- sendError(HttpServletResponse.SC_BAD_REQUEST, "Bad Request", "Duration parameter was not a long integer.");
- return;
+ Duration durationSeconds = null;
+
+ if (duration != null) {
+ if (duration.startsWith("P")) {
+ durationSeconds = DOMTypeSupport.stringToDuration(duration);
+ } else {
+ try {
+ durationSeconds = Duration.ofSeconds(Long.valueOf(duration));
+ } catch (final NumberFormatException e) {
+ sendError(HttpServletResponse.SC_BAD_REQUEST, "Bad Request",
+ "Duration parameter was not a long integer.");
+ return;
+ }
+ }
+ }
+
+ final boolean result;
+ if (durationSeconds != null) {
+ result = revocationCache.revoke(context, key, value, durationSeconds);
+ } else {
+ result = revocationCache.revoke(context, key, value);
}
- if (revocationCache.revoke(context, key, value, Duration.ofSeconds(durationSeconds))) {
+ if (result) {
getHttpServletResponse().setStatus(HttpServletResponse.SC_ACCEPTED);
} else {
sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Internal Server Error",
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list