Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cadc-tap-schema: fix output of owner from permission endpoint #177

Merged
merged 3 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading