use of org.jboss.resteasy.annotations.cache.NoCache in project keycloak by keycloak.
the class RealmAdminResource method getRealmEventsConfig.
/**
* Get the events provider configuration
*
* Returns JSON object with events provider configuration
*
* @return
*/
@GET
@NoCache
@Path("events/config")
@Produces(MediaType.APPLICATION_JSON)
public RealmEventsConfigRepresentation getRealmEventsConfig() {
auth.realm().requireViewEvents();
RealmEventsConfigRepresentation config = ModelToRepresentation.toEventsConfigReprensetation(realm);
if (config.getEnabledEventTypes() == null || config.getEnabledEventTypes().isEmpty()) {
List<String> eventTypes = Arrays.stream(EventType.values()).filter(EventType::isSaveByDefault).map(EventType::name).collect(Collectors.toList());
config.setEnabledEventTypes(eventTypes);
}
return config;
}
use of org.jboss.resteasy.annotations.cache.NoCache in project keycloak by keycloak.
the class ClientRegistrationPolicyResource method getProviders.
/**
* Base path for retrieve providers with the configProperties properly filled
*
* @return
*/
@Path("providers")
@GET
@NoCache
@Produces(MediaType.APPLICATION_JSON)
public Stream<ComponentTypeRepresentation> getProviders() {
return session.getKeycloakSessionFactory().getProviderFactoriesStream(ClientRegistrationPolicy.class).map((ProviderFactory factory) -> {
ClientRegistrationPolicyFactory clientRegFactory = (ClientRegistrationPolicyFactory) factory;
List<ProviderConfigProperty> configProps = clientRegFactory.getConfigProperties(session);
ComponentTypeRepresentation rep = new ComponentTypeRepresentation();
rep.setId(clientRegFactory.getId());
rep.setHelpText(clientRegFactory.getHelpText());
rep.setProperties(ModelToRepresentation.toRepresentation(configProps));
return rep;
});
}
use of org.jboss.resteasy.annotations.cache.NoCache in project keycloak by keycloak.
the class ClientScopesResource method getClientScope.
/**
* Base path for managing a specific client scope.
*
* @param id id of client scope (not name)
* @return
*/
@Path("{id}")
@NoCache
public ClientScopeResource getClientScope(@PathParam("id") final String id) {
auth.clients().requireListClientScopes();
ClientScopeModel clientModel = realm.getClientScopeById(id);
if (clientModel == null) {
throw new NotFoundException("Could not find client scope");
}
ClientScopeResource clientResource = new ClientScopeResource(realm, auth, clientModel, session, adminEvent);
ResteasyProviderFactory.getInstance().injectProperties(clientResource);
return clientResource;
}
use of org.jboss.resteasy.annotations.cache.NoCache in project keycloak by keycloak.
the class GroupResource method getGroup.
/**
* @return
*/
@GET
@NoCache
@Produces(MediaType.APPLICATION_JSON)
public GroupRepresentation getGroup() {
this.auth.groups().requireView(group);
GroupRepresentation rep = ModelToRepresentation.toGroupHierarchy(group, true);
rep.setAccess(auth.groups().getAccess(group));
return rep;
}
use of org.jboss.resteasy.annotations.cache.NoCache in project keycloak by keycloak.
the class GroupResource method setManagementPermissionsEnabled.
/**
* Return object stating whether client Authorization permissions have been initialized or not and a reference
*
* @return initialized manage permissions reference
*/
@Path("management/permissions")
@PUT
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@NoCache
public ManagementPermissionReference setManagementPermissionsEnabled(ManagementPermissionReference ref) {
auth.groups().requireManage(group);
AdminPermissionManagement permissions = AdminPermissions.management(session, realm);
permissions.groups().setPermissionsEnabled(group, ref.isEnabled());
if (ref.isEnabled()) {
return toMgmtRef(group, permissions);
} else {
return new ManagementPermissionReference();
}
}
Aggregations