Include user name in console proxy logs.
This commit is contained in:
parent
fe48811047
commit
b03f38ff22
@ -481,6 +481,12 @@ const setUpConsoleProxy = (webServer, xo) => {
|
||||
if (!await xo.hasPermissions(user.id, [ [ id, 'operate' ] ])) { // eslint-disable-line space-before-keywords
|
||||
throw new InvalidCredential()
|
||||
}
|
||||
|
||||
const { remoteAddress } = socket
|
||||
debug('+ Console proxy (%s - %s)', user.name, remoteAddress)
|
||||
socket.on('close', () => {
|
||||
debug('- Console proxy (%s - %s)', user.name, remoteAddress)
|
||||
})
|
||||
}
|
||||
|
||||
const xapi = xo.getXAPI(id, ['VM', 'VM-controller'])
|
||||
|
@ -369,7 +369,13 @@ export default class Xo extends EventEmitter {
|
||||
// TODO: this method will no longer be async when users are
|
||||
// integrated to the main collection.
|
||||
async getUser (id) {
|
||||
return (await this._getUser(id)).properties
|
||||
const user = (await this._getUser(id)).properties
|
||||
|
||||
// TODO: remove when no longer the email property has been
|
||||
// completely eradicated.
|
||||
user.name = user.email
|
||||
|
||||
return user
|
||||
}
|
||||
|
||||
async getUserByName (username, returnNullIfMissing) {
|
||||
|
Loading…
Reference in New Issue
Block a user