import { omitBy } from 'lodash';
import { isCategoryDefinition } from '../apps/settings/utils';
import { throwGlobalError } from '../helpers/error';
-import { getJSON, post, RequestData } from '../helpers/request';
+import { getJSON, post, postJSON, RequestData } from '../helpers/request';
import { BranchParameters } from '../types/branch-like';
import {
ExtendedSettingDefinition,
}
export function encryptValue(value: string): Promise<{ encryptedValue: string }> {
- return getJSON('/api/settings/encrypt', { value }).catch(throwGlobalError);
+ return postJSON('/api/settings/encrypt', { value }).catch(throwGlobalError);
}
export function getLoginMessage(): Promise<{ message: string }> {
import org.sonar.api.config.internal.Encryption;
import org.sonar.api.config.internal.Settings;
+import org.sonar.api.server.ws.Change;
import org.sonar.api.server.ws.Request;
import org.sonar.api.server.ws.Response;
import org.sonar.api.server.ws.WebService;
.setDescription("Encrypt a setting value.<br>" +
"Requires 'Administer System' permission.")
.setSince("6.1")
+ .setPost(true)
.setHandler(this)
.setInternal(true)
- .setResponseExample(getClass().getResource("encrypt-example.json"));
+ .setResponseExample(getClass().getResource("encrypt-example.json"))
+ .setChangelog(new Change("9.9.4", "Move from GET to POST."));
action.createParam(PARAM_VALUE)
.setRequired(true)
WebService.Action definition = ws.getDef();
assertThat(definition.key()).isEqualTo("encrypt");
- assertThat(definition.isPost()).isFalse();
+ assertThat(definition.isPost()).isTrue();
assertThat(definition.isInternal()).isTrue();
assertThat(definition.responseExampleAsString()).isNotEmpty();
assertThat(definition.params()).hasSize(1);
*/
public EncryptWsResponse encrypt(EncryptRequest request) {
return call(
- new GetRequest(path("encrypt"))
+ new PostRequest(path("encrypt"))
.setParam("value", request.getValue()),
EncryptWsResponse.parser());
}