Java Code Examples for jetbrains.buildServer.serverSide.crypt.RSACipher#decryptWebRequestData()

The following examples show how to use jetbrains.buildServer.serverSide.crypt.RSACipher#decryptWebRequestData() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PluginPropertiesUtil.java    From teamcity-kubernetes-plugin with Apache License 2.0 5 votes vote down vote up
private static void setEncryptedProperty(final String paramName, final HttpServletRequest request,
                                         final BasePropertiesBean bean, final boolean includeEmptyValues) {
    String propName = paramName.substring(ENCRYPTED_PROPERTY_PREFIX.length());
    String propertyValue = RSACipher.decryptWebRequestData(request.getParameter(paramName));
    if (propertyValue != null && (includeEmptyValues || propertyValue.length() > 0)) {
        bean.setProperty(propName, toUnixLineFeeds(propertyValue));
    }
}
 
Example 2
Source File: SlackNotifierSettingsController.java    From tcSlackBuildNotifier with MIT License 5 votes vote down vote up
private HashMap<String, Object> handleConfigurationChange(HttpServletRequest request) throws IOException, SlackConfigValidationException {
    setRequestParams(request);
    if(!isNullOrEmpty(proxyPassword)){
        proxyPassword = RSACipher.decryptWebRequestData(proxyPassword);
    }

    Validate(teamName, token, botName, iconUrl, defaultChannel, maxCommitsToDisplay, showBuildAgent, proxyHost, proxyPort, proxyUser, proxyPassword);

    this.config.setTeamName(teamName);
    this.config.setToken(token);
    this.config.getContent().setBotName(botName);
    this.config.getContent().setIconUrl(iconUrl);
    this.config.setDefaultChannel(defaultChannel);
    this.config.getContent().setMaxCommitsToDisplay(Integer.parseInt(maxCommitsToDisplay));
    this.config.getContent().setShowBuildAgent(Boolean.parseBoolean(showBuildAgent));
    this.config.getContent().setShowCommits(Boolean.parseBoolean(showCommits));
    this.config.getContent().setShowCommitters(Boolean.parseBoolean(showCommitters));
    this.config.setFilterBranchName(filterBranchName);
    this.config.getContent().setShowTriggeredBy(Boolean.parseBoolean(showTriggeredBy));
    this.config.getContent().setShowElapsedBuildTime((Boolean.parseBoolean(showElapsedBuildTime)));
    this.config.getContent().setShowFailureReason((Boolean.parseBoolean(showFailureReason)));

    this.config.setProxyHost(proxyHost);
    this.config.setProxyPort(isNullOrEmpty(proxyPort) ? null : Integer.parseInt(proxyPort));
    this.config.setProxyUsername(proxyUser);
    this.config.setProxyPassword(proxyPassword);

    this.config.save();

    HashMap<String, Object> params = new HashMap<String, Object>();
    params.put("message", "Saved");
    return params;
}
 
Example 3
Source File: TelegramSettingsBean.java    From teamcity-telegram-plugin with Apache License 2.0 4 votes vote down vote up
public void setEncryptedBotToken(String encrypted) {
  this.botToken = RSACipher.decryptWebRequestData(encrypted);
}
 
Example 4
Source File: TelegramSettingsBean.java    From teamcity-telegram-plugin with Apache License 2.0 4 votes vote down vote up
public void setEncryptedProxyPassword(String encrypted) {
  this.proxyPassword = RSACipher.decryptWebRequestData(encrypted);
}
 
Example 5
Source File: S3StoragePropertiesUtil.java    From teamcity-s3-artifact-storage-plugin with Apache License 2.0 4 votes vote down vote up
@NotNull
private static Property encryptedProperty(@NotNull final String paramName, @NotNull final HttpServletRequest request) {
  final String encryptedValue = RSACipher.decryptWebRequestData(request.getParameter(paramName));
  return Property.of(encodedPropertyName(paramName), toUnixLineFeeds(encryptedValue));
}
 
Example 6
Source File: ManageSQSActionController.java    From TeamCity.SonarQubePlugin with Apache License 2.0 4 votes vote down vote up
private String decryptIfNeeded(@Nullable final String value) {
    return value != null ? RSACipher.decryptWebRequestData(value) : null;
}