Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/* eslint-disable prefer-spread */
const PRODUCTS = require('@f5devcentral/f5-cloud-libs').sharedConstants.PRODUCTS;
const AjvValidator = require('./ajvValidator');
const configItems = require('./configItems.json');
const ConfigManager = require('./configManager');
const doUtil = require('./doUtil');
const Logger = require('./logger');
const State = require('./state');
const LOCALHOST_ADDRS = ['localhost', '127.0.0.1'];
const NAMELESS_CLASSES = require('./sharedConstants').NAMELESS_CLASSES;
const PROCESS_MAX_TIMEOUT = require('./sharedConstants').ENDPOINT_MAX_TIMEOUT;
const SCHEMA_VERSION = require('../../schema/latest/base.schema.json').properties.schemaVersion.enum[0];
const STATUS = require('./sharedConstants').STATUS;
const logger = new Logger(module);
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
const chai = require('chai');
const chaiAsPromised = require('chai-as-promised');
chai.use(chaiAsPromised);
const assert = chai.assert;
const sinon = require('sinon');
const URL = require('url');
const PRODUCTS = require('@f5devcentral/f5-cloud-libs').sharedConstants.PRODUCTS;
const SCHEMA_VERSION = require('../../../../src/schema/latest/base.schema.json').properties.schemaVersion.enum[0];
const configItems = require('../../../../src/lib/configItems.json');
const ConfigManagerMock = require('../../../../src/lib/configManager');
const doUtilMock = require('../../../../src/lib/doUtil');
const InspectHandler = require('../../../../src/lib/inspectHandler');
describe('inspectHandler', () => {
let expectedDeclaration;
let inspectHandler;
const basicInspectHandlerAsserts = (data, code, status, message, errors) => {
if (typeof errors !== 'undefined') {
if (Array.isArray(errors)) {
assert.deepStrictEqual(inspectHandler.getErrors(), errors);
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
const net = require('net');
const exec = require('child_process').exec;
const dns = require('dns');
const BigIp = require('@f5devcentral/f5-cloud-libs').bigIp;
const httpUtil = require('@f5devcentral/f5-cloud-libs').httpUtil;
const cloudUtil = require('@f5devcentral/f5-cloud-libs').util;
const PRODUCTS = require('@f5devcentral/f5-cloud-libs').sharedConstants.PRODUCTS;
const Logger = require('./logger');
const ipF5 = require('../schema/latest/formats').f5ip;
const logger = new Logger(module);
/**
* @module
*/
module.exports = {
/**
* The @f5devcentral/f5-cloud-libs/BigIp object
* @external BigIp
*/
/**
* Gets and initializes a [BigIp]{@link external:BigIp} object
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
const fs = require('fs');
const EventEmitter = require('events');
const httpUtil = require('@f5devcentral/f5-cloud-libs').httpUtil;
const cloudUtil = require('@f5devcentral/f5-cloud-libs').util;
const PRODUCTS = require('@f5devcentral/f5-cloud-libs').sharedConstants.PRODUCTS;
const doUtil = require('../lib/doUtil');
const cryptoUtil = require('../lib/cryptoUtil');
const ConfigManager = require('../lib/configManager');
const DeclarationHandler = require('../lib/declarationHandler');
const Logger = require('../lib/logger');
const Response = require('../lib/response');
const ConfigResponse = require('../lib/configResponse');
const InfoResponse = require('../lib/infoResponse');
const InspectResponse = require('../lib/inspectResponse');
const TaskResponse = require('../lib/taskResponse');
const State = require('../lib/state');
const SshUtil = require('../lib/sshUtil');
const Validator = require('../lib/validator');
const STATUS = require('../lib/sharedConstants').STATUS;
const EVENTS = require('../lib/sharedConstants').EVENTS;
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
const cloudUtil = require('@f5devcentral/f5-cloud-libs').util;
const PRODUCTS = require('@f5devcentral/f5-cloud-libs').sharedConstants.PRODUCTS;
const doUtil = require('./doUtil');
const Logger = require('./logger');
const PATHS = require('./sharedConstants').PATHS;
const logger = new Logger(module);
/**
* Handles DSC parts of a declaration.
*
* @class
*/
class DscHandler {
/**
* Constructor
*
const path = require('path');
const stream = require('stream');
const q = require('q');
const Compute = require('@google-cloud/compute');
const Storage = require('@google-cloud/storage');
const CloudProvider = require('@f5devcentral/f5-cloud-libs').cloudProvider;
const AutoscaleInstance = require('@f5devcentral/f5-cloud-libs').autoscaleInstance;
const BigIp = require('@f5devcentral/f5-cloud-libs').bigIp;
const Logger = require('@f5devcentral/f5-cloud-libs').logger;
const cloudUtil = require('@f5devcentral/f5-cloud-libs').util;
const cryptoUtil = require('@f5devcentral/f5-cloud-libs').cryptoUtil;
const PubSub = require('../src/gcClients/pubSub');
const KEYS = require('@f5devcentral/f5-cloud-libs').sharedConstants.KEYS;
const CREDENTIALS_FILE = 'credentials/master';
const INSTANCES_FOLDER = 'instances/';
const PUBLIC_KEYS_FOLDER = 'public_keys/';
const BACKUP_FOLDER = 'backup/';
const JOIN_PREFIX = 'JOIN_';
const SYNC_COMPLETE_PREFIX = 'SYNC_COMPLETE_';
let bigIp;
let logger;
util.inherits(GceCloudProvider, CloudProvider);
/**
* Constructor.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
const PRODUCTS = require('@f5devcentral/f5-cloud-libs').sharedConstants.PRODUCTS;
const doUtil = require('./doUtil');
class LicensePoolValidator {
validate(data) {
if (!data || !data.declaration) {
return Promise.resolve({
isValid: true
});
}
const licenseWrapper = doUtil.getClassObjects(data.declaration, 'License');
if (!licenseWrapper) {
return Promise.resolve({
isValid: true
});
}
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
const cloudUtil = require('@f5devcentral/f5-cloud-libs').util;
const PRODUCTS = require('@f5devcentral/f5-cloud-libs').sharedConstants.PRODUCTS;
const doUtil = require('./doUtil');
const Logger = require('./logger');
const PATHS = require('./sharedConstants').PATHS;
const EVENTS = require('./sharedConstants').EVENTS;
const logger = new Logger(module);
/**
* Handles system parts of a declaration.
*
* @class
*/
class SystemHandler {
/**
* Constructor
*