From 1580e8b31e0e86048dc57e1391720d4cb0d863a5 Mon Sep 17 00:00:00 2001 From: Jacek Kowalski <Jacek@jacekk.info> Date: Fri, 18 Oct 2024 10:07:11 +0000 Subject: [PATCH] Update GitHub release workflow actions due to Node.js deprecation --- src/main/java/org/keycloak/protocol/cas/utils/ServiceResponseHelper.java | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+), 0 deletions(-) diff --git a/src/main/java/org/keycloak/protocol/cas/utils/ServiceResponseHelper.java b/src/main/java/org/keycloak/protocol/cas/utils/ServiceResponseHelper.java index ada4d7f..ed6b635 100644 --- a/src/main/java/org/keycloak/protocol/cas/utils/ServiceResponseHelper.java +++ b/src/main/java/org/keycloak/protocol/cas/utils/ServiceResponseHelper.java @@ -7,6 +7,8 @@ import org.keycloak.protocol.cas.representations.CASServiceResponse; import org.keycloak.protocol.cas.representations.CASServiceResponseAuthenticationFailure; import org.keycloak.protocol.cas.representations.CASServiceResponseAuthenticationSuccess; +import org.keycloak.protocol.cas.representations.CASServiceResponseProxySuccess; +import org.keycloak.protocol.cas.representations.CASServiceResponseProxyFailure; import java.util.List; import java.util.Map; @@ -43,6 +45,24 @@ return response; } + public static CASServiceResponse createProxySuccess(String pt) { + CASServiceResponse response = new CASServiceResponse(); + CASServiceResponseProxySuccess success = new CASServiceResponseProxySuccess(); + success.setProxyTicket(pt); + response.setProxySuccess(success); + return response; + } + + public static CASServiceResponse createProxyFailure(CASErrorCode errorCode, String errorDescription) { + CASServiceResponse response = new CASServiceResponse(); + CASServiceResponseProxyFailure failure = new CASServiceResponseProxyFailure(); + failure.setCode(errorCode == null ? CASErrorCode.INTERNAL_ERROR.name() : errorCode.name()); + failure.setDescription(errorDescription); + response.setProxyFailure(failure); + + return response; + } + public static Response createResponse(Response.Status status, MediaType mediaType, CASServiceResponse serviceResponse) { Response.ResponseBuilder builder = Response.status(status) .header(HttpHeaders.CONTENT_TYPE, mediaType.withCharset("utf-8")); -- Gitblit v1.9.1