public class StashUrlRewritingClient extends Object implements com.atlassian.stash.rest.client.api.StashClient
StashClient
, which rewrites all URLs (for projects, repositories and pull requests) to use the
Display URL from an application link (as the Display URL may be different from the RPC URL).
This is to handle a case when SAML is used with Bitbucket Server as the session cookies are being set on a different domain and without this rewrite user would not be authorized.
com.atlassian.stash.rest.client.api.StashClient.PullRequestDirection, com.atlassian.stash.rest.client.api.StashClient.PullRequestsOrder, com.atlassian.stash.rest.client.api.StashClient.PullRequestStateFilter
Constructor and Description |
---|
StashUrlRewritingClient(com.atlassian.stash.rest.client.api.StashClient stashClient,
URI applinkDisplayUrl,
URI applinkRpcUrl) |
Modifier and Type | Method and Description |
---|---|
boolean |
addProjectGroupPermission(String projectKey,
String groupName,
com.atlassian.stash.rest.client.api.entity.ProjectPermission permission) |
boolean |
addProjectUserPermission(String projectKey,
String userName,
com.atlassian.stash.rest.client.api.entity.ProjectPermission permission) |
com.atlassian.stash.rest.client.api.entity.Comment |
addPullRequestGeneralComment(String projectKey,
String repositorySlug,
long pullRequestId,
String text) |
boolean |
addRepositoryKey(String projectKey,
String repositorySlug,
String publicKey,
String keyLabel,
com.atlassian.stash.rest.client.api.entity.Permission keyPermission) |
boolean |
addRepositoryUserPermission(String projectKey,
String repositorySlug,
String userName,
com.atlassian.stash.rest.client.api.entity.Permission permission) |
com.atlassian.stash.rest.client.api.entity.Task |
addTask(com.atlassian.stash.rest.client.api.entity.TaskAnchor anchor,
String text) |
boolean |
addUserKey(String publicKey,
String keyLabel) |
com.atlassian.stash.rest.client.api.entity.PullRequestMergeability |
canMergePullRequest(String projectKey,
String repositorySlug,
long pullRequestId) |
boolean |
createCodeAnnotations(String projectKey,
String repositorySlug,
String revision,
String reportKey,
Iterable<com.atlassian.stash.rest.client.api.entity.CodeAnnotation> codeAnnotations) |
boolean |
createProject(String projectKey,
String name,
String type,
String description) |
com.atlassian.stash.rest.client.api.entity.PullRequestStatus |
createPullRequest(String title,
String description,
com.atlassian.stash.rest.client.api.entity.PullRequestRef fromRef,
com.atlassian.stash.rest.client.api.entity.PullRequestRef toRef,
Iterable<String> reviewers) |
com.atlassian.stash.rest.client.api.entity.PullRequestStatus |
createPullRequest(String title,
String description,
com.atlassian.stash.rest.client.api.entity.PullRequestRef fromRef,
com.atlassian.stash.rest.client.api.entity.PullRequestRef toRef,
Iterable<String> reviewers,
com.atlassian.stash.rest.client.api.AvatarRequest avatarRequest) |
com.atlassian.stash.rest.client.api.entity.Report |
createReport(String projectKey,
String repositorySlug,
String revision,
com.atlassian.stash.rest.client.api.entity.Report report) |
boolean |
createRepository(String projectKey,
String name,
String scmId,
boolean forkable) |
void |
deleteCodeAnnotation(String projectKey,
String repositorySlug,
String revision,
String reportKey,
String externalId) |
void |
deleteCodeAnnotations(String projectKey,
String repositorySlug,
String revision,
String reportKey) |
boolean |
deleteProject(String projectKey) |
void |
deleteReport(String projectKey,
String repositorySlug,
String revision,
String key) |
boolean |
deleteRepository(String projectKey,
String repositorySlug) |
com.atlassian.stash.rest.client.api.entity.Repository |
forkRepository(String sourceProjectKey,
String sourceRepositorySlug,
String targetProjectKey,
String targetRepositorySlug) |
com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.Project> |
getAccessibleProjects(long start,
long limit) |
com.atlassian.stash.rest.client.api.entity.ApplicationProperties |
getApplicationProperties() |
List<com.atlassian.stash.rest.client.api.entity.CodeAnnotation> |
getCodeAnnotations(String projectKey,
String repositorySlug,
String revision) |
com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.UserSshKey> |
getCurrentUserKeys(long start,
long limit) |
Optional<com.atlassian.stash.rest.client.api.entity.Permission> |
getCurrentUserRepositoryPermission(String projectKey,
String repositorySlug) |
com.atlassian.stash.rest.client.api.entity.MirrorServer |
getMirror(String mirrorId) |
com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.ProjectGroupPermission> |
getProjectGroupPermissions(String projectKey,
String filter,
long start,
long limit) |
com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.Repository> |
getProjectRepositories(String projectKey,
long start,
long limit) |
com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.ProjectUserPermission> |
getProjectUserPermissions(String projectKey,
String filter,
long start,
long limit) |
com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.PullRequestStatus> |
getPullRequestsByRepository(String projectKey,
String repositorySlug,
String branchName,
com.atlassian.stash.rest.client.api.StashClient.PullRequestDirection direction,
com.atlassian.stash.rest.client.api.StashClient.PullRequestStateFilter stateFilter,
com.atlassian.stash.rest.client.api.StashClient.PullRequestsOrder order,
long start,
long limit) |
com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.PullRequestStatus> |
getPullRequestsByRepository(String projectKey,
String repositorySlug,
String branchName,
com.atlassian.stash.rest.client.api.StashClient.PullRequestDirection direction,
com.atlassian.stash.rest.client.api.StashClient.PullRequestStateFilter stateFilter,
com.atlassian.stash.rest.client.api.StashClient.PullRequestsOrder order,
long start,
long limit,
com.atlassian.stash.rest.client.api.AvatarRequest avatarRequest) |
Optional<com.atlassian.stash.rest.client.api.entity.Report> |
getReport(String projectKey,
String repositorySlug,
String revision,
String key) |
com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.Report> |
getReports(String projectKey,
String repositorySlug,
String revision,
long start,
long limit) |
com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.Repository> |
getRepositories(String projectKey,
String query,
long start,
long limit) |
com.atlassian.stash.rest.client.api.entity.Repository |
getRepository(String projectKey,
String repositorySlug) |
com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.Branch> |
getRepositoryBranches(String projectKey,
String repositorySlug,
String query,
long start,
long limit) |
com.atlassian.stash.rest.client.api.entity.Branch |
getRepositoryDefaultBranch(String projectKey,
String repositorySlug) |
com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.RepositorySshKey> |
getRepositoryKeys(String projectKey,
String repositorySlug,
long start,
long limit) |
com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.MirrorServer> |
getRepositoryMirrors(long repositoryId,
long start,
long limit) |
com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.Tag> |
getRepositoryTags(String projectKey,
String repositorySlug,
String query,
long start,
long limit) |
com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.User> |
getUsers(String filterForUsername,
long start,
long limit) |
boolean |
isRepositoryKey(String projectKey,
String repositorySlug,
String publicKey) |
boolean |
isUserKey(String publicKey) |
com.atlassian.stash.rest.client.api.entity.PullRequestStatus |
mergePullRequest(String projectKey,
String repositorySlug,
long pullRequestId,
long version) |
com.atlassian.stash.rest.client.api.entity.PullRequestStatus |
mergePullRequest(String projectKey,
String repositorySlug,
long pullRequestId,
long version,
com.atlassian.stash.rest.client.api.AvatarRequest avatarRequest) |
boolean |
projectExists(String projectKey) |
boolean |
removeUserKey(long keyId) |
boolean |
removeUserKey(String publicKey) |
boolean |
updateCodeAnnotation(String projectKey,
String repositorySlug,
String revision,
String reportKey,
String externalId,
com.atlassian.stash.rest.client.api.entity.CodeAnnotation codeAnnotation) |
boolean |
updateProject(String projectKey,
String newProjectKey,
String name,
String description) |
com.atlassian.stash.rest.client.api.entity.Task |
updateTask(long taskId,
String text) |
com.atlassian.stash.rest.client.api.entity.Task |
updateTask(long taskId,
com.atlassian.stash.rest.client.api.entity.TaskState taskState) |
com.atlassian.stash.rest.client.api.entity.Task |
updateTask(long taskId,
com.atlassian.stash.rest.client.api.entity.TaskState taskState,
String text) |
@NotNull public com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.Project> getAccessibleProjects(long start, long limit)
getAccessibleProjects
in interface com.atlassian.stash.rest.client.api.StashClient
@NotNull public com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.Repository> getRepositories(@Nullable String projectKey, @Nullable String query, long start, long limit)
getRepositories
in interface com.atlassian.stash.rest.client.api.StashClient
@Nullable public com.atlassian.stash.rest.client.api.entity.Repository getRepository(@NotNull String projectKey, @NotNull String repositorySlug)
getRepository
in interface com.atlassian.stash.rest.client.api.StashClient
@NotNull public com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.Branch> getRepositoryBranches(@NotNull String projectKey, @NotNull String repositorySlug, @Nullable String query, long start, long limit)
getRepositoryBranches
in interface com.atlassian.stash.rest.client.api.StashClient
public com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.Tag> getRepositoryTags(@NotNull String projectKey, @NotNull String repositorySlug, @Nullable String query, long start, long limit)
getRepositoryTags
in interface com.atlassian.stash.rest.client.api.StashClient
@NotNull public com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.MirrorServer> getRepositoryMirrors(long repositoryId, long start, long limit)
getRepositoryMirrors
in interface com.atlassian.stash.rest.client.api.StashClient
@Nullable public com.atlassian.stash.rest.client.api.entity.MirrorServer getMirror(@NotNull String mirrorId)
getMirror
in interface com.atlassian.stash.rest.client.api.StashClient
@Nullable public com.atlassian.stash.rest.client.api.entity.Branch getRepositoryDefaultBranch(@NotNull String projectKey, @NotNull String repositorySlug)
getRepositoryDefaultBranch
in interface com.atlassian.stash.rest.client.api.StashClient
@NotNull public com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.RepositorySshKey> getRepositoryKeys(@NotNull String projectKey, @NotNull String repositorySlug, long start, long limit)
getRepositoryKeys
in interface com.atlassian.stash.rest.client.api.StashClient
public boolean addRepositoryKey(@NotNull String projectKey, @NotNull String repositorySlug, @NotNull String publicKey, @Nullable String keyLabel, @NotNull com.atlassian.stash.rest.client.api.entity.Permission keyPermission)
addRepositoryKey
in interface com.atlassian.stash.rest.client.api.StashClient
public boolean isRepositoryKey(@NotNull String projectKey, @NotNull String repositorySlug, @NotNull String publicKey)
isRepositoryKey
in interface com.atlassian.stash.rest.client.api.StashClient
@NotNull public com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.UserSshKey> getCurrentUserKeys(long start, long limit)
getCurrentUserKeys
in interface com.atlassian.stash.rest.client.api.StashClient
public boolean isUserKey(@NotNull String publicKey)
isUserKey
in interface com.atlassian.stash.rest.client.api.StashClient
public boolean addUserKey(@NotNull String publicKey, @Nullable String keyLabel)
addUserKey
in interface com.atlassian.stash.rest.client.api.StashClient
public boolean removeUserKey(@NotNull String publicKey)
removeUserKey
in interface com.atlassian.stash.rest.client.api.StashClient
public boolean removeUserKey(long keyId)
removeUserKey
in interface com.atlassian.stash.rest.client.api.StashClient
public boolean createProject(@NotNull String projectKey, @NotNull String name, @NotNull String type, @NotNull String description)
createProject
in interface com.atlassian.stash.rest.client.api.StashClient
public boolean createRepository(@NotNull String projectKey, @NotNull String name, @NotNull String scmId, boolean forkable)
createRepository
in interface com.atlassian.stash.rest.client.api.StashClient
public boolean deleteProject(@NotNull String projectKey)
deleteProject
in interface com.atlassian.stash.rest.client.api.StashClient
public boolean deleteRepository(@NotNull String projectKey, @NotNull String repositorySlug)
deleteRepository
in interface com.atlassian.stash.rest.client.api.StashClient
@NotNull public com.atlassian.stash.rest.client.api.entity.ApplicationProperties getApplicationProperties()
getApplicationProperties
in interface com.atlassian.stash.rest.client.api.StashClient
public Optional<com.atlassian.stash.rest.client.api.entity.Permission> getCurrentUserRepositoryPermission(@NotNull String projectKey, @NotNull String repositorySlug)
getCurrentUserRepositoryPermission
in interface com.atlassian.stash.rest.client.api.StashClient
public boolean addRepositoryUserPermission(@NotNull String projectKey, @NotNull String repositorySlug, @NotNull String userName, @NotNull com.atlassian.stash.rest.client.api.entity.Permission permission)
addRepositoryUserPermission
in interface com.atlassian.stash.rest.client.api.StashClient
@NotNull public com.atlassian.stash.rest.client.api.entity.PullRequestStatus createPullRequest(@NotNull String title, @Nullable String description, @NotNull com.atlassian.stash.rest.client.api.entity.PullRequestRef fromRef, @NotNull com.atlassian.stash.rest.client.api.entity.PullRequestRef toRef, @NotNull Iterable<String> reviewers, @Nullable com.atlassian.stash.rest.client.api.AvatarRequest avatarRequest)
createPullRequest
in interface com.atlassian.stash.rest.client.api.StashClient
@NotNull public com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.PullRequestStatus> getPullRequestsByRepository(@NotNull String projectKey, @NotNull String repositorySlug, @Nullable String branchName, @Nullable com.atlassian.stash.rest.client.api.StashClient.PullRequestDirection direction, @Nullable com.atlassian.stash.rest.client.api.StashClient.PullRequestStateFilter stateFilter, @Nullable com.atlassian.stash.rest.client.api.StashClient.PullRequestsOrder order, long start, long limit, @Nullable com.atlassian.stash.rest.client.api.AvatarRequest avatarRequest)
getPullRequestsByRepository
in interface com.atlassian.stash.rest.client.api.StashClient
@NotNull public com.atlassian.stash.rest.client.api.entity.PullRequestStatus mergePullRequest(@NotNull String projectKey, @NotNull String repositorySlug, long pullRequestId, long version, @Nullable com.atlassian.stash.rest.client.api.AvatarRequest avatarRequest)
mergePullRequest
in interface com.atlassian.stash.rest.client.api.StashClient
@NotNull public com.atlassian.stash.rest.client.api.entity.PullRequestMergeability canMergePullRequest(@NotNull String projectKey, @NotNull String repositorySlug, long pullRequestId)
canMergePullRequest
in interface com.atlassian.stash.rest.client.api.StashClient
@NotNull public com.atlassian.stash.rest.client.api.entity.Repository forkRepository(@NotNull String sourceProjectKey, @NotNull String sourceRepositorySlug, @NotNull String targetProjectKey, @NotNull String targetRepositorySlug)
forkRepository
in interface com.atlassian.stash.rest.client.api.StashClient
@NotNull public com.atlassian.stash.rest.client.api.entity.Comment addPullRequestGeneralComment(@NotNull String projectKey, @NotNull String repositorySlug, long pullRequestId, @NotNull String text)
addPullRequestGeneralComment
in interface com.atlassian.stash.rest.client.api.StashClient
@NotNull public com.atlassian.stash.rest.client.api.entity.Task addTask(@NotNull com.atlassian.stash.rest.client.api.entity.TaskAnchor anchor, @NotNull String text)
addTask
in interface com.atlassian.stash.rest.client.api.StashClient
@NotNull public com.atlassian.stash.rest.client.api.entity.Task updateTask(long taskId, @Nullable com.atlassian.stash.rest.client.api.entity.TaskState taskState, @Nullable String text)
updateTask
in interface com.atlassian.stash.rest.client.api.StashClient
@NotNull public com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.User> getUsers(@Nullable String filterForUsername, long start, long limit)
getUsers
in interface com.atlassian.stash.rest.client.api.StashClient
@NotNull public com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.Repository> getProjectRepositories(@NotNull String projectKey, long start, long limit)
getProjectRepositories
in interface com.atlassian.stash.rest.client.api.StashClient
public boolean projectExists(@NotNull String projectKey)
projectExists
in interface com.atlassian.stash.rest.client.api.StashClient
public boolean updateProject(@NotNull String projectKey, @NotNull String newProjectKey, @NotNull String name, @Nullable String description)
updateProject
in interface com.atlassian.stash.rest.client.api.StashClient
public com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.ProjectGroupPermission> getProjectGroupPermissions(@NotNull String projectKey, @Nullable String filter, long start, long limit)
getProjectGroupPermissions
in interface com.atlassian.stash.rest.client.api.StashClient
public boolean addProjectGroupPermission(@NotNull String projectKey, @NotNull String groupName, @NotNull com.atlassian.stash.rest.client.api.entity.ProjectPermission permission)
addProjectGroupPermission
in interface com.atlassian.stash.rest.client.api.StashClient
public com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.ProjectUserPermission> getProjectUserPermissions(@NotNull String projectKey, @Nullable String filter, long start, long limit)
getProjectUserPermissions
in interface com.atlassian.stash.rest.client.api.StashClient
public boolean addProjectUserPermission(@NotNull String projectKey, @NotNull String userName, @NotNull com.atlassian.stash.rest.client.api.entity.ProjectPermission permission)
addProjectUserPermission
in interface com.atlassian.stash.rest.client.api.StashClient
@NotNull public com.atlassian.stash.rest.client.api.entity.PullRequestStatus createPullRequest(@NotNull String title, @Nullable String description, @NotNull com.atlassian.stash.rest.client.api.entity.PullRequestRef fromRef, @NotNull com.atlassian.stash.rest.client.api.entity.PullRequestRef toRef, @NotNull Iterable<String> reviewers)
createPullRequest
in interface com.atlassian.stash.rest.client.api.StashClient
@NotNull public com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.PullRequestStatus> getPullRequestsByRepository(@NotNull String projectKey, @NotNull String repositorySlug, @Nullable String branchName, @Nullable com.atlassian.stash.rest.client.api.StashClient.PullRequestDirection direction, @Nullable com.atlassian.stash.rest.client.api.StashClient.PullRequestStateFilter stateFilter, @Nullable com.atlassian.stash.rest.client.api.StashClient.PullRequestsOrder order, long start, long limit)
getPullRequestsByRepository
in interface com.atlassian.stash.rest.client.api.StashClient
@NotNull public com.atlassian.stash.rest.client.api.entity.PullRequestStatus mergePullRequest(@NotNull String projectKey, @NotNull String repositorySlug, long pullRequestId, long version)
mergePullRequest
in interface com.atlassian.stash.rest.client.api.StashClient
@NotNull public com.atlassian.stash.rest.client.api.entity.Task updateTask(long taskId, @NotNull com.atlassian.stash.rest.client.api.entity.TaskState taskState)
updateTask
in interface com.atlassian.stash.rest.client.api.StashClient
@NotNull public com.atlassian.stash.rest.client.api.entity.Task updateTask(long taskId, @NotNull String text)
updateTask
in interface com.atlassian.stash.rest.client.api.StashClient
@NotNull public com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.Report> getReports(@NotNull String projectKey, @NotNull String repositorySlug, @NotNull String revision, long start, long limit)
getReports
in interface com.atlassian.stash.rest.client.api.StashClient
@NotNull public Optional<com.atlassian.stash.rest.client.api.entity.Report> getReport(@NotNull String projectKey, @NotNull String repositorySlug, @NotNull String revision, @NotNull String key)
getReport
in interface com.atlassian.stash.rest.client.api.StashClient
@NotNull public com.atlassian.stash.rest.client.api.entity.Report createReport(@NotNull String projectKey, @NotNull String repositorySlug, @NotNull String revision, @NotNull com.atlassian.stash.rest.client.api.entity.Report report)
createReport
in interface com.atlassian.stash.rest.client.api.StashClient
public void deleteReport(@NotNull String projectKey, @NotNull String repositorySlug, @NotNull String revision, @NotNull String key)
deleteReport
in interface com.atlassian.stash.rest.client.api.StashClient
@NotNull public List<com.atlassian.stash.rest.client.api.entity.CodeAnnotation> getCodeAnnotations(@NotNull String projectKey, @NotNull String repositorySlug, @NotNull String revision)
getCodeAnnotations
in interface com.atlassian.stash.rest.client.api.StashClient
public boolean createCodeAnnotations(@NotNull String projectKey, @NotNull String repositorySlug, @NotNull String revision, @NotNull String reportKey, @NotNull Iterable<com.atlassian.stash.rest.client.api.entity.CodeAnnotation> codeAnnotations)
createCodeAnnotations
in interface com.atlassian.stash.rest.client.api.StashClient
public boolean updateCodeAnnotation(@NotNull String projectKey, @NotNull String repositorySlug, @NotNull String revision, @NotNull String reportKey, @NotNull String externalId, @NotNull com.atlassian.stash.rest.client.api.entity.CodeAnnotation codeAnnotation)
updateCodeAnnotation
in interface com.atlassian.stash.rest.client.api.StashClient
public void deleteCodeAnnotation(@NotNull String projectKey, @NotNull String repositorySlug, @NotNull String revision, @NotNull String reportKey, @NotNull String externalId)
deleteCodeAnnotation
in interface com.atlassian.stash.rest.client.api.StashClient
Copyright © 2021 Atlassian Software Systems Pty Ltd. All rights reserved.