use of edu.uiuc.ncsa.myproxy.oa4mp.server.admin.adminClient.AdminClient in project OA4MP by ncsa.
the class OA2AdminClientCommands method longFormat.
@Override
protected void longFormat(Identifiable identifiable) {
super.longFormat(identifiable);
AdminClient client = (AdminClient) identifiable;
sayi("issuer=" + client.getIssuer());
sayi("vo=" + client.getVirtualOrganization());
}
use of edu.uiuc.ncsa.myproxy.oa4mp.server.admin.adminClient.AdminClient in project OA4MP by ncsa.
the class OA2AdminClientCommands method extraUpdates.
@Override
public void extraUpdates(Identifiable identifiable) {
AdminClient client = (AdminClient) identifiable;
String secret = client.getSecret();
String input;
boolean askForSecret = true;
while (askForSecret) {
input = getInput("enter a new secret or return to skip.", secret);
if (isEmpty(input)) {
sayi("Nothing entered. Client secret entry skipped.");
break;
}
if (input.equals(secret)) {
sayi(" Client secret entry skipped.");
break;
}
// input is not empty.
secret = DigestUtils.sha1Hex(input);
client.setSecret(secret);
askForSecret = false;
}
String issuer = getInput("Give the issuer", client.getIssuer());
if (!isEmpty(issuer)) {
client.setIssuer(issuer);
}
String vo = getInput("Give the VO", client.getVirtualOrganization());
if (!isEmpty(vo)) {
client.setVirtualOrganization(vo);
}
}
use of edu.uiuc.ncsa.myproxy.oa4mp.server.admin.adminClient.AdminClient in project OA4MP by ncsa.
the class AbstractDDServer method subset.
protected AdminClient subset(AdminClient client, List<String> attributes) {
ColumnMap map = new ColumnMap();
cose.getAdminClientStore().getACConverter().toMap(client, map);
ColumnMap reducedMap = new ColumnMap();
for (String key : attributes) {
reducedMap.put(key, map.get(key));
}
// Have to always include the identifier.
reducedMap.put(cose.getClientStore().getACConverter().getKeys().identifier(), client.getIdentifierString());
AdminClient x = (AdminClient) cose.getAdminClientStore().getACConverter().fromMap(reducedMap, null);
return x;
}
use of edu.uiuc.ncsa.myproxy.oa4mp.server.admin.adminClient.AdminClient in project OA4MP by ncsa.
the class ResponseSerializer method serialize.
protected void serialize(AttributeGetAdminClientResponse response, HttpServletResponse servletResponse) throws IOException {
PrintWriter pw = servletResponse.getWriter();
JSONObject json = new JSONObject();
json.put("status", 0);
AdminClientKeys keys = (AdminClientKeys) cose.getAdminClientStore().getACConverter().getKeys();
List<String> allKeys = keys.allKeys();
allKeys.remove(keys.secret());
AdminClient newClient = (AdminClient) cose.getAdminClientStore().getACConverter().subset(response.getAdminClient(), response.getAttributes());
JSONObject jsonClient = new JSONObject();
cose.getAdminClientStore().getACConverter().toJSON(newClient, jsonClient);
json.put("content", jsonClient);
// return json;
pw.println(json);
}
use of edu.uiuc.ncsa.myproxy.oa4mp.server.admin.adminClient.AdminClient in project OA4MP by ncsa.
the class ResponseSerializer method acToJSON.
private JSONObject acToJSON(AdminClient client) {
JSONObject json = new JSONObject();
json.put("status", 0);
AdminClientKeys keys = (AdminClientKeys) cose.getAdminClientStore().getACConverter().getKeys();
List<String> allKeys = keys.allKeys();
allKeys.remove(keys.secret());
AdminClient newClient = (AdminClient) cose.getAdminClientStore().getACConverter().subset(client, allKeys);
JSONObject jsonClient = new JSONObject();
cose.getAdminClientStore().getACConverter().toJSON(newClient, jsonClient);
json.put("content", jsonClient);
return json;
}
Aggregations