snowflake-sdk
Version:
Node.js driver for Snowflake
29 lines • 1.2 kB
JavaScript
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.DEFAULT_AZURE_ENTRA_ID_RESOURCE = void 0;
exports.getAzureAttestationToken = getAzureAttestationToken;
const identity_1 = require("@azure/identity");
const logger_1 = __importDefault(require("../../logger"));
exports.DEFAULT_AZURE_ENTRA_ID_RESOURCE = 'api://fd3f753b-eed3-462c-b6a7-a4b5bb650aad';
async function getAzureAttestationToken(entraIdResource = exports.DEFAULT_AZURE_ENTRA_ID_RESOURCE) {
const credential = new identity_1.DefaultAzureCredential({
// NOTE:
// We don't want retries because it makes auto-detect mode slow
retryOptions: {
maxRetries: 0,
},
});
try {
(0, logger_1.default)().debug('Getting Azure auth token');
const token = await credential.getToken(entraIdResource);
return token.token;
}
catch (error) {
(0, logger_1.default)().debug(`Error getting Azure auth token: ${error}`);
return null;
}
}
//# sourceMappingURL=attestation_azure.js.map
;