Skip to content

Commit

Permalink
Merge pull request #177 from pdowler/main
Browse files Browse the repository at this point in the history
cadc-tap-schema: fix output of owner from permission endpoint
  • Loading branch information
pdowler authored Oct 16, 2024
2 parents 6d34c86 + 4343ec6 commit abad564
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion cadc-tap-schema/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ sourceCompatibility = 1.8

group = 'org.opencadc'

version = '1.2.1'
version = '1.2.2'

description = 'OpenCADC TAP-1.1 tap schema server library'
def git_url = 'https://github.com/opencadc/tap'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@

package ca.nrc.cadc.vosi.actions;

import ca.nrc.cadc.auth.AuthenticationUtil;
import ca.nrc.cadc.auth.IdentityManager;
import ca.nrc.cadc.rest.InlineContentHandler;
import ca.nrc.cadc.tap.schema.TapPermissions;
import ca.nrc.cadc.tap.schema.TapSchemaDAO;
Expand Down Expand Up @@ -99,7 +101,7 @@ public void doAction() throws Exception {
}
log.debug("name: " + name);

checkWritable();
checkReadable();

TapSchemaDAO dao = getTapSchemaDAO();
TapPermissions permissions = null;
Expand Down Expand Up @@ -137,10 +139,8 @@ private String getOwnerString(Subject s) {
if (s == null) {
return "";
}
if (s.getPrincipals(X500Principal.class).size() > 0) {
return s.getPrincipals(X500Principal.class).iterator().next().getName();
}
return "";
IdentityManager im = AuthenticationUtil.getIdentityManager();
return im.toDisplayString(s);
}

private String getGroupString(GroupURI group) {
Expand Down
2 changes: 1 addition & 1 deletion youcat/VERSION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## deployable containers have a semantic and build tag
# semantic version tag: major.minor
# build version tag: timestamp
VER=0.7.0
VER=0.7.1
TAGS="${VER} ${VER}-$(date --utc +"%Y%m%dT%H%M%S")"
unset VER
11 changes: 7 additions & 4 deletions youcat/src/main/java/org/opencadc/youcat/CatalogTapService.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,11 @@ public Availability getStatus() {
boolean isGood = true;
String note = "service is accepting queries";
try {
String state = getState();
final String state = getState();
if (RestAction.STATE_OFFLINE.equals(state)) {
// no further checks needed
return new Availability(false, RestAction.STATE_OFFLINE_MSG);
}
if (RestAction.STATE_READ_ONLY.equals(state)) {
return new Availability(false, RestAction.STATE_READ_ONLY_MSG);
}

// ReadWrite: proceed with live checks
CheckResource cr;
Expand Down Expand Up @@ -220,6 +218,11 @@ public Availability getStatus() {
} catch (Exception ex) {
throw new CheckException("cadc-tap-tmp check: " + ex, ex);
}

if (RestAction.STATE_READ_ONLY.equals(state)) {
isGood = false;
note = RestAction.STATE_READ_ONLY_MSG;
}

} catch (CheckException ce) {
// tests determined that the resource is not working
Expand Down

0 comments on commit abad564

Please sign in to comment.