@PUT
    @Timed
    @Path("{configClass}")
    @Consumes(MediaType.APPLICATION_JSON)
    @ApiOperation(value = "Update configuration in database")
    @RequiresPermissions({RestPermissions.CLUSTER_CONFIG_ENTRY_CREATE, RestPermissions.CLUSTER_CONFIG_ENTRY_EDIT})
    @AuditEvent(type = AuditEventTypes.CLUSTER_CONFIGURATION_UPDATE)
    public Response update(@ApiParam(name = "configClass", value = "The name of the cluster configuration class", required = true)
                           @PathParam("configClass") @NotBlank String configClass,
                           @ApiParam(name = "body", value = "The payload of the cluster configuration", required = true)
                           @NotNull InputStream body) throws IOException {
        final Class<?> cls = classFromName(configClass);
        if (cls == null) {
            throw new NotFoundException(createNoClassMsg(configClass));
        }

        final Object configObject = parseConfigObject(configClass, body, cls);
        validateConfigObject(configObject);
        writeConfigObject(configClass, configObject);

        return Response.accepted(configObject).build();
    }
@Test
    void putClassConsideredUnsafe(@TempDir Path tmpDir) throws IOException {
        final Path file = tmpDir.resolve("secrets.txt");
        Files.writeString(file, "secret content");

        final ClusterConfigResource resource = new ClusterConfigResource(clusterConfigService,
                new RestrictedChainingClassLoader(new ChainingClassLoader(this.getClass().getClassLoader()),
                        SafeClasses.allGraylogInternal()),
                new ObjectMapperProvider().get(),
                clusterConfigValidatorService
        );

        assertThatThrownBy(() -> resource.update("java.io.File",
                new ByteArrayInputStream(f("\"%s\"", file.toAbsolutePath()).getBytes(StandardCharsets.UTF_8))))
                .isInstanceOf(BadRequestException.class)
                .hasMessageContaining("Prevented loading of unsafe class");
    }