UNPKG

awscdk-construct-scte-scheduler

Version:

AWS CDK Construct for scheduling SCTE-35 events using the MediaLive schedule API

16 lines (15 loc) 648 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.HttpBearerAuthSigner = void 0; const protocols_1 = require("@smithy/core/protocols"); class HttpBearerAuthSigner { async sign(httpRequest, identity, signingProperties) { const clonedRequest = protocols_1.HttpRequest.clone(httpRequest); if (!identity.token) { throw new Error("request could not be signed with `token` since the `token` is not defined"); } clonedRequest.headers["Authorization"] = `Bearer ${identity.token}`; return clonedRequest; } } exports.HttpBearerAuthSigner = HttpBearerAuthSigner;