Skip to content

Commit 80a7dbc

Browse files
committed
VIOLATIONS_KEYSTORE_PATH #14
1 parent d9ff181 commit 80a7dbc

File tree

3 files changed

+39
-10
lines changed

3 files changed

+39
-10
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@
33

44
Changelog of Violation comments to bitbucket server lib.
55

6+
## Unreleased
7+
### No issue
8+
9+
**doc**
10+
11+
12+
[d9ff1815255b7dc](https://github.com/tomasbjerre/violation-comments-to-bitbucket-server-lib/commit/d9ff1815255b7dc) Tomas Bjerre *2020-08-29 13:58:10*
13+
14+
615
## 1.98
716
### No issue
817

src/main/java/se/bjurr/violations/comments/bitbucketserver/lib/BitbucketServerCommentsProvider.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ public BitbucketServerCommentsProvider(
7676
final Integer proxyHostPort = violationCommentsToBitbucketApi.getProxyHostPort();
7777
final String proxyUser = violationCommentsToBitbucketApi.getProxyUser();
7878
final String proxyPassword = violationCommentsToBitbucketApi.getProxyPassword();
79-
final String keyStorePath = violationCommentsToBitbucketApi.getPropKeyStorePath();
80-
final String keyStorePass = violationCommentsToBitbucketApi.getPropKeyStorePass();
79+
final String keyStorePath = violationCommentsToBitbucketApi.getKeyStorePath();
80+
final String keyStorePass = violationCommentsToBitbucketApi.getKeyStorePass();
8181
this.client =
8282
new BitbucketServerClient(
8383
violationsLogger,

src/main/java/se/bjurr/violations/comments/bitbucketserver/lib/ViolationCommentsToBitbucketServerApi.java

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ public static ViolationCommentsToBitbucketServerApi violationCommentsToBitbucket
3737
private String propPersonalAccessToken = DEFAULT_PROP_PERSONAL_ACCESS_TOKEN;
3838
private String propKeyStorePath = DEFAULT_PROP_KEYSTORE_PATH;
3939
private String propKeyStorePass = DEFAULT_PROP_KEYSTORE_PASS;
40+
private String keyStorePath;
41+
private String keyStorePass;
4042
private int pullRequestId;
4143
private String repoSlug;
4244
private String username;
@@ -71,10 +73,10 @@ private ViolationCommentsToBitbucketServerApi() {}
7173
private void checkState() {
7274
final boolean noUsername = isNullOrEmpty(this.username) || isNullOrEmpty(this.password);
7375
final boolean noPat = isNullOrEmpty(this.personalAccessToken);
74-
final boolean noCert = isNullOrEmpty(this.propKeyStorePath);
76+
final boolean noCert = isNullOrEmpty(this.keyStorePath);
7577
if (noUsername && noPat && noCert) {
7678
throw new IllegalStateException(
77-
"User and Password, or personal access token, or keystore path and keystore pass, must be set! They can be set with the API or by setting properties.\n"
79+
"User and Password or personal access token, or keystore path and keystore pass, must be set! They can be set with the API or by setting properties.\n"
7880
+ //
7981
"Username/password:\n"
8082
+ //
@@ -197,6 +199,14 @@ public String getPropKeyStorePass() {
197199
return this.propKeyStorePass;
198200
}
199201

202+
public String getKeyStorePass() {
203+
return this.keyStorePass;
204+
}
205+
206+
public String getKeyStorePath() {
207+
return this.keyStorePath;
208+
}
209+
200210
private void populateFromEnvironmentVariables() {
201211
if (System.getProperty(this.propUsername) != null) {
202212
this.username = firstNonNull(this.username, System.getProperty(this.propUsername));
@@ -209,12 +219,12 @@ private void populateFromEnvironmentVariables() {
209219
firstNonNull(this.personalAccessToken, System.getProperty(this.propPersonalAccessToken));
210220
}
211221
if (System.getProperty(this.propKeyStorePath) != null) {
212-
this.propKeyStorePath =
213-
firstNonNull(this.propKeyStorePath, System.getProperty(this.propKeyStorePath));
222+
this.keyStorePath =
223+
firstNonNull(this.keyStorePath, System.getProperty(this.propKeyStorePath));
214224
}
215225
if (System.getProperty(this.propKeyStorePass) != null) {
216-
this.propKeyStorePass =
217-
firstNonNull(this.propKeyStorePass, System.getProperty(this.propKeyStorePass));
226+
this.keyStorePass =
227+
firstNonNull(this.keyStorePass, System.getProperty(this.propKeyStorePass));
218228
}
219229
}
220230

@@ -351,12 +361,22 @@ public ViolationCommentsToBitbucketServerApi withCommentTemplate(final String co
351361
}
352362

353363
public ViolationCommentsToBitbucketServerApi withKeyStorePath(final String keyStorePath) {
354-
this.propKeyStorePath = keyStorePath;
364+
this.keyStorePath = keyStorePath;
355365
return this;
356366
}
357367

358368
public ViolationCommentsToBitbucketServerApi withKeyStorePass(final String keyStorePass) {
359-
this.propKeyStorePass = keyStorePass;
369+
this.keyStorePass = keyStorePass;
370+
return this;
371+
}
372+
373+
public ViolationCommentsToBitbucketServerApi withPropKeyStorePath(final String propKeyStorePath) {
374+
this.propKeyStorePath = propKeyStorePath;
375+
return this;
376+
}
377+
378+
public ViolationCommentsToBitbucketServerApi withPropKeyStorePass(final String propKeyStorePass) {
379+
this.propKeyStorePass = propKeyStorePass;
360380
return this;
361381
}
362382

0 commit comments

Comments
 (0)