How to use the getdns.DNSSEC_SECURE function in getdns

To help you get started, we’ve selected a few getdns examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github getdnsapi / getdns-node / samples / getdns-node-sample-crypto / index.js View on Github external
const getFirstSecureResponse = (result, type) => {
    const repliesTree = result.replies_tree;
    // Validate that there is a reply with an answer.
    if (!repliesTree || !repliesTree.length
        || !repliesTree[0].answer
        || !repliesTree[0].answer.length) {
        return "empty answer list for type " + type;
    }
    const reply = repliesTree[0];

    // Ensure the reply is secure.
    if (reply.dnssec_status !== getdns.DNSSEC_SECURE) {
        return "insecure reply for type " + type;
    }
    let answers = reply.answer;

    // Get the records of that type.
    answers = answers.filter((answer) => {
        return answer.type === type;
    });
    if (!answers.length) {
        return "no answers of type " + type;
    }
    return answers[0];
};
github getdnsapi / getdns-node / samples / getdns-node-sample-console-pretty / index.js View on Github external
const dnssecSecureReplies = replies.filter(function(reply) {
            return reply.dnssec_status === getdns.DNSSEC_SECURE;
        });

getdns

getdns bindings for Node.js. getdns is a modern asynchronous DNS API. It implements DNS entry points from a design developed and vetted by application developers, in an API specification.

BSD-3-Clause
Latest version published 4 years ago

Package Health Score

49 / 100
Full package analysis