Skip to content

Commit

Permalink
fixup! chore: Add an ability to manually configure bitbucket oAuth token
Browse files Browse the repository at this point in the history
  • Loading branch information
vinokurig committed Jun 27, 2022
1 parent 19cfabf commit 28b2220
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@

/**
* Dummy implementation of @{@link OAuthAuthenticator} used in the case if no Bitbucket Server
* integration is configured.
* integration is configured, e.g. when a manually added token secret is present in the user
* namespace.
*/
public class NoopOAuthAuthenticator extends OAuthAuthenticator {
public NoopOAuthAuthenticator() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public BitbucketURLParser(
}
}

private boolean isUserTokenExists(String repositoryUrl) {
private boolean isUserTokenPresent(String repositoryUrl) {
String serverUrl = getServerUrl(repositoryUrl);
if (Pattern.compile(format(bitbucketUrlPatternTemplate, serverUrl))
.matcher(repositoryUrl)
Expand All @@ -88,7 +88,7 @@ public boolean isValid(@NotNull String url) {
} else {
// If Bitbucket server URL is not configured try to find it in a manually added user namespace
// token.
return isUserTokenExists(url);
return isUserTokenPresent(url);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public GitlabUrlParser(
}
}

private boolean isUserTokenExists(String repositoryUrl) {
private boolean isUserTokenPresent(String repositoryUrl) {
Optional<String> serverUrlOptional = getServerUrl(repositoryUrl);
if (serverUrlOptional.isPresent()) {
String serverUrl = serverUrlOptional.get();
Expand All @@ -94,7 +94,7 @@ public boolean isValid(@NotNull String url) {
} else {
// If Gitlab URL is not configured, try to find it in a manually added user namespace
// token.
return isUserTokenExists(url);
return isUserTokenPresent(url);
}
}

Expand Down

0 comments on commit 28b2220

Please sign in to comment.