Skip to content

Commit dce55d4

Browse files
author
Pablo Carle
committedFeb 19, 2025
get from v3
Signed-off-by: Pablo Carle <pablo.carle@broadcom.com>
1 parent 827216c commit dce55d4

File tree

11 files changed

+26
-7
lines changed

11 files changed

+26
-7
lines changed
 

‎api-catalog-services/src/main/resources/application.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ logging:
211211
com.netflix: INFO
212212
org.ehcache: INFO
213213
com.netflix.discovery.shared.transport.decorator: DEBUG
214+
org.apache.tomcat.util.net.jsse.JSSESupport: INFO
214215

215216
---
216217
spring:

‎caching-service/src/main/resources/application.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ logging:
166166
org.springframework: INFO
167167
org.apache: INFO
168168
org.apache.http: DEBUG
169+
org.apache.tomcat.util.net.jsse.JSSESupport: INFO
169170
com.netflix: INFO
170171
org.hibernate: INFO
171172
org.springframework.web.servlet.PageNotFound: WARN

‎cloud-gateway-service/src/main/resources/application.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ logging:
112112
reactor.netty.http.client.HttpClient: DEBUG
113113
reactor.netty.http.client.HttpClientConnect: DEBUG
114114
com.netflix: DEBUG
115+
org.apache.tomcat.util.net.jsse.JSSESupport: INFO
115116

116117
---
117118
spring.config.activate.on-profile: attls

‎common-service-core/src/main/java/org/zowe/apiml/passticket/AbstractIRRPassTicketException.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,13 @@ public ErrorCode getErrorCode() {
3838
}
3939

4040
protected String getMessage(String baseMessage) {
41-
return baseMessage + ' ' + getErrorCode().getMessage();
41+
return String.format("%s %s: safRc=%d, racfRc=%d, racfRsn=%d",
42+
baseMessage,
43+
getErrorCode().getMessage(),
44+
this.safRc,
45+
this.racfRc,
46+
this.racfRsn
47+
);
4248
}
4349

