I'd like to automate portions of a branching, tagging, and merging strategy. I'd like to create branches, get diffs between two branches, check for open Pull Requests, apply tags, push those branches to Bitbucket, and open Pull Requests. However, many of these actions require authenticating and authorizing a user, and I'd like them to be authorized against a particular user so when the changes are pushed to Bitbucket, you can see the person who ran the scripts that took the actions (for traceability).
I see ways to authenticate a user with their username and password, but these methods are documented as not working with 2FA turned on. Other methods are about authenticating the application and not a user of the system, which I'm not sure is acceptable in the context.