I have a working python script that automatically adds/resolves comments/tasks to our PRs. I authenticate thusly:
https://developer.atlassian.com/cloud/bitbucket/authentication-for-apps/ Doesn't list a grant type that takes username and password. How should I get a request.Session object that logs in with username and password and uses the user's permissions? (I am an admin of my workspace, I expect all REST calls to be valid as my user unless specifically prohibited by merge restriction.)
Hi @Denise Skidmore ,
If you're accessing bitbucket via a python script, you might consider using access tokens or app passwords as described here - https://developer.atlassian.com/cloud/bitbucket/rest/intro/#authentication
HTH!
~ Hariharan
App passwords are still secrets the local user may not have. I'm looking for a way for someone to log in with their normal password or maybe the SSL connection that already exists for push/pull activity, not an app specific password.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To your first question: I like using the getpass library to get things like credentials:
client_secret = os.environ.get('lint_client_secret', getpass.getpass())
...but you could also use use input() or the readline library if you want to get fancy.
Regarding your second question: I suspect you'd need to use a custom authentication handler to add the JWT bearer token to a request.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This extra step has not seemed necessary. The values stored in "secured" environment variables are read by the script just fine. The automated script that runs on the server runs just fine. I'm looking at ways to modify the auth when running it on a dev machine that doesn't have those OS variables.
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.