Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function main() {
// [START dns_quickstart]
// Imports the Google Cloud client library
const {DNS} = require('@google-cloud/dns');
// Creates a client
const dns = new DNS();
async function quickstart() {
// Lists all zones in the current project
const [zones] = await dns.getZones();
console.log('Zones:');
zones.forEach(zone => console.log(zone.name));
}
quickstart();
// [END dns_quickstart]
}
async function main() {
// [START dns_list_zones]
// Imports the Google Cloud client library
const {DNS} = require('@google-cloud/dns');
// Creates a client
const dns = new DNS();
async function listZones() {
// Lists all zones in the current project
const [zones] = await dns.getZones();
console.log('Zones:');
zones.forEach(zone => console.log(zone.name));
}
listZones();
// [END dns_list_zones]
}
const { DNS } = require('@google-cloud/dns')
const dns = new DNS({ projectId: process.env.GCLOUD_PROJECT })
const zone = dns.zone(process.env.GCLOUD_DNS_ZONE || 'test-zone')
export const subdomainBlacklist = ['admin', 'login', 'system', 'account']
/* Generates the DNS name of the CNAME and TXT entries.
*
* e.g. marketplace.origindapp.com
*
* @param {string} subdomain The subdomain of the DNS record.
* @param {string} recordType The DNS record type.
*/
function getDnsName(subdomain, recordType) {
const baseName = `${subdomain}.${
process.env.DAPP_CREATOR_DOMAIN
}.`.toLowerCase()
if (recordType.toLowerCase() === 'cname') {
/*jshint esversion: 6 */
const ipHelper = require('ip');
const {DNS} = require('@google-cloud/dns');
const settings = require('./settings.json');
const dns = new DNS();
/**
* HTTP Cloud Function.
*
* @param {Object} req Cloud Function request context.
* @param {Object} res Cloud Function response context.
*/
exports.updateHost = function helloGET(req, res) {
var token = req.query.token || req.body.token;
var ipv4 = req.query.ipv4 || req.body.ipv4;
var ipv6 = req.query.ipv6 || req.body.ipv6;
var host = req.query.host || req.body.host;
if (token != settings.secretToken) {
respondWithError(401, 'unauthorized', 'Login Required', res);
return;
}