Skip to content

Commit a9141a8

Browse files
authored
Update README.md
simplified readme with link to server-side documentation repo
1 parent 2b5a4a3 commit a9141a8

1 file changed

Lines changed: 7 additions & 60 deletions

File tree

README.md

Lines changed: 7 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,12 @@
11
# KnownUser.V3.Lua
2-
The Queue-it Security Framework is used to ensure that end users cannot bypass the queue by adding a server-side integration to your server. It was developed and verified with Lua v.5.1. **Running this SDK on Lua versions higher than this (ex. v.5.3) will not work**.
2+
Before getting started please read the [documentation](https://github.com/queueit/Documentation/tree/main/serverside-connectors) to get acquainted with server-side connectors.
33

4-
## Introduction
5-
When a user is redirected back from the queue to your website, the queue engine can attach a query string parameter (`queueittoken`) containing some information about the user.
6-
The most important fields of the `queueittoken` are:
4+
The Lua connector can run on web platforms that support a LUA runtime. It was developed and verified with Lua v.5.1.
75

8-
- q - the users unique queue identifier
9-
- ts - a timestamp of how long this redirect is valid
10-
- h - a hash of the token
6+
**Using it with Lua versions higher than this (ex. v.5.3) will not work**.
117

12-
The high level logic is as follows:
13-
14-
![The KnownUser validation flow](https://github.com/queueit/KnownUser.V3.Lua/blob/master/Documentation/KnownUserFlow.png)
15-
16-
1. User requests a page on your server
17-
2. The validation method sees that the has no Queue-it session cookie and no `queueittoken` and sends him to the correct queue based on the configuration
18-
3. User waits in the queue
19-
4. User is redirected back to your website, now with a `queueittoken`
20-
5. The validation method validates the `queueittoken` and creates a Queue-it session cookie
21-
6. The user browses to a new page and the Queue-it session cookie will let him go there without queuing again
22-
23-
## How to validate a user
24-
To validate that the current user is allowed to enter your website (has been through the queue) these steps are needed:
25-
26-
1. Providing the queue configuration to the KnownUser validation
27-
2. Validate the `queueittoken` and store a session cookie
28-
29-
### 1. Providing the queue configuration
30-
The recommended way is to use the Go Queue-it self-service portal to setup the configuration.
31-
The configuration specifies a set of Triggers and Actions. A Trigger is an expression matching one, more or all URLs on your website.
32-
When a user enter your website and the URL matches a Trigger-expression the corresponding Action will be triggered.
33-
The Action specifies which queue the users should be sent to.
34-
In this way you can specify which queue(s) should protect which page(s) on the fly without changing the server-side integration.
35-
36-
This configuration can then be downloaded to your application server.
37-
Read more about how *[here](https://github.com/queueit/KnownUser.V3.Lua/tree/master/Documentation)*.
38-
39-
### 2. Validate the `queueittoken` and store a session cookie
40-
To validate that the user has been through the queue, use the `knownUser.validateRequestByIntegrationConfig` method.
41-
This call will validate the timestamp and hash and if valid create a "QueueITAccepted-SDFrts345E-V3_[EventId]" cookie with a TTL as specified in the configuration.
42-
If the timestamp or hash is invalid, the user is send back to the queue.
43-
44-
## Implementation
45-
46-
The Lua connector SDK can run on web platforms that support a LUA runtime.
47-
It works by having all general code within the SDK (https://github.com/queueit/KnownUser.V3.Lua/tree/master/SDK) and platform specific code in handlers.
48-
With this solution the SDK code stays unmodified and only a little work is needed to create or modify handlers (https://github.com/queueit/KnownUser.V3.Lua/tree/master/Handlers).
8+
The connector works by having all general code within the [SDK](https://github.com/queueit/KnownUser.V3.Lua/tree/master/SDK) and platform specific code in handlers.
9+
With this solution the SDK code stays unmodified and only a little work is needed to create or modify [handlers](https://github.com/queueit/KnownUser.V3.Lua/tree/master/Handlers).
4910

5011
Currently we offer handlers and tested example code for the following platforms:
5112

@@ -54,25 +15,11 @@ Currently we offer handlers and tested example code for the following platforms:
5415

5516
However if you have another platform it's straitforward to implement the missing parts in a new handler.
5617

57-
To create a platform handler you will need to implement the missing parts in KnownUserImplementationHelpers.lua:
18+
To create a platform handler you will need to implement the missing parts in `KnownUserImplementationHelpers.lua`:
5819
- Read request URL
5920
- Read request host (user agent IP address)
6021
- Read request headers
6122
- Read request cookies
6223
- Write response cookies
6324

64-
Look at existing handlers for inspiration.
65-
66-
### Protecting ajax calls
67-
If you need to protect AJAX calls beside page loads you need to add the below JavaScript tags to your pages:
68-
69-
```
70-
<script type="text/javascript" src="//static.queue-it.net/script/queueclient.min.js"></script>
71-
<script
72-
data-queueit-intercept-domain="{YOUR_CURRENT_DOMAIN}"
73-
data-queueit-intercept="true"
74-
data-queueit-c="{YOUR_CUSTOMER_ID}"
75-
type="text/javascript"
76-
src="//static.queue-it.net/script/queueconfigloader.min.js">
77-
</script>
78-
```
25+
Look at existing [handlers](https://github.com/queueit/KnownUser.V3.Lua/tree/master/Handlers) for inspiration.

0 commit comments

Comments
 (0)