4450
public int getHttpStatus() {

‎common-service-core/src/main/java/org/zowe/apiml/passticket/PassTicketService.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import org.zowe.apiml.util.ObjectUtil;
1515
import lombok.AllArgsConstructor;
1616
import lombok.Value;
17-
17+
import lombok.extern.slf4j.Slf4j;
1818
import org.apache.commons.lang3.StringUtils;
1919

2020
import java.util.HashMap;
@@ -25,10 +25,12 @@
2525
/**
2626
* This class allows to get a PassTicket from SAF.
2727
*/
28+
@Slf4j
2829
public class PassTicketService {
2930

3031
private final IRRPassTicket irrPassTicket;
3132

33+
@SuppressWarnings("unchecked")
3234
public PassTicketService() {
3335
this.irrPassTicket = ClassOrDefaultProxyUtils.createProxy(IRRPassTicket.class,
3436
"com.ibm.eserver.zos.racf.IRRPassTicket", DefaultPassTicketImpl::new,
@@ -47,7 +49,12 @@ public synchronized void evaluate(String userId, String applId, String passTicke
4749

4850
// IRRPassTicket is not thread-safe, must be synchronized
4951
public synchronized String generate(String userId, String applId) throws IRRPassTicketGenerationException {
50-
return irrPassTicket.generate(userId.toUpperCase(), applId.toUpperCase());
52+
try {
53+
return irrPassTicket.generate(userId.toUpperCase(), applId.toUpperCase());
54+
} catch (IRRPassTicketGenerationException | RuntimeException e) {
55+
log.debug("Error during pass ticket generation, userId={}, applid={}, exception={}", userId, applId, e);
56+
throw e;
57+
}
5158
}
5259

5360
public boolean isUsingSafImplementation() {

‎common-service-core/src/test/java/org/zowe/apiml/passticket/IRRPassTicketEvaluationExceptionTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ void testInit() {
2323
assertEquals(12, exception.getRacfRc());
2424
assertEquals(20, exception.getRacfRsn());
2525
assertEquals(AbstractIRRPassTicketException.ErrorCode.ERR_8_12_20, exception.getErrorCode());
26-
assertEquals("Error on evaluation of PassTicket: Invocation of the Security Server Network Authentication Service Program Call (PC) interface failed with an 'abend in the PC service routine' return code. The symptom record associated with this abend can be found in the logrec data set.", exception.getMessage());
26+
assertEquals("Error on evaluation of PassTicket: Invocation of the Security Server Network Authentication Service Program Call (PC) interface failed with an 'abend in the PC service routine' return code. The symptom record associated with this abend can be found in the logrec data set.: safRc=8, racfRc=12, racfRsn=20", exception.getMessage());
2727

2828
IRRPassTicketEvaluationException exception2 = new IRRPassTicketEvaluationException(AbstractIRRPassTicketException.ErrorCode.ERR_8_16_28);
2929
assertEquals(8, exception2.getSafRc());

‎common-service-core/src/test/java/org/zowe/apiml/passticket/IRRPassTicketGenerationExceptionTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ void testInit() {
2323
assertEquals(16, exception.getRacfRc());
2424
assertEquals(32, exception.getRacfRsn());
2525
assertEquals(AbstractIRRPassTicketException.ErrorCode.ERR_8_16_32, exception.getErrorCode());
26-
assertEquals("Error on generation of PassTicket: " + AbstractIRRPassTicketException.ErrorCode.ERR_8_16_32.getMessage(), exception.getMessage());
26+
assertEquals("Error on generation of PassTicket: " + AbstractIRRPassTicketException.ErrorCode.ERR_8_16_32.getMessage() + ": safRc=8, racfRc=16, racfRsn=32", exception.getMessage());
2727

2828
IRRPassTicketGenerationException exception2 = new IRRPassTicketGenerationException(AbstractIRRPassTicketException.ErrorCode.ERR_8_12_8);
2929
assertEquals(8, exception2.getSafRc());

‎common-service-core/src/test/java/org/zowe/apiml/passticket/PassTicketServiceTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ public String generate(String userId, String applId) {
7373

7474
@Test
7575
void testProxy() throws IRRPassTicketGenerationException {
76+
@SuppressWarnings("unchecked")
7677
IRRPassTicket irrPassTicket = ClassOrDefaultProxyUtils.createProxy(
7778
IRRPassTicket.class,
7879
"notExistingClass",
@@ -157,7 +158,7 @@ void testDefaultPassTicketImpl_GenerateUnknownUser() {
157158
assertEquals(16, e.getRacfRsn());
158159
assertNotNull(e.getErrorCode());
159160
assertEquals(AbstractIRRPassTicketException.ErrorCode.ERR_8_8_16, e.getErrorCode());
160-
assertEquals("Error on generation of PassTicket: Not authorized to use this service. Verify that the user and the application name are valid, and check that corresponding permissions have been set up.", e.getMessage());
161+
assertEquals("Error on generation of PassTicket: Not authorized to use this service. Verify that the user and the application name are valid, and check that corresponding permissions have been set up.: safRc=8, racfRc=8, racfRsn=16", e.getMessage());
161162
}
162163

163164
@Test

‎discovery-service/src/main/resources/application.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ logging:
166166
org.springframework: INFO
167167
org.apache: INFO
168168
org.apache.http: DEBUG
169+
org.apache.tomcat.util.net.jsse.JSSESupport: INFO
169170
com.netflix: INFO
170171
com.sun.jersey.server.impl.application.WebApplicationImpl: INFO
171172
org.ehcache: INFO

‎gateway-service/src/main/resources/application.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,7 @@ logging:
302302
org.springframework: INFO
303303
org.apache: INFO
304304
org.apache.http: DEBUG
305+
org.apache.tomcat.util.net.jsse.JSSESupport: INFO
305306
com.netflix: INFO
306307
org.hibernate: INFO
307308
org.springframework.web.servlet.PageNotFound: WARN

‎gateway-service/src/test/java/org/zowe/apiml/gateway/security/service/TokenCreationServiceTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ void givenPassTicketException_whenCreatingSafIdToken_thenExceptionThrown() throw
164164
underTest.createSafIdTokenWithoutCredentials(VALID_USER_ID, VALID_ZOSMF_APPLID);
165165
});
166166

167-
assertEquals("Error on generation of PassTicket: An internal error was encountered.", e.getMessage());
167+
assertEquals("Error on generation of PassTicket: An internal error was encountered.: safRc=8, racfRc=8, racfRsn=8", e.getMessage());
168168
}
169169

170170
@Test

0 commit comments

Comments
 (0)