Skip to content

Commit

Permalink
Adding change password to confluence.py
Browse files Browse the repository at this point in the history
Adding a function for the following methods:
- changeUserPassword
- changeMyPassword

https://developer.atlassian.com/server/confluence/remote-confluence-methods/
  • Loading branch information
justin-octo authored Jul 19, 2023
1 parent 5d9cd15 commit a72b088
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions atlassian/confluence.py
Original file line number Diff line number Diff line change
Expand Up @@ -2871,6 +2871,31 @@ def add_user(self, email, fullname, username, password):
}
self.post(url, data=data)

def change_user_password(self, username, password):
"""
That method related to changing user password via json rpc for Confluence Server
"""
params = {"name": username}
url = "rpc/json-rpc/confluenceservice-v2"
data = {
"jsonrpc": "2.0",
"method": "changeUserPassword",
"params": [params, password],
}
self.post(url, data=data)

def change_my_password(self, oldpass, newpass):
"""
That method related to changing calling user's own password via json rpc for Confluence Server
"""
url = "rpc/json-rpc/confluenceservice-v2"
data = {
"jsonrpc": "2.0",
"method": "changeMyPassword",
"params": [oldpass, newpass],
}
self.post(url, data=data)

def add_user_to_group(self, username, group_name):
"""
Add given user to a group
Expand Down

0 comments on commit a72b088

Please sign in to comment.