You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before getting started please read the [documentation](https://github.com/queueit/Documentation/tree/main/edge-connectors) to get acquainted with edge connectors.
3
+
The Queue-it Security Framework ensures that end-users are not able to access your online application without first
4
+
going through the queue for any and all �protected� areas and paths on your sites. The queue system is implemented by
5
+
adding a server-side (request-level) integration that protects your online application by redirecting users to a waiting
6
+
room according to web traffic settings in the Queue-it GO Platform. After the integration is complete, queue system
7
+
behavior and operations are managed in Queue-it�s Go Platform and/or via the Queue-it Admin API.
4
8
5
-
This Fastly Queue-it Connector (aka, Queue-it's server-side KnownUser connector) uses a Compute@Edge service to
9
+
This Fastly Queue-it Connector SDK (aka, Queue-it�s server-side KnownUser connector) uses a Compute@Edge service to
6
10
integrate Queue-it's functionality into Fastly's network.
7
11
8
12
A Wasm service is required to utilize this connector.
9
13
10
14
> You can find the latest released version [here](https://github.com/queueit/KnownUser.V3.Fastly/releases/latest).
11
15
16
+
## Introduction
17
+
18
+
When a user makes a request to your Fastly service our connector validates the request and if it is needed, it will
19
+
redirect the user to the waiting room. After waiting in the waiting room, the queue engine will redirect the user back
20
+
to your end attaching a query string parameter ( `queueittoken` ) containing some information about the user to the URL.
21
+
The most important fields of the `queueittoken` are:
22
+
23
+
- q - The user's unique queue identifier
24
+
- ts - A timestamp of how long this redirect is valid
25
+
- h - A hash of the token
26
+
27
+
After the user returns from the queue, the connector will let the user continue his request to your backend ( without
28
+
redirecting to the queue since the request has a valid queueittoken as query string) .
29
+
12
30
## Installation
13
31
14
32
There are two methods of installation:
@@ -24,14 +42,14 @@ There are two methods of installation:
24
42
Edit the host, go to advanced options and fill in the same hostname in **Override host**
25
43
- Go to **Dictionaries** and create a new dictionary named `IntegrationConfiguration`.
26
44
Add the following items in the dictionary:
27
-
- customerId: Your customer ID
28
-
- apiKey: The API key for your account
29
-
- secret: Your KnownUserV3 secret
30
-
- queueItOrigin: The name of the queue-it host, in this case it's `queue-it`
45
+
- customerId: Your customer ID
46
+
- apiKey: The API key for your account
47
+
- secret: Your KnownUserV3 secret
48
+
- queueItOrigin: The name of the queue-it host, in this case it's `queue-it`
31
49
You can find these values in the Go Queue-It self-service platform.
32
-
- Download the latest package file (release-package.tar.gz) from the releases page and unarchive it.
50
+
- Download the latest package from the releases page and unarchive it.
33
51
- Edit the `fastly.toml` file and copy the ID of your service (you can see this by opening up the service in Fastly) and
34
-
replace **{YourServiceId}** with it.
52
+
replace __{YourServiceId}__ with it.
35
53
- Archive the directory in the same format (tar.gz).
36
54
- Go to `Package` in the Fastly service page and upload the package.
37
55
- To finish up and deploy your service click on the **Activate** button.
@@ -40,17 +58,17 @@ There are two methods of installation:
40
58
41
59
- Go to the Fastly services page and create a new **Wasm** service and copy it's ID.
42
60
- Clone this repository and edit the fastly.toml file, make sure to set the `service_id` field to the ID you copied.
43
-
- Then click on *Origins* and add a new host that has the hostname of your origin server.
61
+
- Then click on *Origins* and add a new host that has the hostname of your origin server.
44
62
You can name the host **origin** or whatever you choose.
45
-
- Create a host that has the hostname of `{yourCustomerId}.queue-it.net` and name it **queue-it**.
63
+
- Create a host that has the hostname of `{yourCustomerId}.queue-it.net` and name it **queue-it**.
46
64
Edit the host, go to advanced options and fill in the same hostname in **Override host**
47
65
- Open up the service in Fastly and go to **Dictionaries** and create a new dictionary named `IntegrationConfiguration`
48
66
.
49
67
Add the following items in the dictionary:
50
-
- customerId: Your customer ID
51
-
- apiKey: The API key for your account
52
-
- secret: Your KnownUserV3 secret
53
-
- queueItOrigin: The name of the queue-it origin, in this case it's `queue-it`
68
+
- customerId: Your customer ID
69
+
- apiKey: The API key for your account
70
+
- secret: Your KnownUserV3 secret
71
+
- queueItOrigin: The name of the queue-it origin, in this case it's `queue-it`
54
72
You can find these values in the Go Queue-It self-service platform.
55
73
- You need to add some code that uses this connector. Here is an example:
56
74
@@ -61,21 +79,17 @@ import {onQueueITRequest, IntegrationDetails, onQueueITResponse} from "@queue-it
61
79
const req =Fastly.getClientRequest();
62
80
63
81
// This is optional and can be null if it's specified in your Dictionary
64
-
/* const integrationDetails = new IntegrationDetails(
65
-
{QueueItOriginName},
66
-
{CustomerId},
67
-
{SecretKey},
68
-
{ApiKey},
69
-
{workerHost});
82
+
const integrationDetails =newIntegrationDetails(
83
+
"QueueItOriginName",
84
+
"CustomerId",
85
+
"SecretKey",
86
+
"ApiKey");
70
87
let res =onQueueITRequest(req, integrationDetails);
71
-
*/
72
-
73
-
let res =onQueueITRequest(req, null);
74
88
75
89
if (res!=null) {
76
90
Fastly.respondWith(res!);
77
91
} else {
78
-
const myOrigin ='origin';
92
+
const myOrigin ='Ticketania';
79
93
const cacheOverride =newFastly.CacheOverride();
80
94
const res =Fastly.fetch(req, {
81
95
backend: myOrigin,
@@ -89,3 +103,27 @@ if (res != null) {
89
103
- Build and deploy the package running `fastly compute build` and `fastly compute deploy` in the same directory.
90
104
- Create desired waiting room(s), triggers, and actions in the Go Queue-It self-service platform.
91
105
Then, save/publish the configuration.
106
+
107
+
## Providing the queue configuration
108
+
109
+
The recommended way is to use the Go Queue-it self-service portal to setup the configuration. The configuration
110
+
specifies a set of Triggers and Actions. A Trigger is an expression matching one, more or all URLs on your website. When
111
+
a user enter your website and the URL matches a Trigger-expression the corresponding Action will be triggered. The
112
+
Action specifies which waiting room the users should be send to. In this way you can specify which waiting room(s)
113
+
should protect which page(s) on the fly without changing the server-side integration.
114
+
115
+
## Protecting AJAX calls
116
+
117
+
If you need to protect AJAX calls beside page loads you need to add the below JavaScript tags to your pages:
expect(customerIntegrationInfo.Integrations[24].Name).toBe('Integration - With InvolvedWaitingRoomIds null');
1132
+
expect(customerIntegrationInfo.Integrations[24].Triggers.length).toBe(1,'Integration - With InvolvedWaitingRoomIds null should have exactly 1 trigger');
0 commit comments