use of org.keycloak.representations.adapters.action.GlobalRequestResult in project keycloak by keycloak.
the class ResourceAdminManager method pushRealmRevocationPolicy.
public GlobalRequestResult pushRealmRevocationPolicy(RealmModel realm) {
GlobalRequestResult finalResult = new GlobalRequestResult();
realm.getClientsStream().forEach(c -> {
GlobalRequestResult currentResult = pushRevocationPolicy(realm, c, realm.getNotBefore());
finalResult.addAll(currentResult);
});
return finalResult;
}
use of org.keycloak.representations.adapters.action.GlobalRequestResult in project keycloak by keycloak.
the class ResourceAdminManager method testNodesAvailability.
public GlobalRequestResult testNodesAvailability(RealmModel realm, ClientModel client) {
List<String> mgmtUrls = getAllManagementUrls(client);
if (mgmtUrls.isEmpty()) {
logger.debug("No management URL or no registered cluster nodes for the application " + client.getClientId());
return new GlobalRequestResult();
}
if (logger.isDebugEnabled())
logger.debug("Sending test nodes availability: " + mgmtUrls);
// Propagate this to all hosts
GlobalRequestResult result = new GlobalRequestResult();
for (String mgmtUrl : mgmtUrls) {
if (sendTestNodeAvailabilityRequest(realm, client, mgmtUrl)) {
result.addSuccessRequest(mgmtUrl);
} else {
result.addFailedRequest(mgmtUrl);
}
}
return result;
}
use of org.keycloak.representations.adapters.action.GlobalRequestResult in project keycloak by keycloak.
the class RealmTest method pushNotBeforeWithSamlApp.
@Test
public void pushNotBeforeWithSamlApp() {
setupTestAppAndUser();
setupTestSamlApp();
int time = Time.currentTime() - 60;
RealmRepresentation rep = realm.toRepresentation();
rep.setNotBefore(time);
realm.update(rep);
assertAdminEvents.assertEvent(realmId, OperationType.UPDATE, Matchers.nullValue(String.class), rep, ResourceType.REALM);
GlobalRequestResult globalRequestResult = realm.pushRevocation();
assertAdminEvents.assertEvent(realmId, OperationType.ACTION, "push-revocation", globalRequestResult, ResourceType.REALM);
assertThat(globalRequestResult.getSuccessRequests(), containsInAnyOrder(oauth.AUTH_SERVER_ROOT + "/realms/master/app/admin"));
assertThat(globalRequestResult.getFailedRequests(), containsInAnyOrder(oauth.AUTH_SERVER_ROOT + "/realms/master/saml-app/saml"));
PushNotBeforeAction adminPushNotBefore = testingClient.testApp().getAdminPushNotBefore();
assertEquals(time, adminPushNotBefore.getNotBefore());
}
Aggregations