Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
],
"metadata":
{
"items":
[
{
"key": "startup-script",
"value": package.config.NETBSD_BUILDER_STARTX,
},
],
},
},
}
const pubcli = new pubsub.v1.PublisherClient()
const subcli = new pubsub.v1.SubscriberClient()
exports.listener = (req, rsp) =>
{
// check if the request has our secret
if (req.query.secret != package.config.SECRET)
{
rsp.status(400).send("You don't know the password!")
return
}
if (req.query.image === undefined ||
req.query.token === undefined)
{
rsp.status(400).send("query: missing image or token")
return
}
},
],
"metadata":
{
"items":
[
{
"key": "startup-script",
"value": package.config.NETBSD_BUILDER_STARTX,
},
],
},
},
}
const pubcli = new pubsub.v1.PublisherClient()
const subcli = new pubsub.v1.SubscriberClient()
exports.listener = (req, rsp) =>
{
// check if the request has our secret
if (req.query.secret != package.config.SECRET)
{
rsp.status(400).send("You don't know the password!")
return
}
if (req.query.image === undefined ||
req.query.token === undefined)
{
rsp.status(400).send("query: missing image or token")
return
async function synchronousPull(projectName, subscriptionName) {
// [START pubsub_subscriber_sync_pull]
// Imports the Google Cloud client library
const pubsub = require('@google-cloud/pubsub');
const client = new pubsub.v1.SubscriberClient();
/**
* TODO(developer): Uncomment the following lines to run the sample.
*/
// const projectName = 'your-project';
// const subscriptionName = 'your-subscription';
const formattedSubscription = client.subscriptionPath(
projectName,
subscriptionName
);
// The maximum number of messages returned for this request.
// Pub/Sub may return fewer than the number specified.
const maxMessages = 1;
const newAckDeadlineSeconds = 30;
const request = {