update CHANGELOG.md
[websub-hub] / test / test-data / manager.js
1 'use strict';
2
3 const remoteAddress = '127.0.0.10';
4 const callbackUrl = 'https://example.com/consume?id=123&token=abc';
5 const topicUrl = 'https://example.com/some_blog';
6 const modePublish = 'publish';
7 const modeSubscribe = 'subscribe';
8
9 module.exports = {
10 validSubscribeCtx: {
11 clientAddress: remoteAddress,
12 clientProtocol: 'https',
13 parsedBody: {
14 'hub.mode': modeSubscribe,
15 'hub.callback': callbackUrl,
16 'hub.topic': topicUrl,
17 'hub.extra': 'unused value',
18 'hub.lease_seconds': '864000',
19 'hub.secret': 'such secret',
20 },
21 },
22 validRootData: {
23 callback: callbackUrl,
24 mode: modeSubscribe,
25 topic: topicUrl,
26 leaseSeconds: 864000,
27 secret: 'such secret',
28 httpRemoteAddr: remoteAddress,
29 httpFrom: 'user@example.com',
30 isSecure: true,
31 isPublisherValidated: true,
32 },
33 validUnsubscribeCtx: {
34 clientAddress: remoteAddress,
35 clientProtocol: 'https',
36 parsedBody: {
37 'hub.mode': 'unsubscribe',
38 'hub.callback': callbackUrl,
39 'hub.topic': topicUrl,
40 },
41 },
42 validPublishCtx: {
43 clientAddress: remoteAddress,
44 clientProtocol: 'https',
45 parsedBody: {
46 'hub.mode': modePublish,
47 'hub.topic': topicUrl,
48 },
49 },
50 validPublishRootData: {
51 httpRemoteAddr: remoteAddress,
52 mode: modePublish,
53 topic: topicUrl,
54 },
55 };