queueit_knownuserv3 3.5.1 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.devcontainer/Dockerfile +43 -0
- data/.devcontainer/devcontainer.json +30 -0
- data/.vs/VSWorkspaceState.json +9 -0
- data/.vs/knownuser-v3-ruby/v16/.suo +0 -0
- data/.vs/slnx.sqlite +0 -0
- data/.vscode/launch.json +15 -0
- data/ci-build.yml +17 -0
- data/lib/queueit_knownuserv3.rb +1 -0
- data/lib/queueit_knownuserv3/connector_diagnostics.rb +69 -0
- data/lib/queueit_knownuserv3/integration_config_helpers.rb +1 -50
- data/lib/queueit_knownuserv3/known_user.rb +84 -56
- data/lib/queueit_knownuserv3/models.rb +18 -4
- data/lib/queueit_knownuserv3/queue_url_params.rb +47 -47
- data/lib/queueit_knownuserv3/user_in_queue_service.rb +55 -44
- data/lib/queueit_knownuserv3/user_in_queue_state_cookie_repository.rb +1 -1
- data/license.txt +165 -0
- data/queueit_knownuserv3.gemspec +1 -4
- metadata +17 -34
- checksums.yaml +0 -15
@@ -0,0 +1,43 @@
|
|
1
|
+
#-------------------------------------------------------------------------------------------------------------
|
2
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
3
|
+
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
|
4
|
+
#-------------------------------------------------------------------------------------------------------------
|
5
|
+
|
6
|
+
FROM ruby:1.9.3
|
7
|
+
|
8
|
+
# Avoid warnings by switching to noninteractive
|
9
|
+
ENV DEBIAN_FRONTEND=noninteractive
|
10
|
+
|
11
|
+
# This Dockerfile adds a non-root 'vscode' user with sudo access. However, for Linux,
|
12
|
+
# this user's GID/UID must match your local user UID/GID to avoid permission issues
|
13
|
+
# with bind mounts. Update USER_UID / USER_GID if yours is not 1000. See
|
14
|
+
# https://aka.ms/vscode-remote/containers/non-root-user for details.
|
15
|
+
ARG USERNAME=vscode
|
16
|
+
ARG USER_UID=1000
|
17
|
+
ARG USER_GID=$USER_UID
|
18
|
+
|
19
|
+
# Configure apt and install packages
|
20
|
+
RUN apt-get update \
|
21
|
+
&& apt-get -y install --no-install-recommends apt-utils dialog 2>&1 \
|
22
|
+
# Verify git, process tools installed
|
23
|
+
&& apt-get -y install git iproute2 procps lsb-release \
|
24
|
+
#
|
25
|
+
# Install ruby-debug-ide and ruby-debug-base19x
|
26
|
+
#&& gem install ruby-debug-ide \
|
27
|
+
#&& gem install ruby-debug-base19x \
|
28
|
+
#
|
29
|
+
# Create a non-root user to use if preferred - see https://aka.ms/vscode-remote/containers/non-root-user.
|
30
|
+
&& groupadd --gid $USER_GID $USERNAME \
|
31
|
+
&& useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \
|
32
|
+
# [Optional] Add sudo support for the non-root user
|
33
|
+
&& apt-get install -y sudo \
|
34
|
+
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME\
|
35
|
+
&& chmod 0440 /etc/sudoers.d/$USERNAME \
|
36
|
+
#
|
37
|
+
# Clean up
|
38
|
+
&& apt-get autoremove -y \
|
39
|
+
&& apt-get clean -y \
|
40
|
+
&& rm -rf /var/lib/apt/lists/*
|
41
|
+
|
42
|
+
# Switch back to dialog for any ad-hoc use of apt-get
|
43
|
+
ENV DEBIAN_FRONTEND=
|
@@ -0,0 +1,30 @@
|
|
1
|
+
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or the definition README at
|
2
|
+
// https://github.com/microsoft/vscode-dev-containers/tree/master/containers/ruby-2
|
3
|
+
{
|
4
|
+
"name": "Ruby",
|
5
|
+
"dockerFile": "Dockerfile",
|
6
|
+
|
7
|
+
// Use 'settings' to set *default* container specific settings.json values on container create.
|
8
|
+
// You can edit these settings after create using File > Preferences > Settings > Remote.
|
9
|
+
"settings": {
|
10
|
+
"terminal.integrated.shell.linux": "/bin/bash"
|
11
|
+
},
|
12
|
+
|
13
|
+
"workspaceMount": "src=${localWorkspaceFolder},dst=/workspace,type=bind,consistency=delegated",
|
14
|
+
"workspaceFolder": "/workspace",
|
15
|
+
// Uncomment the next line if you want to publish any ports.
|
16
|
+
// "appPort": [],
|
17
|
+
|
18
|
+
// Uncomment the next line to run commands after the container is created.
|
19
|
+
"postCreateCommand": "bundle install; gem install ruby-debug-ide -v 0.6.0; gem install ruby-debug-base19x",
|
20
|
+
|
21
|
+
// Uncomment the next line to use a non-root user. On Linux, this will prevent
|
22
|
+
// new files getting created as root, but you may need to update the USER_UID
|
23
|
+
// and USER_GID in .devcontainer/Dockerfile to match your user if not 1000.
|
24
|
+
// "runArgs": [ "-u", "vscode" ],
|
25
|
+
|
26
|
+
// Add the IDs of extensions you want installed when the container is created in the array below.
|
27
|
+
"extensions": [
|
28
|
+
"rebornix.Ruby"
|
29
|
+
]
|
30
|
+
}
|
Binary file
|
data/.vs/slnx.sqlite
ADDED
Binary file
|
data/.vscode/launch.json
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
{
|
2
|
+
// Use IntelliSense to learn about possible attributes.
|
3
|
+
// Hover to view descriptions of existing attributes.
|
4
|
+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
5
|
+
"version": "0.2.0",
|
6
|
+
"configurations": [
|
7
|
+
{
|
8
|
+
"name": "Debug",
|
9
|
+
"type": "Ruby",
|
10
|
+
"request": "launch",
|
11
|
+
"program": "${workspaceRoot}/test/test_queueit_knownuserv3.rb",
|
12
|
+
"cwd": "${workspaceRoot}"
|
13
|
+
}
|
14
|
+
]
|
15
|
+
}
|
data/ci-build.yml
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# Starter pipeline
|
2
|
+
# Start with a minimal pipeline that you can customize to build and deploy your code.
|
3
|
+
# Add steps that build, run tests, deploy, and more:
|
4
|
+
# https://aka.ms/yaml
|
5
|
+
|
6
|
+
trigger:
|
7
|
+
- master
|
8
|
+
|
9
|
+
pool:
|
10
|
+
name: 'Default'
|
11
|
+
|
12
|
+
steps:
|
13
|
+
- task: Docker@2
|
14
|
+
inputs:
|
15
|
+
command: 'buildAndPush'
|
16
|
+
Dockerfile: '**/test/Dockerfile'
|
17
|
+
buildContext: './'
|
data/lib/queueit_knownuserv3.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require_relative "queueit_knownuserv3/known_user"
|
2
2
|
require_relative "queueit_knownuserv3/models"
|
3
|
+
require_relative "queueit_knownuserv3/connector_diagnostics"
|
3
4
|
require_relative "queueit_knownuserv3/queue_url_params"
|
4
5
|
require_relative "queueit_knownuserv3/user_in_queue_state_cookie_repository"
|
5
6
|
require_relative "queueit_knownuserv3/user_in_queue_service"
|
@@ -0,0 +1,69 @@
|
|
1
|
+
module QueueIt
|
2
|
+
class ConnectorDiagnostics
|
3
|
+
attr_accessor :isEnabled
|
4
|
+
attr_accessor :hasError
|
5
|
+
attr_accessor :validationResult
|
6
|
+
|
7
|
+
def initialize
|
8
|
+
@isEnabled = false
|
9
|
+
@hasError = false
|
10
|
+
@validationResult = nil
|
11
|
+
end
|
12
|
+
|
13
|
+
def setStateWithTokenError(customerId, errorCode)
|
14
|
+
@hasError = true
|
15
|
+
@validationResult = RequestValidationResult.new(
|
16
|
+
"ConnectorDiagnosticsRedirect",
|
17
|
+
nil, nil,
|
18
|
+
"https://" + customerId + ".api2.queue-it.net/" + customerId + "/diagnostics/connector/error/?code=" + errorCode,
|
19
|
+
nil, nil)
|
20
|
+
end
|
21
|
+
|
22
|
+
def setStateWithSetupError()
|
23
|
+
@hasError = true
|
24
|
+
@validationResult = RequestValidationResult.new(
|
25
|
+
"ConnectorDiagnosticsRedirect",
|
26
|
+
nil, nil,
|
27
|
+
"https://api2.queue-it.net/diagnostics/connector/error/?code=setup",
|
28
|
+
nil, nil)
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.verify(customerId, secretKey, queueitToken)
|
32
|
+
diagnostics = ConnectorDiagnostics.new
|
33
|
+
|
34
|
+
qParams = QueueUrlParams.extractQueueParams(queueitToken)
|
35
|
+
|
36
|
+
if(qParams == nil)
|
37
|
+
return diagnostics
|
38
|
+
end
|
39
|
+
|
40
|
+
if(qParams.redirectType == nil)
|
41
|
+
return diagnostics
|
42
|
+
end
|
43
|
+
|
44
|
+
if(not qParams.redirectType.upcase.eql?("DEBUG"))
|
45
|
+
return diagnostics
|
46
|
+
end
|
47
|
+
|
48
|
+
if(Utils.isNilOrEmpty(customerId) or Utils.isNilOrEmpty(secretKey))
|
49
|
+
diagnostics.setStateWithSetupError()
|
50
|
+
return diagnostics
|
51
|
+
end
|
52
|
+
|
53
|
+
calculatedHash = OpenSSL::HMAC.hexdigest('sha256', secretKey, qParams.queueITTokenWithoutHash)
|
54
|
+
if(not qParams.hashCode.eql?(calculatedHash))
|
55
|
+
diagnostics.setStateWithTokenError(customerId, "hash")
|
56
|
+
return diagnostics
|
57
|
+
end
|
58
|
+
|
59
|
+
if(qParams.timeStamp < Time.now.getutc.tv_sec)
|
60
|
+
diagnostics.setStateWithTokenError(customerId, "timestamp")
|
61
|
+
return diagnostics
|
62
|
+
end
|
63
|
+
|
64
|
+
diagnostics.isEnabled = true
|
65
|
+
|
66
|
+
return diagnostics
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
@@ -211,12 +211,6 @@ module QueueIt
|
|
211
211
|
return ComparisonOperatorHelper.equals(value, valueToCompare, isNegative, ignoreCase)
|
212
212
|
when "Contains"
|
213
213
|
return ComparisonOperatorHelper.contains(value, valueToCompare, isNegative, ignoreCase)
|
214
|
-
when "StartsWith"
|
215
|
-
return ComparisonOperatorHelper.startsWith(value, valueToCompare, isNegative, ignoreCase)
|
216
|
-
when "EndsWith"
|
217
|
-
return ComparisonOperatorHelper.endsWith(value, valueToCompare, isNegative, ignoreCase)
|
218
|
-
when "MatchesWith"
|
219
|
-
return ComparisonOperatorHelper.matchesWith(value, valueToCompare, isNegative, ignoreCase)
|
220
214
|
when "EqualsAny"
|
221
215
|
return ComparisonOperatorHelper.equalsAny(value, valuesToCompare, isNegative, ignoreCase)
|
222
216
|
when "ContainsAny"
|
@@ -241,7 +235,7 @@ module QueueIt
|
|
241
235
|
end
|
242
236
|
|
243
237
|
def self.contains(value, valueToCompare, isNegative, ignoreCase)
|
244
|
-
if(valueToCompare.eql? "*")
|
238
|
+
if((valueToCompare.eql? "*") && !(value.empty? || value.nil?))
|
245
239
|
return true
|
246
240
|
end
|
247
241
|
|
@@ -258,49 +252,6 @@ module QueueIt
|
|
258
252
|
end
|
259
253
|
end
|
260
254
|
|
261
|
-
def self.startsWith(value, valueToCompare, isNegative, ignoreCase)
|
262
|
-
if(ignoreCase)
|
263
|
-
evaluation = value.upcase.start_with? valueToCompare.upcase
|
264
|
-
else
|
265
|
-
evaluation = value.start_with? valueToCompare
|
266
|
-
end
|
267
|
-
|
268
|
-
if(isNegative)
|
269
|
-
return !evaluation
|
270
|
-
else
|
271
|
-
return evaluation
|
272
|
-
end
|
273
|
-
end
|
274
|
-
|
275
|
-
def self.endsWith(value, valueToCompare, isNegative, ignoreCase)
|
276
|
-
if(ignoreCase)
|
277
|
-
evaluation = value.upcase.end_with? valueToCompare.upcase
|
278
|
-
else
|
279
|
-
evaluation = value.end_with? valueToCompare
|
280
|
-
end
|
281
|
-
|
282
|
-
if(isNegative)
|
283
|
-
return !evaluation
|
284
|
-
else
|
285
|
-
return evaluation
|
286
|
-
end
|
287
|
-
end
|
288
|
-
|
289
|
-
def self.matchesWith(value, valueToCompare, isNegative, ignoreCase)
|
290
|
-
if(ignoreCase)
|
291
|
-
pattern = Regexp.new(valueToCompare, Regexp::IGNORECASE)
|
292
|
-
else
|
293
|
-
pattern = Regexp.new(valueToCompare)
|
294
|
-
end
|
295
|
-
|
296
|
-
evaluation = pattern.match(value) != nil
|
297
|
-
if(isNegative)
|
298
|
-
return !evaluation
|
299
|
-
else
|
300
|
-
return evaluation
|
301
|
-
end
|
302
|
-
end
|
303
|
-
|
304
255
|
def self.equalsAny(value, valuesToCompare, isNegative, ignoreCase)
|
305
256
|
valuesToCompare.each do |valueToCompare|
|
306
257
|
if (ComparisonOperatorHelper.equals(value, valueToCompare, false, ignoreCase))
|
@@ -51,26 +51,6 @@ module QueueIt
|
|
51
51
|
end
|
52
52
|
private_class_method :logMoreRequestDetails
|
53
53
|
|
54
|
-
def self.getIsDebug(queueitToken, secretKey)
|
55
|
-
qParams = QueueUrlParams.extractQueueParams(queueitToken)
|
56
|
-
if(qParams == nil)
|
57
|
-
return false
|
58
|
-
end
|
59
|
-
|
60
|
-
redirectType = qParams.redirectType
|
61
|
-
if(redirectType == nil)
|
62
|
-
return false
|
63
|
-
end
|
64
|
-
|
65
|
-
if (redirectType.upcase.eql?("DEBUG"))
|
66
|
-
calculatedHash = OpenSSL::HMAC.hexdigest('sha256', secretKey, qParams.queueITTokenWithoutHash)
|
67
|
-
valid = qParams.hashCode.eql?(calculatedHash)
|
68
|
-
return valid
|
69
|
-
end
|
70
|
-
return false
|
71
|
-
end
|
72
|
-
private_class_method :getIsDebug
|
73
|
-
|
74
54
|
def self.setDebugCookie(debugEntries, cookieJar)
|
75
55
|
if(debugEntries == nil || debugEntries.length == 0)
|
76
56
|
return
|
@@ -86,9 +66,11 @@ module QueueIt
|
|
86
66
|
end
|
87
67
|
private_class_method :setDebugCookie
|
88
68
|
|
89
|
-
def self._resolveQueueRequestByLocalConfig(targetUrl, queueitToken, queueConfig, customerId, secretKey, request, debugEntries)
|
90
|
-
|
69
|
+
def self._resolveQueueRequestByLocalConfig(targetUrl, queueitToken, queueConfig, customerId, secretKey, request, debugEntries, isDebug)
|
70
|
+
|
91
71
|
if(isDebug)
|
72
|
+
debugEntries["SdkVersion"] = UserInQueueService::SDK_VERSION
|
73
|
+
debugEntries["Runtime"] = getRuntime()
|
92
74
|
debugEntries["TargetUrl"] = targetUrl
|
93
75
|
debugEntries["QueueitToken"] = queueitToken
|
94
76
|
debugEntries["OriginalUrl"] = getRealOriginalUrl(request)
|
@@ -137,10 +119,12 @@ module QueueIt
|
|
137
119
|
end
|
138
120
|
private_class_method :_resolveQueueRequestByLocalConfig
|
139
121
|
|
140
|
-
def self._cancelRequestByLocalConfig(targetUrl, queueitToken, cancelConfig, customerId, secretKey, request, debugEntries)
|
141
|
-
targetUrl = generateTargetUrl(targetUrl, request)
|
142
|
-
|
122
|
+
def self._cancelRequestByLocalConfig(targetUrl, queueitToken, cancelConfig, customerId, secretKey, request, debugEntries, isDebug)
|
123
|
+
targetUrl = generateTargetUrl(targetUrl, request)
|
124
|
+
|
143
125
|
if(isDebug)
|
126
|
+
debugEntries["SdkVersion"] = UserInQueueService::SDK_VERSION
|
127
|
+
debugEntries["Runtime"] = getRuntime()
|
144
128
|
debugEntries["TargetUrl"] = targetUrl
|
145
129
|
debugEntries["QueueitToken"] = queueitToken
|
146
130
|
debugEntries["OriginalUrl"] = getRealOriginalUrl(request)
|
@@ -204,40 +188,64 @@ module QueueIt
|
|
204
188
|
|
205
189
|
def self.resolveQueueRequestByLocalConfig(targetUrl, queueitToken, queueConfig, customerId, secretKey, request)
|
206
190
|
debugEntries = Hash.new
|
191
|
+
connectorDiagnostics = ConnectorDiagnostics.verify(customerId, secretKey, queueitToken)
|
192
|
+
|
193
|
+
if(connectorDiagnostics.hasError)
|
194
|
+
return connectorDiagnostics.validationResult
|
195
|
+
end
|
207
196
|
begin
|
208
197
|
targetUrl = generateTargetUrl(targetUrl, request)
|
209
|
-
return _resolveQueueRequestByLocalConfig(targetUrl, queueitToken, queueConfig, customerId, secretKey, request, debugEntries)
|
198
|
+
return _resolveQueueRequestByLocalConfig(targetUrl, queueitToken, queueConfig, customerId, secretKey, request, debugEntries, connectorDiagnostics.isEnabled)
|
199
|
+
rescue Exception => e
|
200
|
+
if(connectorDiagnostics.isEnabled)
|
201
|
+
debugEntries["Exception"] = e.message
|
202
|
+
end
|
203
|
+
raise e
|
210
204
|
ensure
|
211
205
|
setDebugCookie(debugEntries, request.cookie_jar)
|
212
206
|
end
|
213
207
|
end
|
214
208
|
|
215
|
-
def self.validateRequestByIntegrationConfig(currentUrlWithoutQueueITToken, queueitToken,
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
if(
|
221
|
-
|
209
|
+
def self.validateRequestByIntegrationConfig(currentUrlWithoutQueueITToken, queueitToken, integrationConfigJson, customerId, secretKey, request)
|
210
|
+
debugEntries = Hash.new
|
211
|
+
customerIntegration = Hash.new
|
212
|
+
connectorDiagnostics = ConnectorDiagnostics.verify(customerId, secretKey, queueitToken)
|
213
|
+
|
214
|
+
if(connectorDiagnostics.hasError)
|
215
|
+
return connectorDiagnostics.validationResult
|
222
216
|
end
|
223
|
-
|
224
217
|
begin
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
isDebug = getIsDebug(queueitToken, secretKey)
|
229
|
-
if(isDebug)
|
230
|
-
debugEntries["ConfigVersion"] = customerIntegration["Version"]
|
218
|
+
if(connectorDiagnostics.isEnabled)
|
219
|
+
debugEntries["SdkVersion"] = UserInQueueService::SDK_VERSION
|
220
|
+
debugEntries["Runtime"] = getRuntime()
|
231
221
|
debugEntries["PureUrl"] = currentUrlWithoutQueueITToken
|
232
222
|
debugEntries["QueueitToken"] = queueitToken
|
233
223
|
debugEntries["OriginalUrl"] = getRealOriginalUrl(request)
|
234
224
|
logMoreRequestDetails(debugEntries, request)
|
235
225
|
end
|
236
|
-
|
226
|
+
|
227
|
+
customerIntegration = JSON.parse(integrationConfigJson)
|
228
|
+
|
229
|
+
if(connectorDiagnostics.isEnabled)
|
230
|
+
if(customerIntegration.length != 0 and customerIntegration["Version"] != nil)
|
231
|
+
debugEntries["ConfigVersion"] = customerIntegration["Version"]
|
232
|
+
else
|
233
|
+
debugEntries["ConfigVersion"] = "NULL"
|
234
|
+
end
|
235
|
+
end
|
236
|
+
|
237
|
+
if(Utils.isNilOrEmpty(currentUrlWithoutQueueITToken))
|
238
|
+
raise KnownUserError, "currentUrlWithoutQueueITToken can not be nil or empty."
|
239
|
+
end
|
240
|
+
|
241
|
+
if(customerIntegration.length == 0 || customerIntegration["Version"] == nil)
|
242
|
+
raise KnownUserError, "integrationConfigJson is not valid json."
|
243
|
+
end
|
244
|
+
|
237
245
|
integrationEvaluator = IntegrationEvaluator.new
|
238
246
|
matchedConfig = integrationEvaluator.getMatchedIntegrationConfig(customerIntegration, currentUrlWithoutQueueITToken, request)
|
239
247
|
|
240
|
-
if(
|
248
|
+
if(connectorDiagnostics.isEnabled)
|
241
249
|
if(matchedConfig == nil)
|
242
250
|
debugEntries["MatchedConfig"] = "NULL"
|
243
251
|
else
|
@@ -246,33 +254,37 @@ module QueueIt
|
|
246
254
|
end
|
247
255
|
|
248
256
|
if(matchedConfig == nil)
|
249
|
-
return RequestValidationResult.new(nil, nil, nil, nil, nil)
|
257
|
+
return RequestValidationResult.new(nil, nil, nil, nil, nil, nil)
|
250
258
|
end
|
251
259
|
|
252
260
|
# unspecified or 'Queue' specified
|
253
261
|
if(!matchedConfig.key?("ActionType") || Utils.isNilOrEmpty(matchedConfig["ActionType"]) || matchedConfig["ActionType"].eql?(ActionTypes::QUEUE))
|
254
|
-
return handleQueueAction(currentUrlWithoutQueueITToken, queueitToken, customerIntegration,
|
262
|
+
return handleQueueAction(currentUrlWithoutQueueITToken, queueitToken, customerIntegration,
|
263
|
+
customerId, secretKey, matchedConfig, request, debugEntries, connectorDiagnostics.isEnabled)
|
255
264
|
|
256
265
|
elsif(matchedConfig["ActionType"].eql?(ActionTypes::CANCEL))
|
257
|
-
return handleCancelAction(currentUrlWithoutQueueITToken, queueitToken, customerIntegration,
|
266
|
+
return handleCancelAction(currentUrlWithoutQueueITToken, queueitToken, customerIntegration,
|
267
|
+
customerId, secretKey, matchedConfig, request, debugEntries, connectorDiagnostics.isEnabled)
|
258
268
|
|
259
269
|
# for all unknown types default to 'Ignore'
|
260
270
|
else
|
261
271
|
userInQueueService = getUserInQueueService(request.cookie_jar)
|
262
|
-
result = userInQueueService.getIgnoreActionResult()
|
272
|
+
result = userInQueueService.getIgnoreActionResult(matchedConfig["Name"])
|
263
273
|
result.isAjaxResult = isQueueAjaxCall(request)
|
264
274
|
|
265
275
|
return result
|
266
276
|
end
|
267
|
-
|
268
|
-
|
269
|
-
|
277
|
+
rescue Exception => e
|
278
|
+
if(connectorDiagnostics.isEnabled)
|
279
|
+
debugEntries["Exception"] = e.message
|
280
|
+
end
|
281
|
+
raise e
|
270
282
|
ensure
|
271
283
|
setDebugCookie(debugEntries, request.cookie_jar)
|
272
284
|
end
|
273
285
|
end
|
274
286
|
|
275
|
-
def self.handleQueueAction(currentUrlWithoutQueueITToken, queueitToken, customerIntegration, customerId, secretKey, matchedConfig, request, debugEntries)
|
287
|
+
def self.handleQueueAction(currentUrlWithoutQueueITToken, queueitToken, customerIntegration, customerId, secretKey, matchedConfig, request, debugEntries, isDebug)
|
276
288
|
queueConfig = QueueEventConfig.new
|
277
289
|
queueConfig.eventId = matchedConfig["EventId"]
|
278
290
|
queueConfig.queueDomain = matchedConfig["QueueDomain"]
|
@@ -282,7 +294,8 @@ module QueueIt
|
|
282
294
|
queueConfig.extendCookieValidity = matchedConfig["ExtendCookieValidity"]
|
283
295
|
queueConfig.cookieValidityMinute = matchedConfig["CookieValidityMinute"]
|
284
296
|
queueConfig.version = customerIntegration["Version"]
|
285
|
-
|
297
|
+
queueConfig.actionName = matchedConfig["Name"]
|
298
|
+
|
286
299
|
case matchedConfig["RedirectLogic"]
|
287
300
|
when "ForcedTargetUrl"
|
288
301
|
targetUrl = matchedConfig["ForcedTargetUrl"]
|
@@ -292,23 +305,34 @@ module QueueIt
|
|
292
305
|
targetUrl = generateTargetUrl(currentUrlWithoutQueueITToken, request)
|
293
306
|
end
|
294
307
|
|
295
|
-
return _resolveQueueRequestByLocalConfig(targetUrl, queueitToken, queueConfig, customerId, secretKey, request, debugEntries)
|
308
|
+
return _resolveQueueRequestByLocalConfig(targetUrl, queueitToken, queueConfig, customerId, secretKey, request, debugEntries, isDebug)
|
296
309
|
end
|
297
310
|
|
298
|
-
def self.handleCancelAction(currentUrlWithoutQueueITToken, queueitToken, customerIntegration, customerId, secretKey, matchedConfig, request, debugEntries)
|
311
|
+
def self.handleCancelAction(currentUrlWithoutQueueITToken, queueitToken, customerIntegration, customerId, secretKey, matchedConfig, request, debugEntries, isDebug)
|
299
312
|
cancelConfig = CancelEventConfig.new
|
300
313
|
cancelConfig.eventId = matchedConfig["EventId"]
|
301
314
|
cancelConfig.queueDomain = matchedConfig["QueueDomain"]
|
302
315
|
cancelConfig.cookieDomain = matchedConfig["CookieDomain"]
|
303
316
|
cancelConfig.version = customerIntegration["Version"]
|
304
|
-
|
305
|
-
|
317
|
+
cancelConfig.actionName = matchedConfig["Name"]
|
318
|
+
|
319
|
+
return _cancelRequestByLocalConfig(currentUrlWithoutQueueITToken, queueitToken, cancelConfig, customerId, secretKey, request, debugEntries, isDebug)
|
306
320
|
end
|
307
321
|
|
308
322
|
def self.cancelRequestByLocalConfig(targetUrl, queueitToken, cancelConfig, customerId, secretKey, request)
|
309
323
|
debugEntries = Hash.new
|
324
|
+
connectorDiagnostics = ConnectorDiagnostics.verify(customerId, secretKey, queueitToken)
|
325
|
+
|
326
|
+
if(connectorDiagnostics.hasError)
|
327
|
+
return connectorDiagnostics.validationResult
|
328
|
+
end
|
310
329
|
begin
|
311
|
-
return _cancelRequestByLocalConfig(targetUrl, queueitToken, cancelConfig, customerId, secretKey, request, debugEntries)
|
330
|
+
return _cancelRequestByLocalConfig(targetUrl, queueitToken, cancelConfig, customerId, secretKey, request, debugEntries, connectorDiagnostics.isEnabled)
|
331
|
+
rescue Exception => e
|
332
|
+
if(connectorDiagnostics.isEnabled)
|
333
|
+
debugEntries["Exception"] = e.message
|
334
|
+
end
|
335
|
+
raise e
|
312
336
|
ensure
|
313
337
|
setDebugCookie(debugEntries, request.cookie_jar)
|
314
338
|
end
|
@@ -319,6 +343,10 @@ module QueueIt
|
|
319
343
|
# Therefore we need this method to be able to access the 'real' original url.
|
320
344
|
return request.env["rack.url_scheme"] + "://" + request.env["HTTP_HOST"] + request.original_fullpath
|
321
345
|
end
|
346
|
+
|
347
|
+
def self.getRuntime()
|
348
|
+
return RUBY_VERSION.to_s
|
349
|
+
end
|
322
350
|
end
|
323
351
|
|
324
352
|
class CookieManager
|
@@ -11,6 +11,12 @@ module QueueIt
|
|
11
11
|
end
|
12
12
|
return value.to_s
|
13
13
|
end
|
14
|
+
def self.urlEncode(value)
|
15
|
+
return CGI.escape(value).gsub("+", "%20").gsub("%7E", "~")
|
16
|
+
end
|
17
|
+
def self.urlDecode(value)
|
18
|
+
return CGI.unescape(value)
|
19
|
+
end
|
14
20
|
end
|
15
21
|
|
16
22
|
class CancelEventConfig
|
@@ -18,19 +24,22 @@ module QueueIt
|
|
18
24
|
attr_accessor :queueDomain
|
19
25
|
attr_accessor :cookieDomain
|
20
26
|
attr_accessor :version
|
27
|
+
attr_accessor :actionName
|
21
28
|
|
22
29
|
def initialize
|
23
30
|
@eventId = nil
|
24
31
|
@queueDomain = nil
|
25
32
|
@cookieDomain = nil
|
26
33
|
@version = nil
|
34
|
+
@actionName = "unspecified"
|
27
35
|
end
|
28
36
|
|
29
37
|
def toString
|
30
38
|
return "EventId:" + Utils.toString(eventId) +
|
31
39
|
"&Version:" + Utils.toString(version) +
|
32
40
|
"&QueueDomain:" + Utils.toString(queueDomain) +
|
33
|
-
"&CookieDomain:" + Utils.toString(cookieDomain)
|
41
|
+
"&CookieDomain:" + Utils.toString(cookieDomain) +
|
42
|
+
"&ActionName:" + Utils.toString(actionName)
|
34
43
|
end
|
35
44
|
end
|
36
45
|
|
@@ -43,6 +52,7 @@ module QueueIt
|
|
43
52
|
attr_accessor :cookieValidityMinute
|
44
53
|
attr_accessor :cookieDomain
|
45
54
|
attr_accessor :version
|
55
|
+
attr_accessor :actionName
|
46
56
|
|
47
57
|
def initialize
|
48
58
|
@eventId = nil
|
@@ -53,6 +63,7 @@ module QueueIt
|
|
53
63
|
@cookieValidityMinute = nil
|
54
64
|
@cookieDomain = nil
|
55
65
|
@version = nil
|
66
|
+
@actionName = "unspecified"
|
56
67
|
end
|
57
68
|
|
58
69
|
def toString
|
@@ -63,7 +74,8 @@ module QueueIt
|
|
63
74
|
"&ExtendCookieValidity:" + Utils.toString(extendCookieValidity) +
|
64
75
|
"&CookieValidityMinute:" + Utils.toString(cookieValidityMinute) +
|
65
76
|
"&LayoutName:" + Utils.toString(layoutName) +
|
66
|
-
"&Culture:" + Utils.toString(culture)
|
77
|
+
"&Culture:" + Utils.toString(culture) +
|
78
|
+
"&ActionName:" + Utils.toString(actionName)
|
67
79
|
end
|
68
80
|
end
|
69
81
|
|
@@ -73,14 +85,16 @@ module QueueIt
|
|
73
85
|
attr_reader :queueId
|
74
86
|
attr_reader :redirectUrl
|
75
87
|
attr_reader :redirectType
|
88
|
+
attr_accessor :actionName
|
76
89
|
attr_accessor :isAjaxResult
|
77
90
|
|
78
|
-
def initialize(actionType, eventId, queueId, redirectUrl, redirectType)
|
91
|
+
def initialize(actionType, eventId, queueId, redirectUrl, redirectType, actionName)
|
79
92
|
@actionType = actionType
|
80
93
|
@eventId = eventId
|
81
94
|
@queueId = queueId
|
82
95
|
@redirectUrl = redirectUrl
|
83
96
|
@redirectType = redirectType
|
97
|
+
@actionName = actionName
|
84
98
|
end
|
85
99
|
|
86
100
|
def doRedirect
|
@@ -93,7 +107,7 @@ module QueueIt
|
|
93
107
|
|
94
108
|
def getAjaxRedirectUrl
|
95
109
|
if !Utils.isNilOrEmpty(@redirectUrl)
|
96
|
-
return
|
110
|
+
return Utils.urlEncode(@redirectUrl)
|
97
111
|
end
|
98
112
|
return ""
|
99
113
|
end
|
@@ -1,13 +1,13 @@
|
|
1
1
|
module QueueIt
|
2
2
|
class QueueUrlParams
|
3
|
-
KEY_VALUE_SEPARATOR_GROUP_CHAR = '~'
|
4
|
-
KEY_VALUE_SEPARATOR_CHAR = '_'
|
3
|
+
KEY_VALUE_SEPARATOR_GROUP_CHAR = '~'
|
4
|
+
KEY_VALUE_SEPARATOR_CHAR = '_'
|
5
5
|
TIMESTAMP_KEY = "ts"
|
6
|
-
COOKIE_VALIDITY_MINUTES_KEY = "cv"
|
7
|
-
EVENT_ID_KEY = "e"
|
8
|
-
EXTENDABLE_COOKIE_KEY = "ce"
|
9
|
-
HASH_KEY = "h"
|
10
|
-
QUEUE_ID_KEY = "q"
|
6
|
+
COOKIE_VALIDITY_MINUTES_KEY = "cv"
|
7
|
+
EVENT_ID_KEY = "e"
|
8
|
+
EXTENDABLE_COOKIE_KEY = "ce"
|
9
|
+
HASH_KEY = "h"
|
10
|
+
QUEUE_ID_KEY = "q"
|
11
11
|
REDIRECT_TYPE_KEY = "rt"
|
12
12
|
|
13
13
|
attr_accessor :timeStamp
|
@@ -33,49 +33,49 @@ module QueueIt
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def self.extractQueueParams(queueitToken)
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
paramsNameValueList = result.queueITToken.split(KEY_VALUE_SEPARATOR_GROUP_CHAR)
|
36
|
+
if(Utils.isNilOrEmpty(queueitToken))
|
37
|
+
return nil
|
38
|
+
end
|
39
|
+
result = QueueUrlParams.new
|
40
|
+
result.queueITToken = queueitToken
|
41
|
+
paramsNameValueList = result.queueITToken.split(KEY_VALUE_SEPARATOR_GROUP_CHAR)
|
43
42
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
begin
|
50
|
-
result.timeStamp = Integer(paramNameValueArr[1])
|
51
|
-
rescue
|
52
|
-
result.timeStamp = 0
|
53
|
-
end
|
54
|
-
when COOKIE_VALIDITY_MINUTES_KEY
|
55
|
-
begin
|
56
|
-
result.cookieValidityMinutes = Integer(paramNameValueArr[1])
|
57
|
-
rescue
|
58
|
-
result.cookieValidityMinutes = nil
|
59
|
-
end
|
60
|
-
when EVENT_ID_KEY
|
61
|
-
result.eventId = paramNameValueArr[1]
|
62
|
-
when EXTENDABLE_COOKIE_KEY
|
63
|
-
if paramNameValueArr[1].upcase.eql? 'TRUE'
|
64
|
-
result.extendableCookie = true
|
65
|
-
end
|
66
|
-
when HASH_KEY
|
67
|
-
result.hashCode = paramNameValueArr[1]
|
68
|
-
when QUEUE_ID_KEY
|
69
|
-
result.queueId = paramNameValueArr[1]
|
70
|
-
when REDIRECT_TYPE_KEY
|
71
|
-
result.redirectType = paramNameValueArr[1]
|
72
|
-
end
|
43
|
+
paramsNameValueList.each do |pNameValue|
|
44
|
+
paramNameValueArr = pNameValue.split(KEY_VALUE_SEPARATOR_CHAR)
|
45
|
+
|
46
|
+
if(!paramNameValueArr.length().eql? 2)
|
47
|
+
next
|
73
48
|
end
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
49
|
+
|
50
|
+
case paramNameValueArr[0]
|
51
|
+
when HASH_KEY
|
52
|
+
result.hashCode = paramNameValueArr[1]
|
53
|
+
when TIMESTAMP_KEY
|
54
|
+
if paramNameValueArr[1] !~ /\D/
|
55
|
+
result.timeStamp = paramNameValueArr[1].to_i
|
56
|
+
else
|
57
|
+
result.timeStamp = 0
|
58
|
+
end
|
59
|
+
when COOKIE_VALIDITY_MINUTES_KEY
|
60
|
+
if paramNameValueArr[1] !~ /\D/
|
61
|
+
result.cookieValidityMinutes = paramNameValueArr[1].to_i
|
62
|
+
else
|
63
|
+
result.cookieValidityMinutes = nil
|
64
|
+
end
|
65
|
+
when EVENT_ID_KEY
|
66
|
+
result.eventId = paramNameValueArr[1]
|
67
|
+
when EXTENDABLE_COOKIE_KEY
|
68
|
+
if paramNameValueArr[1].upcase.eql? 'TRUE'
|
69
|
+
result.extendableCookie = true
|
70
|
+
end
|
71
|
+
when QUEUE_ID_KEY
|
72
|
+
result.queueId = paramNameValueArr[1]
|
73
|
+
when REDIRECT_TYPE_KEY
|
74
|
+
result.redirectType = paramNameValueArr[1]
|
75
|
+
end
|
78
76
|
end
|
77
|
+
result.queueITTokenWithoutHash = result.queueITToken.gsub((KEY_VALUE_SEPARATOR_GROUP_CHAR + HASH_KEY + KEY_VALUE_SEPARATOR_CHAR + result.hashCode), "")
|
78
|
+
return result
|
79
79
|
end
|
80
80
|
end
|
81
81
|
end
|
@@ -3,7 +3,8 @@ require 'cgi'
|
|
3
3
|
|
4
4
|
module QueueIt
|
5
5
|
class UserInQueueService
|
6
|
-
|
6
|
+
SDK_VERSION_NO = "3.6.0"
|
7
|
+
SDK_VERSION = "v3-ruby-" + SDK_VERSION_NO
|
7
8
|
|
8
9
|
def initialize(userInQueueStateRepository)
|
9
10
|
@userInQueueStateRepository = userInQueueStateRepository
|
@@ -21,14 +22,15 @@ module QueueIt
|
|
21
22
|
state.redirectType,
|
22
23
|
secretKey)
|
23
24
|
end
|
24
|
-
return RequestValidationResult.new(ActionTypes::QUEUE, config.eventId, state.queueId, nil, state.redirectType)
|
25
|
+
return RequestValidationResult.new(ActionTypes::QUEUE, config.eventId, state.queueId, nil, state.redirectType, config.actionName)
|
25
26
|
end
|
26
|
-
|
27
|
+
|
27
28
|
queueParams = QueueUrlParams::extractQueueParams(queueitToken)
|
29
|
+
|
28
30
|
if(!queueParams.nil?)
|
29
|
-
return getQueueITTokenValidationResult(targetUrl, config
|
31
|
+
return getQueueITTokenValidationResult(targetUrl, config, queueParams, customerId, secretKey)
|
30
32
|
else
|
31
|
-
return
|
33
|
+
return cancelQueueCookieReturnQueueResult(targetUrl, config, customerId)
|
32
34
|
end
|
33
35
|
end
|
34
36
|
|
@@ -36,30 +38,27 @@ module QueueIt
|
|
36
38
|
state = @userInQueueStateRepository.getState(cancelConfig.eventId, -1, secretKey, false)
|
37
39
|
if (state.isValid)
|
38
40
|
@userInQueueStateRepository.cancelQueueCookie(cancelConfig.eventId, cancelConfig.cookieDomain)
|
39
|
-
query = getQueryString(customerId, cancelConfig.eventId, cancelConfig.version, nil, nil) +
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
redirectUrl = "https://" + domainAlias + "cancel/" + customerId + "/" + cancelConfig.eventId + "/?" + query
|
47
|
-
return RequestValidationResult.new(ActionTypes::CANCEL, cancelConfig.eventId, state.queueId, redirectUrl, state.redirectType)
|
41
|
+
query = getQueryString(customerId, cancelConfig.eventId, cancelConfig.version, cancelConfig.actionName, nil, nil) +
|
42
|
+
(!Utils::isNilOrEmpty(targetUrl) ? ("&r=" + Utils.urlEncode(targetUrl)) : "" )
|
43
|
+
uriPath = "cancel/" + customerId + "/" + cancelConfig.eventId + "/"
|
44
|
+
|
45
|
+
redirectUrl = generateRedirectUrl(cancelConfig.queueDomain, uriPath, query)
|
46
|
+
return RequestValidationResult.new(ActionTypes::CANCEL, cancelConfig.eventId, state.queueId, redirectUrl, state.redirectType, cancelConfig.actionName)
|
48
47
|
else
|
49
|
-
return RequestValidationResult.new(ActionTypes::CANCEL, cancelConfig.eventId, nil, nil, nil)
|
48
|
+
return RequestValidationResult.new(ActionTypes::CANCEL, cancelConfig.eventId, nil, nil, nil, cancelConfig.actionName)
|
50
49
|
end
|
51
50
|
end
|
52
51
|
|
53
|
-
def getQueueITTokenValidationResult(targetUrl,
|
52
|
+
def getQueueITTokenValidationResult(targetUrl, config, queueParams,customerId, secretKey)
|
54
53
|
calculatedHash = OpenSSL::HMAC.hexdigest('sha256', secretKey, queueParams.queueITTokenWithoutHash)
|
55
54
|
if (calculatedHash.upcase() != queueParams.hashCode.upcase())
|
56
|
-
return
|
55
|
+
return cancelQueueCookieReturnErrorResult(customerId, targetUrl, config, queueParams, "hash")
|
57
56
|
end
|
58
|
-
if (queueParams.eventId.upcase() != eventId.upcase())
|
59
|
-
return
|
57
|
+
if (queueParams.eventId.upcase() != config.eventId.upcase())
|
58
|
+
return cancelQueueCookieReturnErrorResult(customerId, targetUrl, config, queueParams, "eventid")
|
60
59
|
end
|
61
60
|
if (queueParams.timeStamp < Time.now.getutc.tv_sec)
|
62
|
-
return
|
61
|
+
return cancelQueueCookieReturnErrorResult(customerId, targetUrl, config, queueParams, "timestamp")
|
63
62
|
end
|
64
63
|
|
65
64
|
@userInQueueStateRepository.store(
|
@@ -69,51 +68,63 @@ module QueueIt
|
|
69
68
|
!Utils::isNilOrEmpty(config.cookieDomain) ? config.cookieDomain : '',
|
70
69
|
queueParams.redirectType,
|
71
70
|
secretKey)
|
72
|
-
return RequestValidationResult.new(ActionTypes::QUEUE, config.eventId, queueParams.queueId, nil, queueParams.redirectType)
|
71
|
+
return RequestValidationResult.new(ActionTypes::QUEUE, config.eventId, queueParams.queueId, nil, queueParams.redirectType, config.actionName)
|
73
72
|
end
|
74
73
|
|
75
|
-
def
|
76
|
-
|
74
|
+
def cancelQueueCookieReturnErrorResult(customerId, targetUrl, config, qParams, errorCode)
|
75
|
+
@userInQueueStateRepository.cancelQueueCookie(config.eventId, config.cookieDomain)
|
76
|
+
|
77
|
+
query = getQueryString(customerId, config.eventId, config.version, config.actionName, config.culture, config.layoutName) +
|
77
78
|
"&queueittoken=" + qParams.queueITToken +
|
78
79
|
"&ts=" + Time.now.getutc.tv_sec.to_s +
|
79
|
-
(!Utils::isNilOrEmpty(targetUrl) ? ("&t=" +
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
redirectUrl = "https://" + domainAlias + "error/" + errorCode + "/?" + query
|
85
|
-
return RequestValidationResult.new(ActionTypes::QUEUE, config.eventId, nil, redirectUrl, nil)
|
80
|
+
(!Utils::isNilOrEmpty(targetUrl) ? ("&t=" + Utils.urlEncode(targetUrl)) : "")
|
81
|
+
|
82
|
+
redirectUrl = generateRedirectUrl(config.queueDomain, "error/" + errorCode + "/", query)
|
83
|
+
|
84
|
+
return RequestValidationResult.new(ActionTypes::QUEUE, config.eventId, nil, redirectUrl, nil, config.actionName)
|
86
85
|
end
|
87
86
|
|
88
|
-
def
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
87
|
+
def cancelQueueCookieReturnQueueResult(targetUrl, config, customerId)
|
88
|
+
@userInQueueStateRepository.cancelQueueCookie(config.eventId, config.cookieDomain)
|
89
|
+
|
90
|
+
query = getQueryString(customerId, config.eventId, config.version, config.actionName, config.culture, config.layoutName) +
|
91
|
+
(!Utils::isNilOrEmpty(targetUrl) ? "&t=" + Utils.urlEncode( targetUrl) : "")
|
92
|
+
|
93
|
+
redirectUrl = generateRedirectUrl(config.queueDomain, "", query)
|
94
|
+
|
95
|
+
return RequestValidationResult.new(ActionTypes::QUEUE, config.eventId, nil, redirectUrl, nil, config.actionName)
|
94
96
|
end
|
95
97
|
|
96
|
-
def getQueryString(customerId, eventId, configVersion, culture, layoutName)
|
98
|
+
def getQueryString(customerId, eventId, configVersion, actionName, culture, layoutName)
|
97
99
|
queryStringList = Array.new
|
98
|
-
queryStringList.push("c=" +
|
99
|
-
queryStringList.push("e=" +
|
100
|
-
queryStringList.push("ver=
|
100
|
+
queryStringList.push("c=" + Utils.urlEncode(customerId))
|
101
|
+
queryStringList.push("e=" + Utils.urlEncode(eventId))
|
102
|
+
queryStringList.push("ver=" + SDK_VERSION)
|
101
103
|
queryStringList.push("cver=" + (!configVersion.nil? ? configVersion.to_s : '-1'))
|
104
|
+
queryStringList.push("man=" + Utils.urlEncode(actionName))
|
105
|
+
|
102
106
|
if (!Utils::isNilOrEmpty(culture))
|
103
|
-
queryStringList.push("cid=" +
|
107
|
+
queryStringList.push("cid=" + Utils.urlEncode(culture))
|
104
108
|
end
|
105
109
|
if (!Utils::isNilOrEmpty(layoutName))
|
106
|
-
queryStringList.push("l=" +
|
110
|
+
queryStringList.push("l=" + Utils.urlEncode(layoutName))
|
107
111
|
end
|
108
112
|
return queryStringList.join("&")
|
109
113
|
end
|
110
114
|
|
115
|
+
def generateRedirectUrl(queueDomain, uriPath, query)
|
116
|
+
if (!queueDomain.end_with?("/") )
|
117
|
+
queueDomain = queueDomain + "/"
|
118
|
+
end
|
119
|
+
return "https://" + queueDomain + uriPath + "?" + query
|
120
|
+
end
|
121
|
+
|
111
122
|
def extendQueueCookie(eventId, cookieValidityMinutes, cookieDomain, secretKey)
|
112
123
|
@userInQueueStateRepository.reissueQueueCookie(eventId, cookieValidityMinutes, cookieDomain, secretKey)
|
113
124
|
end
|
114
125
|
|
115
|
-
def getIgnoreActionResult()
|
116
|
-
return RequestValidationResult.new(ActionTypes::IGNORE, nil, nil, nil, nil)
|
126
|
+
def getIgnoreActionResult(actionName)
|
127
|
+
return RequestValidationResult.new(ActionTypes::IGNORE, nil, nil, nil, nil, actionName)
|
117
128
|
end
|
118
129
|
end
|
119
130
|
end
|
@@ -143,7 +143,7 @@ module QueueIt
|
|
143
143
|
end
|
144
144
|
|
145
145
|
def getState(eventId, cookieValidityMinutes, secretKey, validateTime)
|
146
|
-
cookieKey =
|
146
|
+
cookieKey = self.class.getCookieKey(eventId)
|
147
147
|
if (@cookieManager.getCookie(cookieKey).nil?)
|
148
148
|
return StateInfo.new(false, nil, nil, nil)
|
149
149
|
end
|
data/license.txt
ADDED
@@ -0,0 +1,165 @@
|
|
1
|
+
GNU LESSER GENERAL PUBLIC LICENSE
|
2
|
+
Version 3, 29 June 2007
|
3
|
+
|
4
|
+
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
5
|
+
Everyone is permitted to copy and distribute verbatim copies
|
6
|
+
of this license document, but changing it is not allowed.
|
7
|
+
|
8
|
+
|
9
|
+
This version of the GNU Lesser General Public License incorporates
|
10
|
+
the terms and conditions of version 3 of the GNU General Public
|
11
|
+
License, supplemented by the additional permissions listed below.
|
12
|
+
|
13
|
+
0. Additional Definitions.
|
14
|
+
|
15
|
+
As used herein, "this License" refers to version 3 of the GNU Lesser
|
16
|
+
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
17
|
+
General Public License.
|
18
|
+
|
19
|
+
"The Library" refers to a covered work governed by this License,
|
20
|
+
other than an Application or a Combined Work as defined below.
|
21
|
+
|
22
|
+
An "Application" is any work that makes use of an interface provided
|
23
|
+
by the Library, but which is not otherwise based on the Library.
|
24
|
+
Defining a subclass of a class defined by the Library is deemed a mode
|
25
|
+
of using an interface provided by the Library.
|
26
|
+
|
27
|
+
A "Combined Work" is a work produced by combining or linking an
|
28
|
+
Application with the Library. The particular version of the Library
|
29
|
+
with which the Combined Work was made is also called the "Linked
|
30
|
+
Version".
|
31
|
+
|
32
|
+
The "Minimal Corresponding Source" for a Combined Work means the
|
33
|
+
Corresponding Source for the Combined Work, excluding any source code
|
34
|
+
for portions of the Combined Work that, considered in isolation, are
|
35
|
+
based on the Application, and not on the Linked Version.
|
36
|
+
|
37
|
+
The "Corresponding Application Code" for a Combined Work means the
|
38
|
+
object code and/or source code for the Application, including any data
|
39
|
+
and utility programs needed for reproducing the Combined Work from the
|
40
|
+
Application, but excluding the System Libraries of the Combined Work.
|
41
|
+
|
42
|
+
1. Exception to Section 3 of the GNU GPL.
|
43
|
+
|
44
|
+
You may convey a covered work under sections 3 and 4 of this License
|
45
|
+
without being bound by section 3 of the GNU GPL.
|
46
|
+
|
47
|
+
2. Conveying Modified Versions.
|
48
|
+
|
49
|
+
If you modify a copy of the Library, and, in your modifications, a
|
50
|
+
facility refers to a function or data to be supplied by an Application
|
51
|
+
that uses the facility (other than as an argument passed when the
|
52
|
+
facility is invoked), then you may convey a copy of the modified
|
53
|
+
version:
|
54
|
+
|
55
|
+
a) under this License, provided that you make a good faith effort to
|
56
|
+
ensure that, in the event an Application does not supply the
|
57
|
+
function or data, the facility still operates, and performs
|
58
|
+
whatever part of its purpose remains meaningful, or
|
59
|
+
|
60
|
+
b) under the GNU GPL, with none of the additional permissions of
|
61
|
+
this License applicable to that copy.
|
62
|
+
|
63
|
+
3. Object Code Incorporating Material from Library Header Files.
|
64
|
+
|
65
|
+
The object code form of an Application may incorporate material from
|
66
|
+
a header file that is part of the Library. You may convey such object
|
67
|
+
code under terms of your choice, provided that, if the incorporated
|
68
|
+
material is not limited to numerical parameters, data structure
|
69
|
+
layouts and accessors, or small macros, inline functions and templates
|
70
|
+
(ten or fewer lines in length), you do both of the following:
|
71
|
+
|
72
|
+
a) Give prominent notice with each copy of the object code that the
|
73
|
+
Library is used in it and that the Library and its use are
|
74
|
+
covered by this License.
|
75
|
+
|
76
|
+
b) Accompany the object code with a copy of the GNU GPL and this license
|
77
|
+
document.
|
78
|
+
|
79
|
+
4. Combined Works.
|
80
|
+
|
81
|
+
You may convey a Combined Work under terms of your choice that,
|
82
|
+
taken together, effectively do not restrict modification of the
|
83
|
+
portions of the Library contained in the Combined Work and reverse
|
84
|
+
engineering for debugging such modifications, if you also do each of
|
85
|
+
the following:
|
86
|
+
|
87
|
+
a) Give prominent notice with each copy of the Combined Work that
|
88
|
+
the Library is used in it and that the Library and its use are
|
89
|
+
covered by this License.
|
90
|
+
|
91
|
+
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
92
|
+
document.
|
93
|
+
|
94
|
+
c) For a Combined Work that displays copyright notices during
|
95
|
+
execution, include the copyright notice for the Library among
|
96
|
+
these notices, as well as a reference directing the user to the
|
97
|
+
copies of the GNU GPL and this license document.
|
98
|
+
|
99
|
+
d) Do one of the following:
|
100
|
+
|
101
|
+
0) Convey the Minimal Corresponding Source under the terms of this
|
102
|
+
License, and the Corresponding Application Code in a form
|
103
|
+
suitable for, and under terms that permit, the user to
|
104
|
+
recombine or relink the Application with a modified version of
|
105
|
+
the Linked Version to produce a modified Combined Work, in the
|
106
|
+
manner specified by section 6 of the GNU GPL for conveying
|
107
|
+
Corresponding Source.
|
108
|
+
|
109
|
+
1) Use a suitable shared library mechanism for linking with the
|
110
|
+
Library. A suitable mechanism is one that (a) uses at run time
|
111
|
+
a copy of the Library already present on the user's computer
|
112
|
+
system, and (b) will operate properly with a modified version
|
113
|
+
of the Library that is interface-compatible with the Linked
|
114
|
+
Version.
|
115
|
+
|
116
|
+
e) Provide Installation Information, but only if you would otherwise
|
117
|
+
be required to provide such information under section 6 of the
|
118
|
+
GNU GPL, and only to the extent that such information is
|
119
|
+
necessary to install and execute a modified version of the
|
120
|
+
Combined Work produced by recombining or relinking the
|
121
|
+
Application with a modified version of the Linked Version. (If
|
122
|
+
you use option 4d0, the Installation Information must accompany
|
123
|
+
the Minimal Corresponding Source and Corresponding Application
|
124
|
+
Code. If you use option 4d1, you must provide the Installation
|
125
|
+
Information in the manner specified by section 6 of the GNU GPL
|
126
|
+
for conveying Corresponding Source.)
|
127
|
+
|
128
|
+
5. Combined Libraries.
|
129
|
+
|
130
|
+
You may place library facilities that are a work based on the
|
131
|
+
Library side by side in a single library together with other library
|
132
|
+
facilities that are not Applications and are not covered by this
|
133
|
+
License, and convey such a combined library under terms of your
|
134
|
+
choice, if you do both of the following:
|
135
|
+
|
136
|
+
a) Accompany the combined library with a copy of the same work based
|
137
|
+
on the Library, uncombined with any other library facilities,
|
138
|
+
conveyed under the terms of this License.
|
139
|
+
|
140
|
+
b) Give prominent notice with the combined library that part of it
|
141
|
+
is a work based on the Library, and explaining where to find the
|
142
|
+
accompanying uncombined form of the same work.
|
143
|
+
|
144
|
+
6. Revised Versions of the GNU Lesser General Public License.
|
145
|
+
|
146
|
+
The Free Software Foundation may publish revised and/or new versions
|
147
|
+
of the GNU Lesser General Public License from time to time. Such new
|
148
|
+
versions will be similar in spirit to the present version, but may
|
149
|
+
differ in detail to address new problems or concerns.
|
150
|
+
|
151
|
+
Each version is given a distinguishing version number. If the
|
152
|
+
Library as you received it specifies that a certain numbered version
|
153
|
+
of the GNU Lesser General Public License "or any later version"
|
154
|
+
applies to it, you have the option of following the terms and
|
155
|
+
conditions either of that published version or of any later version
|
156
|
+
published by the Free Software Foundation. If the Library as you
|
157
|
+
received it does not specify a version number of the GNU Lesser
|
158
|
+
General Public License, you may choose any version of the GNU Lesser
|
159
|
+
General Public License ever published by the Free Software Foundation.
|
160
|
+
|
161
|
+
If the Library as you received it specifies that a proxy can decide
|
162
|
+
whether future versions of the GNU Lesser General Public License shall
|
163
|
+
apply, that proxy's public statement of acceptance of any version is
|
164
|
+
permanent authorization for you to choose that version for the
|
165
|
+
Library.
|
data/queueit_knownuserv3.gemspec
CHANGED
@@ -5,7 +5,7 @@ require 'queueit_knownuserv3/user_in_queue_service'
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "queueit_knownuserv3"
|
8
|
-
spec.version = QueueIt::UserInQueueService::
|
8
|
+
spec.version = QueueIt::UserInQueueService::SDK_VERSION_NO
|
9
9
|
spec.authors = ["Queue-it"]
|
10
10
|
spec.email = ["support@queue-it.com"]
|
11
11
|
spec.licenses = "LGPL-3.0"
|
@@ -25,7 +25,4 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.bindir = "exe"
|
26
26
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
27
27
|
spec.require_paths = ["lib"]
|
28
|
-
|
29
|
-
spec.add_development_dependency "bundler", "~> 1.11"
|
30
|
-
spec.add_development_dependency "rake", "~> 10.0"
|
31
28
|
end
|
metadata
CHANGED
@@ -1,43 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: queueit_knownuserv3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.6.0
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Queue-it
|
8
9
|
autorequire:
|
9
10
|
bindir: exe
|
10
11
|
cert_chain: []
|
11
|
-
date:
|
12
|
-
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: bundler
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ~>
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.11'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ~>
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '1.11'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rake
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ~>
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '10.0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ~>
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '10.0'
|
12
|
+
date: 2020-03-02 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
41
14
|
description:
|
42
15
|
email:
|
43
16
|
- support@queue-it.com
|
@@ -45,40 +18,50 @@ executables: []
|
|
45
18
|
extensions: []
|
46
19
|
extra_rdoc_files: []
|
47
20
|
files:
|
21
|
+
- .devcontainer/Dockerfile
|
22
|
+
- .devcontainer/devcontainer.json
|
23
|
+
- .vs/VSWorkspaceState.json
|
24
|
+
- .vs/knownuser-v3-ruby/v16/.suo
|
25
|
+
- .vs/slnx.sqlite
|
26
|
+
- .vscode/launch.json
|
48
27
|
- Gemfile
|
49
28
|
- Rakefile
|
50
29
|
- bin/console
|
51
30
|
- bin/setup
|
31
|
+
- ci-build.yml
|
52
32
|
- lib/queueit_knownuserv3.rb
|
33
|
+
- lib/queueit_knownuserv3/connector_diagnostics.rb
|
53
34
|
- lib/queueit_knownuserv3/integration_config_helpers.rb
|
54
35
|
- lib/queueit_knownuserv3/known_user.rb
|
55
36
|
- lib/queueit_knownuserv3/models.rb
|
56
37
|
- lib/queueit_knownuserv3/queue_url_params.rb
|
57
38
|
- lib/queueit_knownuserv3/user_in_queue_service.rb
|
58
39
|
- lib/queueit_knownuserv3/user_in_queue_state_cookie_repository.rb
|
40
|
+
- license.txt
|
59
41
|
- queueit_knownuserv3.gemspec
|
60
42
|
homepage: https://www.queue-it.com/
|
61
43
|
licenses:
|
62
44
|
- LGPL-3.0
|
63
|
-
metadata: {}
|
64
45
|
post_install_message:
|
65
46
|
rdoc_options: []
|
66
47
|
require_paths:
|
67
48
|
- lib
|
68
49
|
required_ruby_version: !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
69
51
|
requirements:
|
70
52
|
- - ! '>='
|
71
53
|
- !ruby/object:Gem::Version
|
72
54
|
version: '0'
|
73
55
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
56
|
+
none: false
|
74
57
|
requirements:
|
75
58
|
- - ! '>='
|
76
59
|
- !ruby/object:Gem::Version
|
77
60
|
version: '0'
|
78
61
|
requirements: []
|
79
62
|
rubyforge_project:
|
80
|
-
rubygems_version:
|
63
|
+
rubygems_version: 1.8.23.2
|
81
64
|
signing_key:
|
82
|
-
specification_version:
|
65
|
+
specification_version: 3
|
83
66
|
summary: Gem for implementing Queue-it KnownUser V3
|
84
67
|
test_files: []
|
checksums.yaml
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
---
|
2
|
-
!binary "U0hBMQ==":
|
3
|
-
metadata.gz: !binary |-
|
4
|
-
NWIwOWViMTkzYTAzOWQ2OThhYmNiNzM3NTRmOWRlYjYyNjg1YTc4NQ==
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
NmI4ZTJkYTM4MzNjYTcyMDU3N2UxMDdjMmMxNjE1MjRiYTlhZjkwNA==
|
7
|
-
SHA512:
|
8
|
-
metadata.gz: !binary |-
|
9
|
-
ZmQxZGEwYTM5ZWE3ZTc5MzdlYzgzZWNhOWZkZjc2M2JiYTMyY2M0YjM1MDg5
|
10
|
-
ZGE1NTAwM2Q0YTcwMGE4ZWNmYmYyOTNiYzY0Mzk1OGQ5OWUwZjNlNjAyYmU3
|
11
|
-
YTRkN2VlNTg3NjI4ZTk3MTExYmI2MThkZmI4MGRjNWEyMTY5MTY=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
ODg3OGY5Mjk4M2ZiMzIwOGRkZWZjZTVlMTA0NTViZmU5OTFiNmNkYzc0ZGU4
|
14
|
-
NTQ1ZTU0MzQ5MTlmMjE1YzYwMzEwZGYzOTkzMDdkMjBkOWY1YjIyMDA3OTI5
|
15
|
-
ZTVkZmE4NGIyZTIxODU2MWJmYjQxMWQ3ZDU4OGRmM2YxNmRlYTc=
|