You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
maksar
changed the title
Adding token authentication to Bitbucket server (Stash).
Adding token authentication to Bitbucket server (Stash). Indore-2017.2.x
Dec 13, 2017
maksar
changed the title
Adding token authentication to Bitbucket server (Stash). Indore-2017.2.x
Adding token authentication to Bitbucket server (Stash). 2017.2.x
Dec 13, 2017
Hi @maksar, thanks for submitting this feature and excuse me for not responding promptly. There is a number of issues with this PR though, mostly related to user/password authentication:
When StashPublisher::vote(String, String, String) calls postAsync it assumes there is a non-null token, which is not the case when user/password mode is chosen. It causes an NPE;
For existing configurations that do not have authentication type explicitly set, corresponding edit build feature form in the admin UI assumes the mode is token, does not show username and password fields with current values, but displays an empty token field. To address that with as little effort as possible you must make the username and password option first there, and then the token option;
By modifying CommitStatusPublisher.xml you have altered our Kotlin DSL syntax, introducing new compound authType property, but making old simple userName and password properties in existing configuration scripts invalid. To maintain backward compatibility with old DSL would you mind to add something like that just after the new compound property definition:
<param name="stashUsername" dslName="userName" deprecated="true">
<description>
A username for Bitbucket Server connection
</description>
</param>
<param name="secure:stashPassword" dslName="password" deprecated="true">
<description>
A password for Bitbucket Server connection
</description>
</param>
The important thing here is the deprecated attribute.
Thanks!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BitBucket 5.5 introduced personal user tokens authentication: https://confluence.atlassian.com/bitbucketserver/bitbucket-server-5-5-release-notes-938037662.html
I made changed to the Stash configuration similar to GitHub (dropdown with auth type selection). Preview: https://www.dropbox.com/s/8vbppp0rvx1jxrr/Screenshot%202017-10-27%2017.02.12.png?dl=0