use of org.springframework.boot.actuate.endpoint.annotation.DeleteOperation in project cas by apereo.
the class U2FRegisteredDevicesEndpoint method delete.
/**
* Delete.
*
* @param username the username
*/
@DeleteOperation
@Operation(summary = "Delete all registered devices", parameters = { @Parameter(name = "username", required = true) })
public void delete(@Selector final String username) {
val registeredDevices = new ArrayList<>(u2fDeviceRepository.getObject().getRegisteredDevices(username));
registeredDevices.forEach(u2fDeviceRepository.getObject()::deleteRegisteredDevice);
}
use of org.springframework.boot.actuate.endpoint.annotation.DeleteOperation in project cas by apereo.
the class U2FRegisteredDevicesEndpoint method delete.
/**
* Delete.
*
* @param username the username
* @param id the id
*/
@DeleteOperation
@Operation(summary = "Delete registered device for username and device")
public void delete(@Selector final String username, @Selector final Long id) {
val registeredDevices = new ArrayList<>(u2fDeviceRepository.getObject().getRegisteredDevices(username));
registeredDevices.stream().filter(d -> d.getId() == id).forEach(u2fDeviceRepository.getObject()::deleteRegisteredDevice);
}
use of org.springframework.boot.actuate.endpoint.annotation.DeleteOperation in project cas by apereo.
the class SamlRegisteredServiceCachedMetadataEndpoint method invalidate.
/**
* Invalidate.
*
* @param serviceId the service id
*/
@DeleteOperation
@Operation(summary = "Invalidate SAML2 metadata cache using an entity id.", parameters = { @Parameter(name = "serviceId") })
public void invalidate(@Nullable final String serviceId) {
if (StringUtils.isBlank(serviceId)) {
cachingMetadataResolver.invalidate();
} else {
val registeredService = findRegisteredService(serviceId);
val criteriaSet = new CriteriaSet();
criteriaSet.add(new EntityIdCriterion(serviceId));
criteriaSet.add(new EntityRoleCriterion(SPSSODescriptor.DEFAULT_ELEMENT_NAME));
cachingMetadataResolver.invalidate(registeredService, criteriaSet);
}
}
Aggregations