Skip to content

Commit

Permalink
Make bitbucket authn optional.
Browse files Browse the repository at this point in the history
  • Loading branch information
ralphbean committed Nov 9, 2013
1 parent f25be82 commit 84a0c51
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions bugwarrior/services/bitbucket.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,18 @@ class BitbucketService(IssueService):
def __init__(self, *args, **kw):
super(BitbucketService, self).__init__(*args, **kw)

login = self.config.get(self.target, 'login')
password = self.config.get(self.target, 'passw')
if not password or password.startswith('@oracle:'):
username = self.config.get(self.target, 'username')
service = "bitbucket://%s@bitbucket.org/%s" % (login, username)
password = get_service_password(service, login, oracle=password,
interactive=self.config.interactive)

self.auth = (login, password)
self.auth = None
if self.config.has_option(self.target, 'login'):
login = self.config.get(self.target, 'login')
password = self.config.get(self.target, 'passw')
if not password or password.startswith('@oracle:'):
username = self.config.get(self.target, 'username')
service = "bitbucket://%s@bitbucket.org/%s" % (login, username)
password = get_service_password(
service, login, oracle=password,
interactive=self.config.interactive)

self.auth = (login, password)

@classmethod
def validate_config(cls, config, target):
Expand Down

0 comments on commit 84a0c51

Please sign in to comment.