Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
9bc3aea59c | |||
f5ff302d4d | |||
cac8203bf5 | |||
e4532271cc | |||
faf6c91199 | |||
d0009e7a9c |
13
dist/smartssh.classes.sshconfig.d.ts
vendored
13
dist/smartssh.classes.sshconfig.d.ts
vendored
@ -1,4 +1,15 @@
|
|||||||
import "typings-global";
|
import "typings-global";
|
||||||
|
import { SshKey } from "./smartssh.classes.sshkey";
|
||||||
export declare class SshConfig {
|
export declare class SshConfig {
|
||||||
constructor();
|
sshKeyArray: SshKey[];
|
||||||
|
constructor(sshKeyArrayArg: SshKey[]);
|
||||||
|
/**
|
||||||
|
* stores a config file
|
||||||
|
*/
|
||||||
|
storeConfig(dirPathArg: string): any;
|
||||||
|
}
|
||||||
|
export interface configObject {
|
||||||
|
host: string;
|
||||||
|
authorized: boolean;
|
||||||
|
sshKey: SshKey;
|
||||||
}
|
}
|
||||||
|
18
dist/smartssh.classes.sshconfig.js
vendored
18
dist/smartssh.classes.sshconfig.js
vendored
@ -1,10 +1,24 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
require("typings-global");
|
require("typings-global");
|
||||||
|
var plugins = require("./smartssh.plugins");
|
||||||
var SshConfig = (function () {
|
var SshConfig = (function () {
|
||||||
function SshConfig() {
|
function SshConfig(sshKeyArrayArg) {
|
||||||
|
this.sshKeyArray = sshKeyArrayArg;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* stores a config file
|
||||||
|
*/
|
||||||
|
SshConfig.prototype.storeConfig = function (dirPathArg) {
|
||||||
|
var done = plugins.q.defer();
|
||||||
|
var configArray;
|
||||||
|
return done.promise;
|
||||||
|
};
|
||||||
return SshConfig;
|
return SshConfig;
|
||||||
}());
|
}());
|
||||||
exports.SshConfig = SshConfig;
|
exports.SshConfig = SshConfig;
|
||||||
|
;
|
||||||
|
var createConfigPath = function () {
|
||||||
|
};
|
||||||
|
;
|
||||||
|
|
||||||
//# sourceMappingURL=data:application/json;charset=utf8;base64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0IGludGVyZmFjZSBjb25maWdPYmplY3Qge1xuICAgIGhvc3Q6c3RyaW5nO1xuICAgIGF1dGhvcml6ZWQ6Ym9vbGVhbjtcbiAgICBzc2hLZXk6U3NoS2V5O1xufTtcblxuIl19
|
||||||
|
5
dist/smartssh.classes.sshdir.d.ts
vendored
5
dist/smartssh.classes.sshdir.d.ts
vendored
@ -1,10 +1,9 @@
|
|||||||
import "typings-global";
|
import "typings-global";
|
||||||
import { SshInstance } from "./smartssh.classes.sshinstance";
|
|
||||||
import { SshKey } from "./smartssh.classes.sshkey";
|
import { SshKey } from "./smartssh.classes.sshkey";
|
||||||
export declare class SshDir {
|
export declare class SshDir {
|
||||||
path: string;
|
path: string;
|
||||||
sshInstance: SshInstance;
|
private sshKeyArray;
|
||||||
constructor(sshInstanceArg: SshInstance, sshDirPathArg?: string);
|
constructor(sshKeyArray: SshKey[], sshDirPathArg?: string);
|
||||||
writeToDir(): void;
|
writeToDir(): void;
|
||||||
readFromDir(): void;
|
readFromDir(): void;
|
||||||
getKeys(): SshKey[];
|
getKeys(): SshKey[];
|
||||||
|
16
dist/smartssh.classes.sshdir.js
vendored
16
dist/smartssh.classes.sshdir.js
vendored
@ -3,17 +3,21 @@ require("typings-global");
|
|||||||
var plugins = require("./smartssh.plugins");
|
var plugins = require("./smartssh.plugins");
|
||||||
var helpers = require("./smartssh.classes.helpers");
|
var helpers = require("./smartssh.classes.helpers");
|
||||||
var SshDir = (function () {
|
var SshDir = (function () {
|
||||||
function SshDir(sshInstanceArg, sshDirPathArg) {
|
function SshDir(sshKeyArray, sshDirPathArg) {
|
||||||
var sshDirPath;
|
this.sshKeyArray = sshKeyArray;
|
||||||
if (sshDirPathArg) {
|
if (sshDirPathArg) {
|
||||||
sshDirPath = sshDirPathArg;
|
this.path = sshDirPathArg;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
sshDirPath = plugins.smartpath.get.home();
|
this.path = plugins.path.join(plugins.smartpath.get.home(), ".ssh/");
|
||||||
}
|
}
|
||||||
this.path = sshDirPath;
|
;
|
||||||
}
|
}
|
||||||
SshDir.prototype.writeToDir = function () {
|
SshDir.prototype.writeToDir = function () {
|
||||||
|
var _this = this;
|
||||||
|
this.sshKeyArray.forEach(function (sshKeyArg) {
|
||||||
|
sshKeyArg.store(_this.path);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
;
|
;
|
||||||
SshDir.prototype.readFromDir = function () {
|
SshDir.prototype.readFromDir = function () {
|
||||||
@ -25,4 +29,4 @@ var SshDir = (function () {
|
|||||||
}());
|
}());
|
||||||
exports.SshDir = SshDir;
|
exports.SshDir = SshDir;
|
||||||
|
|
||||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0c3NoLmNsYXNzZXMuc3NoZGlyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxRQUFPLGdCQUFnQixDQUFDLENBQUE7QUFDeEIsSUFBWSxPQUFPLFdBQU0sb0JBQW9CLENBQUMsQ0FBQTtBQUM5QyxJQUFZLE9BQU8sV0FBTSw0QkFBNEIsQ0FBQyxDQUFBO0FBSXREO0lBR0ksZ0JBQVksY0FBMEIsRUFBQyxhQUFxQjtRQUN4RCxJQUFJLFVBQWlCLENBQUM7UUFDdEIsRUFBRSxDQUFBLENBQUMsYUFBYSxDQUFDLENBQUEsQ0FBQztZQUNkLFVBQVUsR0FBRyxhQUFhLENBQUM7UUFDL0IsQ0FBQztRQUFDLElBQUksQ0FBQyxDQUFDO1lBQ0osVUFBVSxHQUFHLE9BQU8sQ0FBQyxTQUFTLENBQUMsR0FBRyxDQUFDLElBQUksRUFBRSxDQUFDO1FBQzlDLENBQUM7UUFDRCxJQUFJLENBQUMsSUFBSSxHQUFHLFVBQVUsQ0FBQztJQUMzQixDQUFDO0lBQ0QsMkJBQVUsR0FBVjtJQUVBLENBQUM7O0lBQ0QsNEJBQVcsR0FBWDtJQUVBLENBQUM7SU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||||||
|
6
dist/smartssh.classes.sshinstance.d.ts
vendored
6
dist/smartssh.classes.sshinstance.d.ts
vendored
@ -1,10 +1,9 @@
|
|||||||
import "typings-global";
|
import "typings-global";
|
||||||
import { SshDir } from "./smartssh.classes.sshdir";
|
|
||||||
import { SshKey } from "./smartssh.classes.sshkey";
|
import { SshKey } from "./smartssh.classes.sshkey";
|
||||||
export declare class SshInstance {
|
export declare class SshInstance {
|
||||||
|
private _sshKeyArray;
|
||||||
private _sshConfig;
|
private _sshConfig;
|
||||||
sshDir: SshDir;
|
private _sshDir;
|
||||||
protected sshKeyArray: SshKey[];
|
|
||||||
private _sshSync;
|
private _sshSync;
|
||||||
constructor(optionsArg?: {
|
constructor(optionsArg?: {
|
||||||
sshDirPath?: string;
|
sshDirPath?: string;
|
||||||
@ -23,6 +22,7 @@ export declare class SshInstance {
|
|||||||
* read ab SshInstance from disk
|
* read ab SshInstance from disk
|
||||||
*/
|
*/
|
||||||
readFromDisk(): void;
|
readFromDisk(): void;
|
||||||
|
private _makeConfig();
|
||||||
/**
|
/**
|
||||||
* method to invoke SshInstance _sync automatically when sshSync is true
|
* method to invoke SshInstance _sync automatically when sshSync is true
|
||||||
*/
|
*/
|
||||||
|
27
dist/smartssh.classes.sshinstance.js
vendored
27
dist/smartssh.classes.sshinstance.js
vendored
File diff suppressed because one or more lines are too long
19
dist/smartssh.classes.sshkey.d.ts
vendored
19
dist/smartssh.classes.sshkey.d.ts
vendored
@ -1,18 +1,21 @@
|
|||||||
import "typings-global";
|
import "typings-global";
|
||||||
export declare class SshKey {
|
export declare class SshKey {
|
||||||
private privKey;
|
private _privKey;
|
||||||
private pubKey;
|
private _pubKey;
|
||||||
private hostVar;
|
private _hostVar;
|
||||||
|
private _authorized;
|
||||||
constructor(optionsArg?: {
|
constructor(optionsArg?: {
|
||||||
private?: string;
|
private?: string;
|
||||||
public?: string;
|
public?: string;
|
||||||
host?: string;
|
host?: string;
|
||||||
|
authorized?: boolean;
|
||||||
});
|
});
|
||||||
host: string;
|
host: string;
|
||||||
privateKey: string;
|
privKey: string;
|
||||||
privateKeyBase64: string;
|
privKeyBase64: string;
|
||||||
publicKey: string;
|
pubKey: string;
|
||||||
publicKeyBase64: string;
|
pubKeyBase64: string;
|
||||||
type: string;
|
type: any;
|
||||||
|
read(filePathArg: any): void;
|
||||||
store(filePathArg?: string): void;
|
store(filePathArg?: string): void;
|
||||||
}
|
}
|
||||||
|
67
dist/smartssh.classes.sshkey.js
vendored
67
dist/smartssh.classes.sshkey.js
vendored
File diff suppressed because one or more lines are too long
1
dist/smartssh.plugins.d.ts
vendored
1
dist/smartssh.plugins.d.ts
vendored
@ -4,5 +4,6 @@ export declare let base64: any;
|
|||||||
export declare let fs: any;
|
export declare let fs: any;
|
||||||
export declare let minimatch: any;
|
export declare let minimatch: any;
|
||||||
export import path = require("path");
|
export import path = require("path");
|
||||||
|
export declare let q: any;
|
||||||
export import smartfile = require("smartfile");
|
export import smartfile = require("smartfile");
|
||||||
export import smartpath = require("smartpath");
|
export import smartpath = require("smartpath");
|
||||||
|
3
dist/smartssh.plugins.js
vendored
3
dist/smartssh.plugins.js
vendored
@ -5,7 +5,8 @@ exports.base64 = require("js-base64").Base64;
|
|||||||
exports.fs = require("fs-extra");
|
exports.fs = require("fs-extra");
|
||||||
exports.minimatch = require("minimatch");
|
exports.minimatch = require("minimatch");
|
||||||
exports.path = require("path");
|
exports.path = require("path");
|
||||||
|
exports.q = require("q");
|
||||||
exports.smartfile = require("smartfile");
|
exports.smartfile = require("smartfile");
|
||||||
exports.smartpath = require("smartpath");
|
exports.smartpath = require("smartpath");
|
||||||
|
|
||||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0c3NoLnBsdWdpbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sZ0JBQ1AsQ0FBQyxDQURzQjtBQUNULGlCQUFTLFdBQVcsV0FBVyxD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",
|
||||||
"description": "setups SSH quickly and in a painless manner",
|
"description": "setups SSH quickly and in a painless manner",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"typings": "dist/index.d.ts",
|
"typings": "dist/index.d.ts",
|
||||||
@ -27,7 +27,8 @@
|
|||||||
"fs-extra": "^0.30.0",
|
"fs-extra": "^0.30.0",
|
||||||
"js-base64": "^2.1.9",
|
"js-base64": "^2.1.9",
|
||||||
"minimatch": "^3.0.2",
|
"minimatch": "^3.0.2",
|
||||||
"smartfile": "^4.0.4",
|
"q": "^1.4.1",
|
||||||
|
"smartfile": "^4.0.5",
|
||||||
"smartpath": "^3.2.2",
|
"smartpath": "^3.2.2",
|
||||||
"typings-global": "^1.0.3",
|
"typings-global": "^1.0.3",
|
||||||
"typings-test": "^1.0.1"
|
"typings-test": "^1.0.1"
|
||||||
|
10
test/test.js
10
test/test.js
File diff suppressed because one or more lines are too long
@ -17,13 +17,13 @@ describe("smartssh",function(){
|
|||||||
testSshKey.type.should.equal("duplex");
|
testSshKey.type.should.equal("duplex");
|
||||||
});
|
});
|
||||||
it(".publicKey should be public key",function(){
|
it(".publicKey should be public key",function(){
|
||||||
testSshKey.publicKey.should.equal("someExamplePublicKey");
|
testSshKey.pubKey.should.equal("someExamplePublicKey");
|
||||||
});
|
});
|
||||||
it(".privateKey should be private key",function(){
|
it(".privateKey should be private key",function(){
|
||||||
testSshKey.privateKey.should.equal("someExamplePrivateKey");
|
testSshKey.privKey.should.equal("someExamplePrivateKey");
|
||||||
});
|
});
|
||||||
it(".publicKeyBase64 should be public key base 64 encoded",function(){
|
it(".publicKeyBase64 should be public key base 64 encoded",function(){
|
||||||
testSshKey.publicKeyBase64;
|
testSshKey.pubKeyBase64;
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
describe(".SshInstance",function(){
|
describe(".SshInstance",function(){
|
||||||
@ -56,7 +56,7 @@ describe("smartssh",function(){
|
|||||||
sshKeyArray[2].host.should.equal("github.com");
|
sshKeyArray[2].host.should.equal("github.com");
|
||||||
});
|
});
|
||||||
it(".getKey() should get a specific key selected by host",function(){
|
it(".getKey() should get a specific key selected by host",function(){
|
||||||
testSshInstance.getKey("github.com").publicKey.should.equal("someGitHubPublicKey");
|
testSshInstance.getKey("github.com").pubKey.should.equal("someGitHubPublicKey");
|
||||||
})
|
})
|
||||||
it(".removeKey() should remove a key",function(){
|
it(".removeKey() should remove a key",function(){
|
||||||
testSshInstance.removeKey(testSshInstance.getKey("bitbucket.org"));
|
testSshInstance.removeKey(testSshInstance.getKey("bitbucket.org"));
|
||||||
|
@ -1,8 +1,32 @@
|
|||||||
import "typings-global";
|
import "typings-global";
|
||||||
import * as plugins from "./smartssh.plugins";
|
import * as plugins from "./smartssh.plugins";
|
||||||
import * as helpers from "./smartssh.classes.helpers";
|
import * as helpers from "./smartssh.classes.helpers";
|
||||||
|
import {SshKey} from "./smartssh.classes.sshkey"
|
||||||
|
|
||||||
export class SshConfig {
|
export class SshConfig {
|
||||||
constructor(){
|
sshKeyArray:SshKey[];
|
||||||
|
constructor(sshKeyArrayArg:SshKey[]){
|
||||||
|
this.sshKeyArray = sshKeyArrayArg;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
/**
|
||||||
|
* stores a config file
|
||||||
|
*/
|
||||||
|
storeConfig(dirPathArg:string){
|
||||||
|
let done = plugins.q.defer();
|
||||||
|
let configArray:configObject[];
|
||||||
|
|
||||||
|
return done.promise;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
let createConfigPath = () => {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface configObject {
|
||||||
|
host:string;
|
||||||
|
authorized:boolean;
|
||||||
|
sshKey:SshKey;
|
||||||
|
};
|
||||||
|
|
||||||
|
@ -6,18 +6,20 @@ import {SshKey} from "./smartssh.classes.sshkey";
|
|||||||
import {SshConfig} from "./smartssh.classes.sshconfig";
|
import {SshConfig} from "./smartssh.classes.sshconfig";
|
||||||
export class SshDir { // sshDir class -> NOT EXPORTED, ONLY FOR INTERNAL USE
|
export class SshDir { // sshDir class -> NOT EXPORTED, ONLY FOR INTERNAL USE
|
||||||
path:string; // the path of the ssh directory
|
path:string; // the path of the ssh directory
|
||||||
sshInstance:SshInstance;
|
private sshKeyArray:SshKey[];
|
||||||
constructor(sshInstanceArg:SshInstance,sshDirPathArg?:string){
|
constructor(sshKeyArray:SshKey[],sshDirPathArg?:string){
|
||||||
let sshDirPath:string;
|
this.sshKeyArray = sshKeyArray;
|
||||||
if(sshDirPathArg){
|
if(sshDirPathArg){
|
||||||
sshDirPath = sshDirPathArg;
|
this.path = sshDirPathArg;
|
||||||
} else {
|
} else {
|
||||||
sshDirPath = plugins.smartpath.get.home();
|
this.path = plugins.path.join(plugins.smartpath.get.home(),".ssh/");
|
||||||
}
|
};
|
||||||
this.path = sshDirPath;
|
|
||||||
}
|
}
|
||||||
writeToDir(){ // syncs sshInstance to directory
|
writeToDir(){ // syncs sshInstance to directory
|
||||||
|
this.sshKeyArray.forEach((sshKeyArg) => {
|
||||||
|
sshKeyArg.store(this.path);
|
||||||
|
|
||||||
|
});
|
||||||
};
|
};
|
||||||
readFromDir(){ // syncs sshInstance from directory
|
readFromDir(){ // syncs sshInstance from directory
|
||||||
|
|
||||||
|
@ -7,29 +7,30 @@ import {SshConfig} from "./smartssh.classes.sshconfig";
|
|||||||
import {SshKey} from "./smartssh.classes.sshkey";
|
import {SshKey} from "./smartssh.classes.sshkey";
|
||||||
|
|
||||||
export class SshInstance {
|
export class SshInstance {
|
||||||
|
private _sshKeyArray:SshKey[]; //holds all ssh keys
|
||||||
private _sshConfig:SshConfig; // sshConfig (e.g. represents ~/.ssh/config)
|
private _sshConfig:SshConfig; // sshConfig (e.g. represents ~/.ssh/config)
|
||||||
sshDir:SshDir; // points to sshDir class instance.
|
private _sshDir:SshDir; // points to sshDir class instance.
|
||||||
protected sshKeyArray:SshKey[]; //holds all ssh keys
|
|
||||||
private _sshSync:boolean; // if set to true, the ssh dir will be kept in sync automatically
|
private _sshSync:boolean; // if set to true, the ssh dir will be kept in sync automatically
|
||||||
constructor(optionsArg:{sshDirPath?:string,sshSync?:boolean}={}){
|
constructor(optionsArg:{sshDirPath?:string,sshSync?:boolean}={}){
|
||||||
optionsArg ? void(0) : optionsArg = {};
|
optionsArg ? void(0) : optionsArg = {};
|
||||||
this.sshKeyArray = [];
|
this._sshKeyArray = [];
|
||||||
|
this._sshConfig = new SshConfig(this._sshKeyArray);
|
||||||
|
this._sshDir = new SshDir(this._sshKeyArray,optionsArg.sshDirPath);
|
||||||
this._sshSync = optionsArg.sshSync;
|
this._sshSync = optionsArg.sshSync;
|
||||||
this.sshDir = new SshDir(this,optionsArg.sshDirPath);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//altering methods
|
//altering methods
|
||||||
addKey(sshKeyArg:SshKey){
|
addKey(sshKeyArg:SshKey){
|
||||||
this._syncAuto("from");
|
this._syncAuto("from");
|
||||||
this.sshKeyArray.push(sshKeyArg);
|
this._sshKeyArray.push(sshKeyArg);
|
||||||
this._syncAuto("to");
|
this._syncAuto("to");
|
||||||
};
|
};
|
||||||
removeKey(sshKeyArg:SshKey){
|
removeKey(sshKeyArg:SshKey){
|
||||||
this._syncAuto("from");
|
this._syncAuto("from");
|
||||||
let filteredArray = this.sshKeyArray.filter((sshKeyArg2:SshKey) => {
|
let filteredArray = this._sshKeyArray.filter((sshKeyArg2:SshKey) => {
|
||||||
return (sshKeyArg != sshKeyArg2);
|
return (sshKeyArg != sshKeyArg2);
|
||||||
});
|
});
|
||||||
this.sshKeyArray = filteredArray;
|
this._sshKeyArray = filteredArray;
|
||||||
this._syncAuto("to");
|
this._syncAuto("to");
|
||||||
};
|
};
|
||||||
replaceKey(sshKeyOldArg:SshKey,sshKeyNewArg:SshKey){
|
replaceKey(sshKeyOldArg:SshKey,sshKeyNewArg:SshKey){
|
||||||
@ -42,7 +43,7 @@ export class SshInstance {
|
|||||||
//
|
//
|
||||||
getKey(hostArg:string):SshKey{
|
getKey(hostArg:string):SshKey{
|
||||||
this._syncAuto("from");
|
this._syncAuto("from");
|
||||||
let filteredArray = this.sshKeyArray.filter(function(keyArg){
|
let filteredArray = this._sshKeyArray.filter(function(keyArg){
|
||||||
return (keyArg.host == hostArg);
|
return (keyArg.host == hostArg);
|
||||||
});
|
});
|
||||||
if(filteredArray.length > 0){
|
if(filteredArray.length > 0){
|
||||||
@ -53,7 +54,7 @@ export class SshInstance {
|
|||||||
};
|
};
|
||||||
get sshKeys():SshKey[] {
|
get sshKeys():SshKey[] {
|
||||||
this._syncAuto("from");
|
this._syncAuto("from");
|
||||||
return this.sshKeyArray;
|
return this._sshKeyArray;
|
||||||
};
|
};
|
||||||
|
|
||||||
//FS methods
|
//FS methods
|
||||||
@ -72,6 +73,14 @@ export class SshInstance {
|
|||||||
this._sync("from");
|
this._sync("from");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ===============================================================
|
||||||
|
========================= Private Methods ========================
|
||||||
|
================================================================*/
|
||||||
|
|
||||||
|
private _makeConfig (){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* method to invoke SshInstance _sync automatically when sshSync is true
|
* method to invoke SshInstance _sync automatically when sshSync is true
|
||||||
*/
|
*/
|
||||||
@ -84,9 +93,9 @@ export class SshInstance {
|
|||||||
*/
|
*/
|
||||||
private _sync(directionArg:string){
|
private _sync(directionArg:string){
|
||||||
if(directionArg == "from"){
|
if(directionArg == "from"){
|
||||||
this.sshDir.readFromDir(); // call sync method of sshDir class;
|
this._sshDir.readFromDir(); // call sync method of sshDir class;
|
||||||
} else if(directionArg == "to") {
|
} else if(directionArg == "to") {
|
||||||
this.sshDir.writeToDir();
|
this._sshDir.writeToDir();
|
||||||
} else {
|
} else {
|
||||||
throw new Error("directionArg not recognised. Must be 'to' or 'from'");
|
throw new Error("directionArg not recognised. Must be 'to' or 'from'");
|
||||||
}
|
}
|
||||||
|
@ -3,71 +3,87 @@ import * as plugins from "./smartssh.plugins";
|
|||||||
import * as helpers from "./smartssh.classes.helpers";
|
import * as helpers from "./smartssh.classes.helpers";
|
||||||
|
|
||||||
export class SshKey {
|
export class SshKey {
|
||||||
private privKey:string;
|
private _privKey:string;
|
||||||
private pubKey:string;
|
private _pubKey:string;
|
||||||
private hostVar:string;
|
private _hostVar:string;
|
||||||
constructor(optionsArg:{private?:string,public?:string,host?:string}={}){
|
private _authorized:boolean;
|
||||||
this.privKey = optionsArg.private;
|
constructor(optionsArg:{private?:string,public?:string,host?:string,authorized?:boolean}={}){
|
||||||
this.pubKey = optionsArg.public;
|
this._privKey = optionsArg.private;
|
||||||
this.hostVar = optionsArg.host;
|
this._pubKey = optionsArg.public;
|
||||||
|
this._hostVar = optionsArg.host;
|
||||||
|
this._authorized = optionsArg.authorized;
|
||||||
};
|
};
|
||||||
|
|
||||||
// getters
|
// this.host
|
||||||
get host(){
|
get host(){
|
||||||
return this.hostVar;
|
return this._hostVar;
|
||||||
};
|
};
|
||||||
get privateKey(){
|
set host(hostArg:string){
|
||||||
return this.privKey;
|
this._hostVar = hostArg;
|
||||||
};
|
};
|
||||||
get privateKeyBase64(){
|
|
||||||
return plugins.base64.encode(this.privKey);
|
// this.privKey
|
||||||
|
get privKey(){
|
||||||
|
return this._privKey;
|
||||||
|
};
|
||||||
|
set privKey(privateKeyArg:string){
|
||||||
|
this._privKey = privateKeyArg;
|
||||||
|
};
|
||||||
|
|
||||||
|
// this.privKeyBase64
|
||||||
|
get privKeyBase64(){
|
||||||
|
return plugins.base64.encode(this._privKey);
|
||||||
}
|
}
|
||||||
get publicKey(){
|
set privKeyBase64(privateKeyArg:string) {
|
||||||
return this.pubKey;
|
this._privKey = plugins.base64.decode(privateKeyArg);
|
||||||
}
|
}
|
||||||
get publicKeyBase64(){
|
|
||||||
return plugins.base64.encode(this.pubKey);
|
// this.pubKey
|
||||||
|
get pubKey(){
|
||||||
|
return this._pubKey;
|
||||||
}
|
}
|
||||||
|
set pubKey(publicKeyArg:string){
|
||||||
|
this._pubKey = publicKeyArg;
|
||||||
|
};
|
||||||
|
|
||||||
|
// this.pubKeyBase64
|
||||||
|
get pubKeyBase64(){
|
||||||
|
return plugins.base64.encode(this._pubKey);
|
||||||
|
}
|
||||||
|
set pubKeyBase64(publicKeyArg:string) {
|
||||||
|
this._pubKey = plugins.base64.decode(publicKeyArg);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
get type(){
|
get type(){
|
||||||
if(this.privKey && this.pubKey){
|
if(this._privKey && this._pubKey){
|
||||||
return "duplex";
|
return "duplex";
|
||||||
} else if(this.privKey){
|
} else if(this._privKey){
|
||||||
return "private";
|
return "private";
|
||||||
} else if(this.pubKey){
|
} else if(this._pubKey){
|
||||||
return "public";
|
return "public";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
set type(someVlueArg:any){
|
||||||
// setters
|
console.log("the type of an SshKey connot be set. This value is autpcomputed.")
|
||||||
set host(hostArg:string){
|
|
||||||
this.hostVar = hostArg;
|
|
||||||
};
|
|
||||||
set privateKey(privateKeyArg:string){
|
|
||||||
this.privKey = privateKeyArg;
|
|
||||||
};
|
|
||||||
|
|
||||||
set privateKeyBase64(privateKeyArg:string) {
|
|
||||||
this.privKey = plugins.base64.decode(privateKeyArg);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
set publicKey(publicKeyArg:string){
|
// methods
|
||||||
this.pubKey = publicKeyArg;
|
read(filePathArg){
|
||||||
};
|
|
||||||
|
|
||||||
set publicKeyBase64(publicKeyArg:string) {
|
|
||||||
this.pubKey = plugins.base64.decode(publicKeyArg);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
store(filePathArg?:string){
|
store(filePathArg?:string){
|
||||||
let filePathObj = plugins.path.parse(filePathArg);
|
let filePathObj = plugins.path.parse(filePathArg);
|
||||||
if(filePathObj.ext = ".priv"){
|
if(filePathObj.ext = ".priv"){
|
||||||
plugins.smartfile.memory.toFsSync(this.privKey,{fileName:filePathObj.name + filePathObj.ext,filePath:filePathObj.dir});
|
plugins.smartfile.memory.toFsSync(this._privKey,filePathArg);
|
||||||
} else if (filePathObj.ext = ".pub"){
|
} else if (filePathObj.ext = ".pub"){
|
||||||
plugins.smartfile.memory.toFsSync(this.pubKey,{fileName:filePathObj.name + filePathObj.ext,filePath:filePathObj.dir});
|
plugins.smartfile.memory.toFsSync(this._pubKey,filePathArg);
|
||||||
} else { //we assume we are given a directory as filePathArg, so we store the whole key
|
} else { //we assume we are given a directory as filePathArg, so we store the whole key
|
||||||
plugins.fs.ensureDirSync(filePathObj.dir);
|
plugins.fs.ensureDirSync(filePathObj.dir);
|
||||||
this.store(plugins.path.join(filePathObj.dir,"key.priv")); // call this function recursivly
|
this.store(plugins.path.join(filePathObj.dir,"key.priv")); // call this function recursivly
|
||||||
this.store(plugins.path.join(filePathObj.dir,"key.pub")); // call this function recursivly
|
this.store(plugins.path.join(filePathObj.dir,"key.pub")); // call this function recursivly
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let testKey = new SshKey();
|
@ -4,5 +4,6 @@ export let base64 = require("js-base64").Base64;
|
|||||||
export let fs = require("fs-extra");
|
export let fs = require("fs-extra");
|
||||||
export let minimatch = require("minimatch");
|
export let minimatch = require("minimatch");
|
||||||
export import path = require("path");
|
export import path = require("path");
|
||||||
|
export let q = require("q");
|
||||||
export import smartfile = require("smartfile");
|
export import smartfile = require("smartfile");
|
||||||
export import smartpath = require("smartpath");
|
export import smartpath = require("smartpath");
|
Reference in New Issue
Block a user