Skip to content

Python script to manage github account + rotate github password with mfa

Notifications You must be signed in to change notification settings

JayDoubleu/python-github-mgmt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

python-github-mgmt

Python script to manage github account

from github_mgmt import Github_mgmt
gmgmt = Github_mgmt(github_username='username',
                    github_password='password',
                    github_otp_secret='otp_secret')
authorizations = gmgmt.get_authorizations()
for authorization in authorizations:
    gmgmt.delete_authorization(authorization['id'])

https://developer.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/ https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization

data = {"scopes": ["repo"], "note": "admin script"}
authorization = gmgmt.create_authorization(data)
oauth_token = authorization['token']
invitations = gmgmt.get_repo_invitations()
for invitation in gmgmt.get_repo_invitations():
    gmgmt.accept_repo_invitation(invitation['id'])
for invitation in gmgmt.get_repo_invitations():
    gmgmt.decline_repo_invitation(invitation['id'])
gmgmt.rotate_password('new_password')

About

Python script to manage github account + rotate github password with mfa

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages