Skip to content

Commit 1dc0dd2

Browse files
authored
Update README.md
minor formatting and text changes
1 parent 907fedf commit 1dc0dd2

1 file changed

Lines changed: 15 additions & 18 deletions

File tree

README.md

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,8 @@ The KnownUser validation must be done on *all requests except requests for stati
5353
So, if you add the KnownUser validation logic to a central place, then be sure that the Triggers only fire on page requests (including ajax requests) and not on e.g. image.
5454

5555
If we have the `integrationconfig.json` copied in the folder beside other knownuser files inside web application folder then
56-
the following method is all that is needed to validate that a user has been through the queue:
56+
the following method (using Django v.1.8) is all that is needed to validate that a user has been through the queue:
5757

58-
Example using Django v.1.8
5958
```python
6059
from django.http import HttpResponse
6160

@@ -109,7 +108,7 @@ def index(request):
109108
response.status_code = 302
110109
response["Location"] = requestUrlWithoutToken
111110

112-
return response
111+
return response
113112

114113
except StandardError as stdErr:
115114
# Log the Error
@@ -128,9 +127,8 @@ If your application server (maybe due to security reasons) is not allowed to do
128127
3. Specify the configuration in code without using the Trigger/Action paradigm. In this case it is important *only to queue-up page requests* and not requests for resources or AJAX calls.
129128
This can be done by adding custom filtering logic before caling the `KnownUser.resolveRequestByLocalEventConfig()` method.
130129

131-
The following is an example of how to specify the configuration in code:
130+
The following is an example (using Django v.1.8) of how to specify the configuration in code:
132131

133-
Example using Django v.1.8
134132
```python
135133
from django.http import HttpResponse
136134

@@ -149,16 +147,16 @@ def index(request):
149147
customerId = "" # Your Queue-it customer ID
150148
secretKey = "" # Your 72 char secret key as specified in Go Queue-it self-service platform
151149

152-
eventConfig = QueueEventConfig()
153-
eventConfig.eventId = "" # ID of the queue to use
154-
eventConfig.queueDomain = "xxx.queue-it.net" #Domian name of the queue - usually in the format [CustomerId].queue-it.net
155-
# eventConfig.cookieDomain = ".my-shop.com" #Optional - Domain name where the Queue-it session cookie should be saved
156-
eventConfig.cookieValidityMinute = 15 #Optional - Validity of the Queue-it session cookie. Default is 10 minutes
157-
eventConfig.extendCookieValidity = true #Optional - Should the Queue-it session cookie validity time be extended each time the validation runs? Default is true.
158-
# eventConfig.culture = "da-DK" #Optional - Culture of the queue ticket layout in the format specified here: https://msdn.microsoft.com/en-us/library/ee825488(v=cs.20).aspx Default is to use what is specified on Event
159-
# eventConfig.layoutName = "NameOfYourCustomLayout" #Optional - Name of the queue ticket layout - e.g. "Default layout by Queue-it". Default is to take what is specified on the Event
150+
eventConfig = QueueEventConfig()
151+
eventConfig.eventId = "" # ID of the queue to use
152+
eventConfig.queueDomain = "xxx.queue-it.net" #Domian name of the queue - usually in the format [CustomerId].queue-it.net
153+
# eventConfig.cookieDomain = ".my-shop.com" #Optional - Domain name where the Queue-it session cookie should be saved
154+
eventConfig.cookieValidityMinute = 15 #Optional - Validity of the Queue-it session cookie. Default is 10 minutes
155+
eventConfig.extendCookieValidity = true #Optional - Should the Queue-it session cookie validity time be extended each time the validation runs? Default is true.
156+
# eventConfig.culture = "da-DK" #Optional - Culture of the queue ticket layout in the format specified here: https://msdn.microsoft.com/en-us/library/ee825488(v=cs.20).aspx Default is to use what is specified on Event
157+
# eventConfig.layoutName = "NameOfYourCustomLayout" #Optional - Name of the queue ticket layout - e.g. "Default layout by Queue-it". Default is to take what is specified on the Event
160158

161-
response = HttpResponse()
159+
response = HttpResponse()
162160
httpContextProvider = Django_1_8_Provider(request, response)
163161
requestUrl = httpContextProvider.getOriginalRequestUrl()
164162
requestUrlWithoutToken = re.sub(
@@ -172,7 +170,7 @@ def index(request):
172170

173171
queueitToken = request.GET.get(KnownUser.QUEUEIT_TOKEN_KEY)
174172

175-
validationResult = KnownUser.resolveQueueRequestByLocalConfig(
173+
validationResult = KnownUser.resolveQueueRequestByLocalConfig(
176174
requestUrlWithoutToken, queueitToken, queueConfig, customerId, secretKey,
177175
httpContextProvider)
178176

@@ -191,7 +189,7 @@ def index(request):
191189
response.status_code = 302
192190
response["Location"] = requestUrlWithoutToken
193191

194-
return response
192+
return response
195193

196194
except StandardError as stdErr:
197195
# Log the Error
@@ -213,9 +211,8 @@ If you have some static html pages (might be behind cache servers) and you have
213211
src="//static.queue-it.net/script/queueconfigloader.min.js">
214212
</script>
215213
```
216-
4) Use the following method to protect all dynamic calls (including dynamic pages and ajax calls).
214+
4) Use the following method (using Django v.1.8) to protect all dynamic calls (including dynamic pages and ajax calls).
217215

218-
Example using Django v.1.8
219216
```python
220217
from django.http import HttpResponse
221218

0 commit comments

Comments
 (0)