navBuilder.repo(repository).clone("git")
.buildAbsoluteWithoutUsername();
Now that this code is deprecated, how should I get the url without the username?
Seems this is the suggested route
repositoryService.getCloneLinks(new RepositoryCloneLinksRequest.Builder().repository(repository) .protocol("http").build());
but it takes user context into account
Community moderators have prevented the ability to post new answers.
So that seems to be an oversight on my part when I deprecated the original method and added the new one.
For the moment it is safe to use the original method chain until 2.12 but probably not beyond that (when it may be removed).
In the mean time I will fix this by adding a way for you to disable username in the URL (probably on the request object). This should be available in 2.12.
You can track it here: https://jira.atlassian.com/browse/STASH-4450
An update on this: I've added a way in 2.12 to supply the user (or no user) in addition to the default behaviour which is to the currently authenticated user. So the code you would write is:
repositoryService.getCloneLinks(new RepositoryCloneLinksRequest.Builder().repository(repository).user(null).protocol("http").build());
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.