Feature Idea
Add a new method to jenkins.py which will provide the possibility for the API token revoke
Jenkinsapi VERSION
2.222.4.3
Jenkins VERSION
2.222.4.3
SUMMARY
Right now we have the possibility to jenkins.generate_new_api_token but for the rotating purposes, there is no any option to revoke existed API token
EXPECTED RESULTS
Something like that
def revoke_api_token(self, token_name='Token By jenkinsapi python', token_uuid):
subUrl = 'me/descriptorByName/jenkins.security.ApiTokenProperty/revoke'
url = '%s%s' % (self.baseurl, subUrl)
data = urlencode({'TokenName': token_name})
response = self.requester.post_and_confirm_status(url, data=data)
print("Token has been succesfully revoked")
ACTUAL RESULTS
Actual results are only to parse HTML:
https://jenkins_url/cjoc/user/user_name/configure
Get Value of token name and token UUID
and create custom method which will make possible to revoke exiting API token
Jenkinsapi VERSION
2.222.4.3
Jenkins VERSION
2.222.4.3
SUMMARY
Right now we have the possibility to jenkins.generate_new_api_token but for the rotating purposes, there is no any option to revoke existed API token
EXPECTED RESULTS
Something like that
ACTUAL RESULTS
Actual results are only to parse HTML: https://jenkins_url/cjoc/user/user_name/configure Get Value of token name and token UUID and create custom method which will make possible to revoke exiting API token
USEFUL INFORMATION
https://www.jenkins.io/blog/2018/07/02/new-api-token-system/