@canonical/jujulib
Version:
Juju API client
62 lines (61 loc) • 2.09 kB
JavaScript
/**
Juju KeyUpdater version 1.
This facade is available on:
Controller-machine-agent
Machine-agent
NOTE: This file was generated using the Juju schema
from Juju 3.3 at the git SHA 65fa4c1ee5.
Do not manually edit this file.
*/
import { autoBind } from "../../utils.js";
/**
KeyUpdaterAPI implements the KeyUpdater interface and is the concrete
implementation of the api end point.
*/
class KeyUpdaterV1 {
constructor(transport, info) {
this.NAME = "KeyUpdater";
this.VERSION = 1;
this._transport = transport;
this._info = info;
// Automatically bind all methods to instances.
autoBind(this);
}
/**
AuthorisedKeys reports the authorised ssh keys for the specified machines.
The current implementation relies on global authorised keys being stored in the model config.
This will change as new user management and authorisation functionality is added.
*/
authorisedKeys(params) {
return new Promise((resolve, reject) => {
const req = {
type: "KeyUpdater",
request: "AuthorisedKeys",
version: 1,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
WatchAuthorisedKeys starts a watcher to track changes to the authorised ssh keys
for the specified machines.
The current implementation relies on global authorised keys being stored in the model config.
This will change as new user management and authorisation functionality is added.
*/
watchAuthorisedKeys(params) {
return new Promise((resolve, reject) => {
const req = {
type: "KeyUpdater",
request: "WatchAuthorisedKeys",
version: 1,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
}
KeyUpdaterV1.NAME = "KeyUpdater";
KeyUpdaterV1.VERSION = 1;
export default KeyUpdaterV1;
//# sourceMappingURL=KeyUpdaterV1.js.map