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 |
---|---|
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 |
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.AvatarRequest avatarRequest) |
boolean |
createRepository(String projectKey,
String name,
String scmId,
boolean forkable) |
boolean |
deleteProject(String projectKey) |
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() |
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.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) |
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) |
Map<String,String> |
getStashApplicationProperties()
Deprecated.
use
getApplicationProperties() instead |
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.AvatarRequest avatarRequest) |
boolean |
removeUserKey(long keyId) |
boolean |
removeUserKey(String publicKey) |
com.atlassian.stash.rest.client.api.entity.Task |
updateTask(long taskId,
com.atlassian.stash.rest.client.api.entity.TaskState taskState,
String text) |
@Nonnull 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
@Nonnull 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(@Nonnull String projectKey, @Nonnull String repositorySlug)
getRepository
in interface com.atlassian.stash.rest.client.api.StashClient
@Nonnull public com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.Branch> getRepositoryBranches(@Nonnull String projectKey, @Nonnull 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(@Nonnull String projectKey, @Nonnull String repositorySlug, @Nullable String query, long start, long limit)
getRepositoryTags
in interface com.atlassian.stash.rest.client.api.StashClient
@Nonnull 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.Branch getRepositoryDefaultBranch(@Nonnull String projectKey, @Nonnull String repositorySlug)
getRepositoryDefaultBranch
in interface com.atlassian.stash.rest.client.api.StashClient
@Nonnull public com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.RepositorySshKey> getRepositoryKeys(@Nonnull String projectKey, @Nonnull String repositorySlug, long start, long limit)
getRepositoryKeys
in interface com.atlassian.stash.rest.client.api.StashClient
public boolean addRepositoryKey(@Nonnull String projectKey, @Nonnull String repositorySlug, @Nonnull String publicKey, @Nullable String keyLabel, @Nonnull com.atlassian.stash.rest.client.api.entity.Permission keyPermission)
addRepositoryKey
in interface com.atlassian.stash.rest.client.api.StashClient
public boolean isRepositoryKey(@Nonnull String projectKey, @Nonnull String repositorySlug, @Nonnull String publicKey)
isRepositoryKey
in interface com.atlassian.stash.rest.client.api.StashClient
@Nonnull 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(@Nonnull String publicKey)
isUserKey
in interface com.atlassian.stash.rest.client.api.StashClient
public boolean addUserKey(@Nonnull String publicKey, @Nullable String keyLabel)
addUserKey
in interface com.atlassian.stash.rest.client.api.StashClient
public boolean removeUserKey(@Nonnull 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(@Nonnull String projectKey, @Nonnull String name, @Nonnull String type, @Nonnull String description)
createProject
in interface com.atlassian.stash.rest.client.api.StashClient
public boolean createRepository(@Nonnull String projectKey, @Nonnull String name, @Nonnull String scmId, boolean forkable)
createRepository
in interface com.atlassian.stash.rest.client.api.StashClient
public boolean deleteProject(@Nonnull String projectKey)
deleteProject
in interface com.atlassian.stash.rest.client.api.StashClient
public boolean deleteRepository(@Nonnull String projectKey, @Nonnull String repositorySlug)
deleteRepository
in interface com.atlassian.stash.rest.client.api.StashClient
@Deprecated @Nonnull public Map<String,String> getStashApplicationProperties()
getApplicationProperties()
insteadgetStashApplicationProperties
in interface com.atlassian.stash.rest.client.api.StashClient
@Nonnull 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(@Nonnull String projectKey, @Nonnull String repositorySlug)
getCurrentUserRepositoryPermission
in interface com.atlassian.stash.rest.client.api.StashClient
public boolean addRepositoryUserPermission(@Nonnull String projectKey, @Nonnull String repositorySlug, @Nonnull String userName, @Nonnull com.atlassian.stash.rest.client.api.entity.Permission permission)
addRepositoryUserPermission
in interface com.atlassian.stash.rest.client.api.StashClient
@Nonnull public com.atlassian.stash.rest.client.api.entity.PullRequestStatus createPullRequest(@Nonnull String title, @Nullable String description, @Nonnull com.atlassian.stash.rest.client.api.entity.PullRequestRef fromRef, @Nonnull com.atlassian.stash.rest.client.api.entity.PullRequestRef toRef, @Nonnull Iterable<String> reviewers, @Nullable com.atlassian.stash.rest.client.api.AvatarRequest avatarRequest)
createPullRequest
in interface com.atlassian.stash.rest.client.api.StashClient
@Nonnull public com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.PullRequestStatus> getPullRequestsByRepository(@Nonnull String projectKey, @Nonnull 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
@Nonnull public com.atlassian.stash.rest.client.api.entity.PullRequestStatus mergePullRequest(@Nonnull String projectKey, @Nonnull 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
@Nonnull public com.atlassian.stash.rest.client.api.entity.PullRequestMergeability canMergePullRequest(@Nonnull String projectKey, @Nonnull String repositorySlug, long pullRequestId)
canMergePullRequest
in interface com.atlassian.stash.rest.client.api.StashClient
@Nonnull public com.atlassian.stash.rest.client.api.entity.Repository forkRepository(@Nonnull String sourceProjectKey, @Nonnull String sourceRepositorySlug, @Nonnull String targetProjectKey, @Nonnull String targetRepositorySlug)
forkRepository
in interface com.atlassian.stash.rest.client.api.StashClient
@Nonnull public com.atlassian.stash.rest.client.api.entity.Comment addPullRequestGeneralComment(@Nonnull String projectKey, @Nonnull String repositorySlug, long pullRequestId, @Nonnull String text)
addPullRequestGeneralComment
in interface com.atlassian.stash.rest.client.api.StashClient
@Nonnull public com.atlassian.stash.rest.client.api.entity.Task addTask(@Nonnull com.atlassian.stash.rest.client.api.entity.TaskAnchor anchor, @Nonnull String text)
addTask
in interface com.atlassian.stash.rest.client.api.StashClient
Copyright © 2017 Atlassian Software Systems Pty Ltd. All rights reserved.