@GetMapping(
produces = {
MediaType.APPLICATION_JSON_VALUE,
MediaTypeExtensions.TEXT_JSON_VALUE,
MediaType.APPLICATION_XML_VALUE,
MediaType.TEXT_XML_VALUE
}
)
public NamedMap<String, String> masterPasswordGet() throws IOException {
if (!getManager().checkAuthenticationForAdminRole()) {
throw new RestException("Amdinistrative privelges required", HttpStatus.FORBIDDEN);
}
char[] masterpw = getManager().getMasterPasswordForREST();
NamedMap<String, String> m = new NamedMap<>(XML_ROOT_ELEM);
m.put(MP_CURRENT_KEY, new String(masterpw));
getManager().disposePassword(masterpw);
return m;
}