"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isQueueAccessAuthorized = exports.QUEUE_ACCESS_TOKEN_HEADER = void 0;
exports.QUEUE_ACCESS_TOKEN_HEADER = 'x-rivet-queue-token';
/**
 * Checks whether a browser request is allowed to enqueue or control embedded agent work.
 */
const isQueueAccessAuthorized = ({ queueAccessToken, getHeader, }) => {
    if (!queueAccessToken) {
        return true;
    }
    return getHeader(exports.QUEUE_ACCESS_TOKEN_HEADER) === queueAccessToken;
};
exports.isQueueAccessAuthorized = isQueueAccessAuthorized;
//# sourceMappingURL=queueAccess.js.map