From 78867d00fe93d21cc6b0b037c96d51179b136e0c Mon Sep 17 00:00:00 2001 From: Dustin Jenkins Date: Wed, 10 Dec 2025 11:19:13 -0800 Subject: [PATCH 1/2] fix: fix for availability service --- cavern/VERSION | 2 +- .../opencadc/cavern/ServiceAvailability.java | 45 ++++++++++--------- 2 files changed, 26 insertions(+), 21 deletions(-) diff --git a/cavern/VERSION b/cavern/VERSION index 4e9ead94..d93c5b76 100644 --- a/cavern/VERSION +++ b/cavern/VERSION @@ -1,6 +1,6 @@ ## deployable containers have a semantic and build tag # semantic version tag: major.minor # build version tag: timestamp -VER=0.9.2 +VER=0.9.3 TAGS="${VER} ${VER}-$(date -u +"%Y%m%dT%H%M%S")" unset VER diff --git a/cavern/src/main/java/org/opencadc/cavern/ServiceAvailability.java b/cavern/src/main/java/org/opencadc/cavern/ServiceAvailability.java index 4844a4ee..fb07df33 100644 --- a/cavern/src/main/java/org/opencadc/cavern/ServiceAvailability.java +++ b/cavern/src/main/java/org/opencadc/cavern/ServiceAvailability.java @@ -150,21 +150,27 @@ public Availability getStatus() { URI credURI = null; try { - credURI = localAuthority.getServiceURI(Standards.CRED_PROXY_10.toString()); - URL url = reg.getServiceURL(credURI, Standards.VOSI_AVAILABILITY, AuthMethod.ANON); - if (url != null) { - CheckResource checkResource = new CheckWebService(url); - checkResource.check(); + credURI = localAuthority.getResourceID(Standards.CRED_PROXY_10); + + // The CDP is not applicable to all deployments, so don't throw an exception + if (credURI != null) { + URL url = reg.getServiceURL(credURI, Standards.VOSI_AVAILABILITY, AuthMethod.ANON); + if (url != null) { + CheckResource checkResource = new CheckWebService(url); + checkResource.check(); + } else { + log.debug("check skipped: " + credURI + " does not provide " + Standards.VOSI_AVAILABILITY); + } } else { - log.debug("check skipped: " + credURI + " does not provide " + Standards.VOSI_AVAILABILITY); + log.debug("check skipped: " + Standards.CRED_PROXY_10 + " not applicable"); } - } catch (NoSuchElementException ex) { + } catch (NoSuchElementException | IllegalArgumentException ex) { log.debug("not configured: " + Standards.CRED_PROXY_10); } URI usersURI = null; try { - usersURI = localAuthority.getServiceURI(Standards.UMS_USERS_01.toString()); + usersURI = localAuthority.getResourceID(Standards.UMS_USERS_10); URL url = reg.getServiceURL(credURI, Standards.VOSI_AVAILABILITY, AuthMethod.ANON); if (url != null) { CheckResource checkResource = new CheckWebService(url); @@ -172,13 +178,12 @@ public Availability getStatus() { } else { log.debug("check skipped: " + usersURI + " does not provide " + Standards.VOSI_AVAILABILITY); } - } catch (NoSuchElementException ex) { - log.debug("not configured: " + Standards.UMS_USERS_01); + } catch (NoSuchElementException | IllegalArgumentException ex) { + log.debug("not configured: " + Standards.UMS_USERS_10); } - URI groupsURI = null; try { - groupsURI = localAuthority.getServiceURI(Standards.GMS_SEARCH_10.toString()); + URI groupsURI = localAuthority.getResourceID(Standards.GMS_SEARCH_10); if (!groupsURI.equals(usersURI)) { URL url = reg.getServiceURL(groupsURI, Standards.VOSI_AVAILABILITY, AuthMethod.ANON); if (url != null) { @@ -188,28 +193,28 @@ public Availability getStatus() { log.debug("check skipped: " + groupsURI + " does not provide " + Standards.VOSI_AVAILABILITY); } } - } catch (NoSuchElementException ex) { + } catch (NoSuchElementException | IllegalArgumentException ex) { log.debug("not configured: " + Standards.GMS_SEARCH_10); } URI posixUserMapURI = null; try { - posixUserMapURI = localAuthority.getServiceURI(Standards.POSIX_USERMAP.toASCIIString()); - URL url = reg.getServiceURL(groupsURI, Standards.VOSI_AVAILABILITY, AuthMethod.ANON); + posixUserMapURI = localAuthority.getResourceID(Standards.POSIX_USERMAP); + URL url = reg.getServiceURL(posixUserMapURI, Standards.VOSI_AVAILABILITY, AuthMethod.ANON); if (url != null) { CheckResource checkResource = new CheckWebService(url); checkResource.check(); } else { log.debug("check skipped: " + posixUserMapURI + " does not provide " + Standards.VOSI_AVAILABILITY); } - } catch (NoSuchElementException ex) { + } catch (NoSuchElementException | IllegalArgumentException ex) { log.debug("not configured: " + Standards.POSIX_USERMAP); } - URI posixGroupMapURI = null; + try { - posixGroupMapURI = localAuthority.getServiceURI(Standards.POSIX_GROUPMAP.toASCIIString()); + URI posixGroupMapURI = localAuthority.getResourceID(Standards.POSIX_GROUPMAP); if (!posixGroupMapURI.equals(posixUserMapURI)) { - URL url = reg.getServiceURL(groupsURI, Standards.VOSI_AVAILABILITY, AuthMethod.ANON); + URL url = reg.getServiceURL(posixGroupMapURI, Standards.VOSI_AVAILABILITY, AuthMethod.ANON); if (url != null) { CheckResource checkResource = new CheckWebService(url); checkResource.check(); @@ -217,7 +222,7 @@ public Availability getStatus() { log.debug("check skipped: " + posixGroupMapURI + " does not provide " + Standards.VOSI_AVAILABILITY); } } - } catch (NoSuchElementException ex) { + } catch (NoSuchElementException | IllegalArgumentException ex) { log.debug("not configured: " + Standards.POSIX_GROUPMAP); } From 31463368a1b5f44fefca84b8b3515d2630cfb78d Mon Sep 17 00:00:00 2001 From: Dustin Jenkins Date: Wed, 10 Dec 2025 12:48:53 -0800 Subject: [PATCH 2/2] fix: fix for lookup in usersuri --- .../src/main/java/org/opencadc/cavern/ServiceAvailability.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cavern/src/main/java/org/opencadc/cavern/ServiceAvailability.java b/cavern/src/main/java/org/opencadc/cavern/ServiceAvailability.java index fb07df33..9d46772b 100644 --- a/cavern/src/main/java/org/opencadc/cavern/ServiceAvailability.java +++ b/cavern/src/main/java/org/opencadc/cavern/ServiceAvailability.java @@ -171,7 +171,7 @@ public Availability getStatus() { URI usersURI = null; try { usersURI = localAuthority.getResourceID(Standards.UMS_USERS_10); - URL url = reg.getServiceURL(credURI, Standards.VOSI_AVAILABILITY, AuthMethod.ANON); + URL url = reg.getServiceURL(usersURI, Standards.VOSI_AVAILABILITY, AuthMethod.ANON); if (url != null) { CheckResource checkResource = new CheckWebService(url); checkResource.check();