MXS-2574: Add PATCH for /users/inet endpoint

The alteration of user passwords is now done inside MaxScale. This
prevents the possibility of a user locking themselves out.
This commit is contained in:
Markus Mäkelä
2019-06-24 14:44:11 +03:00
parent 77671a2393
commit aac0ecc373
9 changed files with 115 additions and 13 deletions

View File

@ -195,11 +195,6 @@ describe("Alter Commands", function() {
.should.be.rejected
})
it('rejects alteration to current user', function() {
return doCommand('-u bob -p bob alter user bob bob2')
.should.be.rejected
})
it('creates user', function() {
return verifyCommand('create user testuser test', 'users/inet/testuser')
})
@ -212,5 +207,13 @@ describe("Alter Commands", function() {
return doCommand('destroy user testuser')
})
it('allows alteration to current user', function() {
return verifyCommand('create user bob bob --type=admin', 'users/inet/bob')
.then(() => doCommand('-u bob -p bob alter user bob bob2'))
.then(() => doCommand('-u bob -p bob2 alter user bob bob'))
.then(() => doCommand('-u bob -p bob list servers'))
.then(() => doCommand('-u bob -p bob destroy user bob'))
})
after(stopMaxScale)
});