f5-corkscrew
Advanced tools
Comparing version 0.12.0 to 0.13.0
import { AppMap, BigipConfObj } from './models'; | ||
import { TmosRegExTree } from './regex'; | ||
/** | ||
* dig base config information like vlans/SelfIPs | ||
* @param configTree bigip config as json tree | ||
* @returns raw config objects | ||
*/ | ||
export declare function digBaseConfig(configTree: BigipConfObj): Promise<any[]>; | ||
/** | ||
* scans vs config, and discovers child configs | ||
@@ -11,0 +5,0 @@ * @param vsName virtual server name |
@@ -23,3 +23,3 @@ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getHostname = exports.uniqueList = exports.digVsConfig = exports.digBaseConfig = void 0; | ||
exports.getHostname = exports.uniqueList = exports.digVsConfig = void 0; | ||
const logger_1 = __importDefault(require("./logger")); | ||
@@ -30,39 +30,2 @@ const objects_1 = require("./utils/objects"); | ||
/** | ||
* dig base config information like vlans/SelfIPs | ||
* @param configTree bigip config as json tree | ||
* @returns raw config objects | ||
*/ | ||
function digBaseConfig(configTree) { | ||
var _a, _b, _c, _d; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const confs = []; | ||
if ((_a = configTree === null || configTree === void 0 ? void 0 : configTree.net) === null || _a === void 0 ? void 0 : _a.vlan) { | ||
// get vlans | ||
for (const [key, value] of Object.entries(configTree.net.vlan)) { | ||
confs.push(`net vlan ${key} {${value}}`); | ||
} | ||
} | ||
if ((_b = configTree === null || configTree === void 0 ? void 0 : configTree.net) === null || _b === void 0 ? void 0 : _b.self) { | ||
// get ip addresses | ||
for (const [key, value] of Object.entries(configTree.net.self)) { | ||
confs.push(`net self ${key} {${value}}`); | ||
} | ||
} | ||
if ((_c = configTree === null || configTree === void 0 ? void 0 : configTree.net) === null || _c === void 0 ? void 0 : _c["route-domain"]) { | ||
// get route-domains | ||
for (const [key, value] of Object.entries(configTree.net["route-domain"])) { | ||
confs.push(`net route-domain ${key} {${value}}`); | ||
} | ||
} | ||
if ((_d = configTree === null || configTree === void 0 ? void 0 : configTree.auth) === null || _d === void 0 ? void 0 : _d.partition) { | ||
// get partitions | ||
for (const [key, value] of Object.entries(configTree.auth.partition)) { | ||
confs.push(`auth partition ${key} {${value}}`); | ||
} | ||
} | ||
return confs; | ||
}); | ||
} | ||
exports.digBaseConfig = digBaseConfig; | ||
/** | ||
* scans vs config, and discovers child configs | ||
@@ -231,6 +194,6 @@ * @param vsName virtual server name | ||
logger_1.default.debug(`profile references found: `, profileNames); | ||
// eslint-disable-next-line prefer-const | ||
const config = []; | ||
const map = []; | ||
profileNames.forEach(name => { | ||
// check the ltm profiles | ||
const x = (0, objects_1.pathValueFromKey)(configObject.ltm.profile, name); | ||
@@ -240,2 +203,7 @@ if (x) { | ||
} | ||
// check apm profiles | ||
const y = (0, objects_1.pathValueFromKey)(configObject.apm.profile, name); | ||
if (y) { | ||
config.push(`apm profile access ${y.path} ${y.key} {${y.value}}`); | ||
} | ||
}); | ||
@@ -267,2 +235,3 @@ const defaultProfiles = profileNames.length - config.length; | ||
yield ruleNames.forEach((name) => __awaiter(this, void 0, void 0, function* () { | ||
var _a; | ||
// search config, return matches | ||
@@ -301,13 +270,15 @@ const x = (0, objects_1.pathValueFromKey)(configObject.ltm.rule, name); | ||
} | ||
// if we have any data-groups, find data groups in irule | ||
const dataGroups = Object.keys(configObject.ltm['data-group'].internal); | ||
if (dataGroups.length > 0) { | ||
yield (0, digiRules_1.digDataGroupsiniRule)(x.value, dataGroups) | ||
.then((dgNamesInRule) => __awaiter(this, void 0, void 0, function* () { | ||
yield dgNamesInRule.forEach((dg) => __awaiter(this, void 0, void 0, function* () { | ||
const dgBody = configObject.ltm['data-group'].internal[dg]; | ||
const fullDgConfig = `ltm data-group internal ${dg} { ${dgBody} }`; | ||
config.push(fullDgConfig); | ||
// if we have any internal data-groups, find data groups in irule | ||
if ((_a = configObject.ltm['data-group']) === null || _a === void 0 ? void 0 : _a.internal) { | ||
const dataGroups = Object.keys(configObject.ltm['data-group'].internal); | ||
if (dataGroups.length > 0) { | ||
yield (0, digiRules_1.digDataGroupsiniRule)(x.value, dataGroups) | ||
.then((dgNamesInRule) => __awaiter(this, void 0, void 0, function* () { | ||
yield dgNamesInRule.forEach((dg) => __awaiter(this, void 0, void 0, function* () { | ||
const dgBody = configObject.ltm['data-group'].internal[dg]; | ||
const fullDgConfig = `ltm data-group internal ${dg} { ${dgBody} }`; | ||
config.push(fullDgConfig); | ||
})); | ||
})); | ||
})); | ||
} | ||
} | ||
@@ -314,0 +285,0 @@ } |
'use strict'; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k; |
@@ -389,4 +389,2 @@ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */ | ||
const startTime = process.hrtime.bigint(); // start pack timer | ||
// collect base information like vlans/IPs | ||
const base = yield (0, digConfigs_1.digBaseConfig)(this.configObject); | ||
// extract DO classes (base information expanded) | ||
@@ -402,3 +400,2 @@ const doClasses = yield (0, digDoClassesAuto_1.digDoConfig)(this.configObject); | ||
sources: this.configFiles, | ||
base, | ||
doClasses | ||
@@ -405,0 +402,0 @@ }, |
@@ -46,3 +46,9 @@ /** | ||
}; | ||
apm?: unknown; | ||
apm?: { | ||
profile?: { | ||
access?: { | ||
[key: string]: string; | ||
}; | ||
}; | ||
}; | ||
auth?: { | ||
@@ -49,0 +55,0 @@ partition?: unknown; |
@@ -11,3 +11,7 @@ /* | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
@@ -14,0 +18,0 @@ if (k2 === undefined) k2 = k; |
@@ -11,3 +11,7 @@ /* | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
@@ -14,0 +18,0 @@ if (k2 === undefined) k2 = k; |
@@ -5,3 +5,3 @@ { | ||
"author": "F5DevCentral", | ||
"version": "0.12.0", | ||
"version": "0.13.0", | ||
"license": "Apache-2.0", | ||
@@ -8,0 +8,0 @@ "homepage": "https://github.com/f5devcentral/f5-corkscrew#readme", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
462817
5642