Search in sources :

Example 1 with ActionRemove

use of edu.uiuc.ncsa.myproxy.oa4mp.server.admin.things.actions.ActionRemove in project OA4MP by ncsa.

the class PermissionServerTest method removeClient.

public void removeClient(CMTestStoreProvider tp2) throws Exception {
    CC cc = setupClients(tp2);
    RemoveClientRequest req = RequestFactory.createRequest(cc.adminClient, new TypePermission(), new ActionRemove(), cc.client, null);
    PermissionServer permissionServer = new PermissionServer(tp2.getCOSE());
    PermissionResponse resp = (PermissionResponse) permissionServer.process(req);
    assert tp2.getPermissionStore().get(cc.adminClient.getIdentifier(), cc.client.getIdentifier()).isEmpty();
}
Also used : TypePermission(edu.uiuc.ncsa.myproxy.oa4mp.server.admin.things.types.TypePermission) ActionRemove(edu.uiuc.ncsa.myproxy.oa4mp.server.admin.things.actions.ActionRemove)

Example 2 with ActionRemove

use of edu.uiuc.ncsa.myproxy.oa4mp.server.admin.things.actions.ActionRemove in project OA4MP by ncsa.

the class AttributeServerTest method testAttributeServerRemove.

public void testAttributeServerRemove(CMTestStoreProvider tp2) throws Exception {
    CC cc = setupClients(tp2);
    AttributeServer attributeServer = new AttributeServer(tp2.getCOSE());
    OA2ClientKeys keys = getClientKeys(tp2);
    JSONArray attributes = new JSONArray();
    attributes.add(keys.homeURL());
    attributes.add(keys.email());
    attributes.add(keys.rtLifetime());
    attributes.add(keys.scopes());
    AttributeRemoveRequest req = RequestFactory.createRequest(cc.adminClient, new TypeAttribute(), new ActionRemove(), cc.client, attributes);
    AttributeClientResponse resp = (AttributeClientResponse) attributeServer.process(req);
    OA2Client client = (OA2Client) resp.getClient();
    assert client.getScopes() == null || client.getScopes().isEmpty();
    assert client.getRtLifetime() == 0L;
    assert client.getHomeUri() == null;
    assert client.getEmail() == null;
}
Also used : OA2Client(edu.uiuc.ncsa.security.oauth_2_0.OA2Client) TypeAttribute(edu.uiuc.ncsa.myproxy.oa4mp.server.admin.things.types.TypeAttribute) OA2ClientKeys(edu.uiuc.ncsa.security.oauth_2_0.OA2ClientKeys) JSONArray(net.sf.json.JSONArray) ActionRemove(edu.uiuc.ncsa.myproxy.oa4mp.server.admin.things.actions.ActionRemove)

Aggregations

ActionRemove (edu.uiuc.ncsa.myproxy.oa4mp.server.admin.things.actions.ActionRemove)2 TypeAttribute (edu.uiuc.ncsa.myproxy.oa4mp.server.admin.things.types.TypeAttribute)1 TypePermission (edu.uiuc.ncsa.myproxy.oa4mp.server.admin.things.types.TypePermission)1 OA2Client (edu.uiuc.ncsa.security.oauth_2_0.OA2Client)1 OA2ClientKeys (edu.uiuc.ncsa.security.oauth_2_0.OA2ClientKeys)1 JSONArray (net.sf.json.JSONArray)1