diff --git a/enable_sense_nfs_support.ps1 b/enable_sense_nfs_support.ps1
index 37e563f..06ef2cf 100644
--- a/enable_sense_nfs_support.ps1
+++ b/enable_sense_nfs_support.ps1
@@ -17,4 +17,4 @@ Write-Host "-----------------------------------------------------------"
Write-Host " Updating Engine for NFS Support "
Write-Host "-----------------------------------------------------------"
Set-Content -Path C:\ProgramData\Qlik\Sense\Engine\Settings.ini -Value "[Settings 7]`r`nMapNetworkDrives=1"
-Restart-Service QlikSenseEngineService -Force
\ No newline at end of file
+Restart-Service QlikSenseEngineService -Force
diff --git a/install-winget-server.ps1 b/install-winget-server.ps1
index 0e6a124..e885ca0 100644
--- a/install-winget-server.ps1
+++ b/install-winget-server.ps1
@@ -20,7 +20,7 @@ if(-not (Test-Path $RepoPath ))
if(-not (Test-Path (Join-Path $RepoPath -ChildPath $WinGet_Name )))
{
- Invoke-WebRequest -Uri $WinGet_Link -OutFile (Join-Path $RepoPath -ChildPath $WinGet_Name )
+ Invoke-WebRequest -useb $WinGet_Link -OutFile (Join-Path $RepoPath -ChildPath $WinGet_Name )
} else
{
Write-Information "The file $WinGet_Name already exist in the repo. Skip download"
diff --git a/jwt-scratch/41w b/jwt-scratch/41w
deleted file mode 100644
index a8037e0..0000000
--- a/jwt-scratch/41w
+++ /dev/null
@@ -1,46 +0,0 @@
-require("amd-loader");
-
-define(function() {
- return function() {
- require(['qlik', 'enigma', 'autogenerated/qix/engine-api'], function(qlik, enigma, schema) {
- //The base config with all details filled in
- var config = {
- schema: schema,
- appId: "My Demo App.qvf",
- session: {
- host: "qseow.jprdonnelly.com",
- port: 443,
- prefix: "",
- unsecure: true,
- },
- }
- //Now that we have a config, use that to connect to the //QIX service.
- enigma.getService("qix", config).then(function(qlik) {
- qlik.global.openApp(config.appId)
- //Open App
- qlik.global.openApp(config.appId).then(function(app) {
- //Create SessionObject for FieldList
- app.createSessionObject({
- qFieldListDef: {
- qShowSystem: false,
- qShowHidden: false,
- qShowSrcTables: true,
- qShowSemantic: true,
- qShowDerivedFields: true
- },
- qInfo: {
- qId: "FieldList",
- qType: "FieldList"
- }
- }).then(function(list) {
- return list.getLayout();
- }).then(function(listLayout) {
- return listLayout.qFieldList.qItems;
- }).then(function(fieldItems) {
- console.log(fieldItems)
- });
- })
- })
- })
- }
- })
diff --git a/jwt-scratch/keys/client.pem b/jwt-scratch/keys/client.pem
deleted file mode 100644
index 02b3819..0000000
--- a/jwt-scratch/keys/client.pem
+++ /dev/null
@@ -1,19 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIDDDCCAfSgAwIBAgIQAIB5hhFvreUNHfHljwkEwTANBgkqhkiG9w0BAQsFADAV
-MRMwEQYDVQQDDApjZW50cmFsLUNBMB4XDTIxMDIwNzE3MDUxNloXDTMxMDIxNDE3
-MDUxNlowFTETMBEGA1UEAwwKUWxpa0NsaWVudDCCASIwDQYJKoZIhvcNAQEBBQAD
-ggEPADCCAQoCggEBAMC5D8WvsgNFnB3NUCKxqX+3xn8X971y4pX600HampPDq+bJ
-5yJQsDo0LcfGDl4XZvvDNFB2GFxrYef3S5xHp9QSWhj3dll0k0rAl0ITbKkQNHhF
-L3meDd0d0DCshcCmEia0vRryYLVtUCBm00tyiWPLIC925XqYBp85B38quD0gLaaM
-c79R/LUoqjf4589pIowFfYjzB/NK1qbERNhtu0W+FH/5+eh8WNlsJ/dfs0h0dC5/
-n0/qPBl15qh40AWb9zUiQd1BUBdrhVm6bSD0zOjEDbuCAjr7Dk9QnsUl3wVpjIEK
-aP6JVln0En4fzEfPgfiJjeO69xfXe1gG8HVtXJ0CAwEAAaNYMFYwHQYDVR0OBBYE
-FHPiw6xQnTxXBQJKw4ovSrLIZ55XMB8GA1UdIwQYMBaAFLXVWapk7qSadaPJG+SA
-mgbDwwqsMBQGCCsGAQUFBw0DBAgEBkNsaWVudDANBgkqhkiG9w0BAQsFAAOCAQEA
-L1ndp+V+MBb8oMpmDEen5fzwO0U9t7kLe6tShFGvpYvVV6W4BnsaEHi9ebD5SbBK
-MLmN63B8mACDxJp4esXiZcSj2phTLOdOEm3/TWtLB0YBiKhDQRIrSyI/9Uxfk3NW
-YY/htDe0Xe1CRBUJvFD03a15+BkXAoALuYBBku0gveeJUXkDuVe/UNzVdLd3Z/1B
-cdieROmUWK/I1JJyjDPEvGbPJ9EBI37Iop6tPDBasHSEmGHmFVZj5+rSiGFJOGJn
-whiMV3mOdHyL+peqyj7Q8Uv72RgW0QLRBdssYcQWuQcEcuozCz0ARYTQk7CNHwsF
-iXP+k9NziyFT8sdE8ccd7w==
------END CERTIFICATE-----
diff --git a/jwt-scratch/keys/client_key.pem b/jwt-scratch/keys/client_key.pem
deleted file mode 100644
index e94662c..0000000
--- a/jwt-scratch/keys/client_key.pem
+++ /dev/null
@@ -1,27 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-MIIEpAIBAAKCAQEAwLkPxa+yA0WcHc1QIrGpf7fGfxf3vXLilfrTQdqak8Or5snn
-IlCwOjQtx8YOXhdm+8M0UHYYXGth5/dLnEen1BJaGPd2WXSTSsCXQhNsqRA0eEUv
-eZ4N3R3QMKyFwKYSJrS9GvJgtW1QIGbTS3KJY8sgL3blepgGnzkHfyq4PSAtpoxz
-v1H8tSiqN/jnz2kijAV9iPMH80rWpsRE2G27Rb4Uf/n56HxY2Wwn91+zSHR0Ln+f
-T+o8GXXmqHjQBZv3NSJB3UFQF2uFWbptIPTM6MQNu4ICOvsOT1CexSXfBWmMgQpo
-/olWWfQSfh/MR8+B+ImN47r3F9d7WAbwdW1cnQIDAQABAoIBAQCGhWZl9XJK6F7F
-Spdh8CLA3FU4R1GMslFIoNCvCdiVxaIKsOmdwTaRGfTOmgdTVAB1QVcVxqjQcb/g
-O3RSfI2/8KNlA+5fGIjrR60M2SQiigYl4Rz3RgSlT/cO0o114DWRQN0ynvY0DT49
-r6hS5HrT5mfr2ZDqVo1gvFzoPbhmKQVrQv9l1Owb+ZI1zzzvOE5pBkWv+vU3mLJ5
-XzsDGC87MQj9l6iSh/HU1zQQ0VgTJ8hB3NL7vRZMYn6zyzpaDdRyerysGfJZtWfd
-Q4Z/ANIv67LHch5FWJBA5iOPiZZFqPdPaptfbaGO+CFk8M55YAS0QY4zBD8YxBxt
-qo379k79AoGBAPOhh5dR1Ox6MEiInATDnrqLCuamJWwiAU+KMDqrKnIi9FNSfQd5
-F16PGI5/kmbnc6jLftDdLBgeWU+BoAqRtXoOUt7NXp62jkjy0c9lmo1wAEhvS3Fj
-+csp2VCgadmx+0QXN5b0gMbznHRx7pXptASslVw1VlTQ6XWEfIyFoKIDAoGBAMqB
-4UVXYx6bkClppeFNlZRvpXMnDSFm+0UCKmoHAu1WsoSbJ2nErxB1T6NLe6fI/NXr
-vFINRXUZ8rgInFTCeeQamRuxsRXVM0CmwQS7uFj/ZOTK4+TkjeoydsKE5NGGla45
-P6Voswy39xSH4/FZIStPbA6wuWe07aWPoVv7SBTfAoGBAKE47oqTi4zmGxeU13JL
-pbmak58oqbESG73wG5RnetJHEVomRzjvyCg6F60M/Ov+FErKR2SeSDS5uK5lgGwe
-GnLoEa0BSLFM64GYtoFBonIggP9uLwWdfEsWqYmybfmyzy0zFAVgTevagFmKn7Ez
-E37YWorHfRbpnOS4xNcVAsTTAoGALaw/X4FHFLcnO3/dbsQt0U2g9ii/mGH+l+DW
-KhWsvlTIbIoFyKAYj9C1hnHW0M/O3nyNe8AMg0235XPjtmYqUZ0CHTHla7QrHBDA
-Bc5E1KW9XrC3138I1uJM0LBiXzNIfQPia+8COwMe0d2YNm3QwlDmYSXQmyg+VRHg
-5br11ecCgYAm2CL6kXV9YF2WPxtqgXexkM/DtechRZTEMNKilUtylIF3+MzsWp4C
-zvRBE2vwLZOHd9E7r7WYHnTA9MWEvy1d6pVvlain4oNSnmii5kTs75XM0aSzkduC
-QwBy2+ufKAZ3+DxrVFWRHt4vNgXjdrQadDTuHOItAvsFXTwM8X4yIw==
------END RSA PRIVATE KEY-----
diff --git a/jwt-scratch/keys/fort_private.key b/jwt-scratch/keys/fort_private.key
deleted file mode 100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l291/XLMXYiwnqrB1UJBLikulwOFM
-DQMzwJnEkhgNRoWYYR2JTwrD0TJhvT0lnCmnT9RZanNDdho1MMqItYTCz6YfMg==
------END PRIVATE KEY-----
diff --git a/jwt-scratch/keys/private.key b/jwt-scratch/keys/private.key
deleted file mode 100644
index 8864c31..0000000
--- a/jwt-scratch/keys/private.key
+++ /dev/null
@@ -1,51 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-MIIJKQIBAAKCAgEAmujOhXAqsN9fk9uzcLjmexRky+A1OiVwHw00R8c2NYT6tO5u
-5YHQlFb8TlqAHM7boIZ72WLud/a7oI5zNYPtKMU42+pt9kqkjWANY4Ozb+k8BkDL
-oM8N/nzxGo1uJqwhBO1UqPYxx1/p9yQi+peD3YgShtGdA/dPAJUl+J1/lAY0u9uq
-NUz/BjRzdu7ruwETRgeNp/YXN5LIjFq6UxhbZULmkVFw8Fnzkq17WrC8QmVizP9j
-/vVGXldWBIwhTRG+0/BPsHlANS9EYDwEZgxejkx0nCuEXGpIrv03AY5KInRoCLX0
-7p1CByH2jjUVYux4kLhjo50kgrEorRO0hfF+VfC9odFlFRLy6OzXflgDVWkgQgQg
-Azt8vkGcvtoOznabvdKfW2L84iUkkuLUscbDiW8j4hjnLe98n/8jzLrJoPR6jy/J
-tQggMRRh9AHTX4iffItrYBoTnMLLbzO7ZJ6JO5SUia4w3NL4gpYQ3QwIOLegMnWo
-cMQxnmaFayJT8+SG7QiW2bDodROkhMfRJcR/kiA+3EuwP0mMEziDvjqERc+2VUni
-6GznTAfEGu9UGMpWUd5dGeiwYBLn89ilCsxrVoPX4xTrj9Qwc/AtDt2S+gu4tHs+
-cAC99MG52bbojQbWLP2KWx+YizYecfYbGTYi9zEfeXoukVPEd0tpgHUazdUCAwEA
-AQKCAgEAjgGJAM44dHfwuCyZLGZz8rRZSoQ4hxs202BZYst+KEXFRgOlaYM9YB71
-oCZadw4yS8+8zSViElr+2Up81rwftlZFr2QSdcsrWeaJn4ZmAds/iUPw53Oo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tcFuCHHtvWUFtATce
-4HzfiDlOVhTn55d9A44fpQks9hNqn8+fkB3dyoAJIIeUaJhTLWxU6lQJY0DUpQ9s
-7fVcC3o3UQir+mkPV61lNRt3njCDUauJVyBKRmNgVy21RD22nQJWamtLr6KIz4nk
-HjuI1B/YQ0r3NNkdT1/PVl1v5d4V2zPJV3QEGxuxroockzpnUfadaQSgCpyu
------END RSA PRIVATE KEY-----
diff --git a/jwt-scratch/keys/public.key b/jwt-scratch/keys/public.key
deleted file mode 100644
index e4c792d..0000000
--- a/jwt-scratch/keys/public.key
+++ /dev/null
@@ -1,35 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIF/zCCA+egAwIBAgIULM6lDiJ9ivg46YyfxfQZSHc6A50wDQYJKoZIhvcNAQEL
-BQAwgY4xCzAJBgNVBAYTAlVTMREwDwYDVQQIDAhOZXcgWW9yazEUMBIGA1UEBwwL
-U2NoZW5lY3RhZHkxDTALBgNVBAoMBFFsaWsxDDAKBgNVBAsMA0NTRTEYMBYGA1UE
-AwwPanByZG9ubmVsbHkuY29tMR8wHQYJKoZIhvcNAQkBFhBxbGlra2llQHFsaWsu
-Y29tMB4XDTIxMDMzMTEzMjU1NFoXDTIxMDQzMDEzMjU1NFowgY4xCzAJBgNVBAYT
-AlVTMREwDwYDVQQIDAhOZXcgWW9yazEUMBIGA1UEBwwLU2NoZW5lY3RhZHkxDTAL
-BgNVBAoMBFFsaWsxDDAKBgNVBAsMA0NTRTEYMBYGA1UEAwwPanByZG9ubmVsbHku
-Y29tMR8wHQYJKoZIhvcNAQkBFhBxbGlra2llQHFsaWsuY29tMIICIjANBgkqhkiG
-9w0BAQEFAAOCAg8AMIICCgKCAgEAmujOhXAqsN9fk9uzcLjmexRky+A1OiVwHw00
-R8c2NYT6tO5u5YHQlFb8TlqAHM7boIZ72WLud/a7oI5zNYPtKMU42+pt9kqkjWAN
-Y4Ozb+k8BkDLoM8N/nzxGo1uJqwhBO1UqPYxx1/p9yQi+peD3YgShtGdA/d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Q7SmcgQn9Dt8QBate4+GsmjynWSG97BVRTbWtFIw
-gzHlz3sUgf+gJonQ8/jjuIJKShf4bMLMb2xZOB5P5G6cRBTxIzmgGDbwZIEjMo5k
-CWgqG8/bCXmZvpa21Lruh+PUk0Fvekl1acRkW6Tr2/0PjSf6LBFsovdZC10osrCn
-KgP7Lb3T4ET/MJ5pkyDSwD6BDgnoKqqq/24n39kFWnn3X5uFO04Kp/6fKp8+t14S
-xz3VdqkYGeLFBSKzPHfwav2ngE3hKrk/m3tSZXXNv1mIXI1gSLLLgmOH0wu1SZhA
-grU2
------END CERTIFICATE-----
diff --git a/jwt-scratch/keys/root.pem b/jwt-scratch/keys/root.pem
deleted file mode 100644
index 6dffdf2..0000000
--- a/jwt-scratch/keys/root.pem
+++ /dev/null
@@ -1,19 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIDGzCCAgOgAwIBAgIQAKqc00Zx4AfvKdtqjSsWbTANBgkqhkiG9w0BAQsFADAV
-MRMwEQYDVQQDDApjZW50cmFsLUNBMB4XDTIwMTIzMDE1NDIwNFoXDTMxMDEwNjE1
-NDIwNFowFTETMBEGA1UEAwwKY2VudHJhbC1DQTCCASIwDQYJKoZIhvcNAQEBBQAD
-ggEPADCCAQoCggEBAJ/6pWC/0N1fOMc/4/AWYEAuV+mokmlstBBjsczscoGGV/dl
-F0am/M7QzFKYJE7ypzIIGob/i96m9+oc1bG5i5l9UFMknSonVag6sBjmKd+B5aG9
-VuZ3JNCu1dVaXQ5pHf7kmXGfOAhWMhjf6BxLjRDh6T6ZvyEx4ZL+ofarggtllpAI
-O91vpNWixN7qgcYT0ahs8d8QwMkDrZRMcOPWSlp6XpLE+reM1MI1GAFctRBeGW7K
-SefasF/OMw3i4NGhGy0vju78In23AZTtu69j2xhZM98fWXoPV5tdC8kFMjm+INxn
-ZNCXWjjsIB5+etGKTiMtDTEs6C/zn/CVpTMnO00CAwEAAaNnMGUwDwYDVR0TAQH/
-BAUwAwEB/zAdBgNVHQ4EFgQUtdVZqmTupJp1o8kb5ICaBsPDCqwwHwYDVR0jBBgw
-FoAUtdVZqmTupJp1o8kb5ICaBsPDCqwwEgYIKwYBBQUHDQMEBgQEUm9vdDANBgkq
-hkiG9w0BAQsFAAOCAQEAJSFhaGQW2UoICwjmIDW63UqVXrLOH9VoeBHko4SAuCv5
-9ambUZ+ccdFqkVfUnRdudFYq4fwBkJp2O9fDNnmVjMleSTGUJt09arAs69Hlze9y
-LsOmWTqWkuxMwXfzMl2CP2LNVjxFIiNDOvGFtUEMIQriCIf0ESNmdqQlBSd8Ebcd
-8NTQb8yc1h6f5vw9dmo18myFQio9nKbMJP7ADumbmCSOVPAcQZItcscMY05IkeYs
-B3EfA/hb9y1lqBj3BLVQ8upZQQWxCuzFFJukpmNKJ28Xb6Bxvdzzkfce9Y3dFrtZ
-qwYhIxzkb1A1sqjP32VecqA7HsxLfv6nt3GBEAZoXQ==
------END CERTIFICATE-----
diff --git a/jwt-scratch/keys/server.pem b/jwt-scratch/keys/server.pem
deleted file mode 100644
index 6ce9274..0000000
--- a/jwt-scratch/keys/server.pem
+++ /dev/null
@@ -1,31 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIFajCCBFKgAwIBAgIQAL2xxPBwLS0l55gsSyxQXzANBgkqhkiG9w0BAQsFADAV
-MRMwEQYDVQQDDApjZW50cmFsLUNBMB4XDTIxMDIwNzE3MDUxNloXDTMxMDIxNDE3
-MDUxNlowIDEeMBwGA1UEAwwVcXNlb3cuanByZG9ubmVsbHkuY29tMIIBIjANBgkq
-hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAksBbEhm9tpnBR1laE234ZN9KKjDtUgZb
-h58UJ2v4b0tsvI58ctSRs7wzrKhkNoDu22vh1IyiC5mowbF9jPnTg9aOOhbXN9vQ
-/Cj/IpIfeTk9dJwNV9ALxKmyq5ENSPeePk82pPSvm9nfz4/2p46rL98LKruQCA2G
-cRpuk+8I5SETA8yxsKa0vwmXHTCw/Lft4vOdq50GOUxTVk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7
-0ZoHI++3bgTopTANBgkqhkiG9w0BAQsFAAOCAQEAb83XLFmREAfCWfH+w23peo7s
-lsUkayVRsBWC6KnvxqtEWdqKNR6PbvwZQp6ue0ENUt6Of14Qlfumm74CnS9oxusT
-q2S1a31GnPfYq3ItMKDvETjibe0DT14JkmkqtJQe4FgdvdOoXZEKvLtZqlv1Xf0l
-dDu2EAtTSnae6mSqvulaWo23qH7iyj15dp2SdWKjfLlv86iLdHUmXV/NkiZ/HTRZ
-4R2IowAd9oUrqGdbunVBy6teyEmvIQiiJHK126Daijih88/TIKK79MK2Tl2UYP+S
-dPZKrhEwlGpmY29rfGt6uAXb0WChkfkghc9NlpCQUk4PY6KAzkcxCqUUiLWOgA==
------END CERTIFICATE-----
diff --git a/jwt-scratch/keys/server_key.pem b/jwt-scratch/keys/server_key.pem
deleted file mode 100644
index b1a4b70..0000000
--- a/jwt-scratch/keys/server_key.pem
+++ /dev/null
@@ -1,27 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-MIIEpAIBAAKCAQEAksBbEhm9tpnBR1laE234ZN9KKjDtUgZbh58UJ2v4b0tsvI58
-ctSRs7wzrKhkNoDu22vh1IyiC5mowbF9jPnTg9aOOhbXN9vQ/Cj/IpIfeTk9dJwN
-V9ALxKmyq5ENSPeePk82pPSvm9nfz4/2p46rL98LKruQCA2GcRpuk+8I5SETA8yx
-sKa0vwmXHTCw/Lft4vOdq50GOUxTVkPfyzfZKV7iMAkOGnOwp/eWPRKG+CGITDup
-8Bbv7GRvUQkTD/4rcSytk7kpoqNIAbYyTDX+rTidBIZNZ8bjlfxY3CqXPO0vNREM
-Mh/8m3EsOzjSZbgDAqWgjBW5fed3MY6mcJO75wIDAQABAoIBAQCJp9wFj5XQikuu
-BNeksBw3auijyP9kWMhU4FjEXdhNdZ/LA5EjGdiOk3SZed9+7NShiIHuofiDDyEo
-h7hwnAvXeFQzkydQo2ZWkpI4uH7DdHj8QEGX5HSVhmUt4ENo9bU/V4i3lTqA5A+4
-I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zjJyakKvhuTJhiP1YnMEoxjwSyGhBT85RC6Tbw==
------END RSA PRIVATE KEY-----
diff --git a/jwt-scratch/src/az/az-token.js b/jwt-scratch/src/az/az-token.js
deleted file mode 100644
index d667ed7..0000000
--- a/jwt-scratch/src/az/az-token.js
+++ /dev/null
@@ -1,16 +0,0 @@
-const bearerToken = JSON.parse((authHeader.replace('Bearer ', '')))
-
-var client = jwksClient({
- jwksUri: `https://login.microsoftonline.com/${context.tenant}/discovery/keys`
-});
-
-function getKey(header, callback) {
- client.getSigningKey(header.kid, function (err, key) {
- var signingKey = key.publicKey || key.rsaPublicKey;
- callback(err, signingKey);
- });
-}
-
-jwt.verify(bearerToken, getKey, function (err, decoded) {
- console.log()
-}
\ No newline at end of file
diff --git a/jwt-scratch/src/cf/cfw-verifyjwt.js b/jwt-scratch/src/cf/cfw-verifyjwt.js
deleted file mode 100644
index 64fb486..0000000
--- a/jwt-scratch/src/cf/cfw-verifyjwt.js
+++ /dev/null
@@ -1,132 +0,0 @@
-addEventListener('fetch', event => {
- event.respondWith(handleRequest(event.request))
-})
-
-// Following code is a modified version of that found at https://blog.cloudflare.com/dronedeploy-and-cloudflare-workers/
-
-/**
- * Fetch and log a request
- * @param {Request} request
- */
-async function handleRequest(request) {
- let isValid = await isValidJwt(request)
- if (!isValid) {
- // It is immediately failing here, which is great. The worker doesn't bother hitting your API
- console.log('is NOT valid')
- return new Response('Invalid JWT', { status: 403 })
- } else {
- console.log('is valid')
- }
-
- console.log('Got request', request)
- const response = await fetch(request)
- console.log('Got response', response)
- return response
-}
-
-/**
- * Parse the JWT and validate it.
- *
- * We are just checking that the signature is valid, but you can do more that.
- * For example, check that the payload has the expected entries or if the signature is expired..
- */
-
-
-
-// App Specific URI
-//api://ace01880-475a-486b-aa2b-3582192df09b
-
-async function isValidJwt(request) {
- const encodedToken = getJwt(request);
- if (encodedToken === null) {
- return false
- }
- const token = decodeJwt(encodedToken);
-
- // Is the token expired?
- let expiryDate = new Date(token.payload.exp * 1000)
- let currentDate = new Date(Date.now())
- if (expiryDate <= currentDate) {
- console.log('expired token')
- return false
- }
-
- return isValidJwtSignature(token)
-}
-
-/**
- * For this example, the JWT is passed in as part of the Authorization header,
- * after the Bearer scheme.
- * Parse the JWT out of the header and return it.
- */
-function getJwt(request) {
- const authHeader = request.headers.get('Authorization');
- if (!authHeader || authHeader.substring(0, 6) !== 'Bearer') {
- return null
- }
- return authHeader.substring(6).trim()
-}
-
-/**
- * Parse and decode a JWT.
- * A JWT is three, base64 encoded, strings concatenated with ‘.’:
- * a header, a payload, and the signature.
- * The signature is “URL safe”, in that ‘/+’ characters have been replaced by ‘_-’
- *
- * Steps:
- * 1. Split the token at the ‘.’ character
- * 2. Base64 decode the individual parts
- * 3. Retain the raw Bas64 encoded strings to verify the signature
- */
-function decodeJwt(token) {
- const parts = token.split('.');
- const header = JSON.parse(atob(parts[0]));
- const payload = JSON.parse(atob(parts[1]));
- const signature = atob(parts[2].replace(/_/g, '/').replace(/-/g, '+'));
- console.log(header)
- return {
- header: header,
- payload: payload,
- signature: signature,
- raw: { header: parts[0], payload: parts[1], signature: parts[2] }
- }
-}
-
-/**
- * Validate the JWT.
- *
- * Steps:
- * Reconstruct the signed message from the Base64 encoded strings.
- * Load the RSA public key into the crypto library.
- * Verify the signature with the message and the key.
- */
-async function isValidJwtSignature(token) {
- const encoder = new TextEncoder();
- const data = encoder.encode([token.raw.header, token.raw.payload].join('.'));
- const signature = new Uint8Array(Array.from(token.signature).map(c => c.charCodeAt(0)));
-/*
- const jwk = {
- alg: 'RS256',
- e: 'AQAB',
- ext: true,
- key_ops: ['verify'],
- kty: 'RSA',
- n: RSA_PUBLIC_KEY
- };
-*/
- // You need to JWK data with whatever is your public RSA key. If you're using Auth0 you
- // can download it from https://[your_domain].auth0.com/.well-known/jwks.json
- const jwk = {
- alg: "RS256",
- kty: "RSA",
- key_ops: ['verify'],
- use: "sig",
- x5c: ["REPLACE-ME-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"],
- n: "REPLACE-ME-bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
- e: "AQAB",
- kid: "REPLACE-ME-ccccccccccccccccccccccccccccccccccccccccccccccccc",
- x5t: "REPLACE-ME-ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd"
- }
- const key = await crypto.subtle.importKey('jwk', jwk, { name: 'RSASSA-PKCS1-v1_5', hash: 'SHA-256' }, false, ['verify']);
- return crypto.subtle.verify('RSASSA-PKCS1-v1_5', key, signature, data)
-}
\ No newline at end of file
diff --git a/jwt-scratch/src/js/.jwtE.js.swp b/jwt-scratch/src/js/.jwtE.js.swp
deleted file mode 100644
index 676a257..0000000
Binary files a/jwt-scratch/src/js/.jwtE.js.swp and /dev/null differ
diff --git a/jwt-scratch/src/js/jwtE.js b/jwt-scratch/src/js/jwtE.js
deleted file mode 100644
index e825798..0000000
--- a/jwt-scratch/src/js/jwtE.js
+++ /dev/null
@@ -1,72 +0,0 @@
-const enigma = require("enigma.js");
-const WebSocket = require("ws");
-const path = require("path");
-const fs = require("fs");
-const jwt = require("jsonwebtoken");
-
-const schema = require("enigma.js/schemas/12.612.0.json");
-
-// Your Sense Enterprise installation hostname:
-const senseHost = "qseow.jprdonnelly.com";
-
-// Your configured virtual proxy prefix for JWT authentication:
-const proxyPrefix = "jwt";
-
-// The Sense Enterprise-configured user directory for the user you want to identify
-// as:
-const userDirectory = "QAD";
-
-// The user to use when creating the session:
-const userId = "djx";
-
-// The Sense Enterprise-configured JWT structure. Change the attributes to match
-// your configuration:
-const token = {
- userDirectory: userDirectory,
- userId: userId,
-};
-
-// Path to the private key used for JWT signing:
-const privateKeyPath = "../../keys/private.key";
-let key = fs.readFileSync(privateKeyPath, "utf8");
-
-// Sign the token using the RS256 algorithm:
-let signedToken = jwt.sign(token, key, { algorithm: "RS256" });
-
-// let signedToken = jwt.sign(token, key, { algorithm: 'RS256' }, function(err, token) {
-// console.log(signedToken);
-// });
-
-const config = {
- schema,
- // url: `wss://${senseHost}/${proxyPrefix}/app/engineData`,
- url: `wss://${senseHost}/${proxyPrefix}/app/engineData`,
- // Notice how the signed JWT is passed in the 'Authorization' header using the
- // 'Bearer' schema:
- createSocket: (url) =>
- new WebSocket(url, {
- headers: { Authorization: `Bearer ${signedToken}` },
- }),
-};
-
-// console.log(`${signedToken}`);
-let session = enigma.create(config);
-
-session
- .open()
- .then((global) => {
- console.log("Session was opened successfully");
- // return global.getDocList().then((list) => {
- // const apps = list
- // .map((app) => `${app.qDocId} (${app.qTitle || "No title"})`)
- // .join(", ");
- // console.log(
- // `Apps on this Engine that the configured user can open: ${apps}`
- // );
- // session.close();
- // });
- })
- .catch((error) => {
- console.log("Failed to open session:", error);
- process.exit(1);
- });
diff --git a/jwt-scratch/src/js/node_modules/.bin/semver b/jwt-scratch/src/js/node_modules/.bin/semver
deleted file mode 120000
index 317eb29..0000000
--- a/jwt-scratch/src/js/node_modules/.bin/semver
+++ /dev/null
@@ -1 +0,0 @@
-../semver/bin/semver
\ No newline at end of file
diff --git a/jwt-scratch/src/js/node_modules/.yarn-integrity b/jwt-scratch/src/js/node_modules/.yarn-integrity
deleted file mode 100644
index 985daf8..0000000
--- a/jwt-scratch/src/js/node_modules/.yarn-integrity
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "systemParams": "linux-arm64-83",
- "modulesFolders": [
- "node_modules"
- ],
- "flags": [],
- "linkedModules": [],
- "topLevelPatterns": [
- "uWebSockets.js@uNetworking/uWebSockets.js"
- ],
- "lockfileEntries": {
- "uWebSockets.js@uNetworking/uWebSockets.js": "https://codeload.github.com/uNetworking/uWebSockets.js/tar.gz/9af80e10cec000fe6cdbd4037b2154e2ffa08b2d"
- },
- "files": [],
- "artifacts": {}
-}
\ No newline at end of file
diff --git a/jwt-scratch/src/js/node_modules/buffer-equal-constant-time/.npmignore b/jwt-scratch/src/js/node_modules/buffer-equal-constant-time/.npmignore
deleted file mode 100644
index 34e4f5c..0000000
--- a/jwt-scratch/src/js/node_modules/buffer-equal-constant-time/.npmignore
+++ /dev/null
@@ -1,2 +0,0 @@
-.*.sw[mnop]
-node_modules/
diff --git a/jwt-scratch/src/js/node_modules/buffer-equal-constant-time/.travis.yml b/jwt-scratch/src/js/node_modules/buffer-equal-constant-time/.travis.yml
deleted file mode 100644
index 78e1c01..0000000
--- a/jwt-scratch/src/js/node_modules/buffer-equal-constant-time/.travis.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-language: node_js
-node_js:
-- "0.11"
-- "0.10"
diff --git a/jwt-scratch/src/js/node_modules/buffer-equal-constant-time/LICENSE.txt b/jwt-scratch/src/js/node_modules/buffer-equal-constant-time/LICENSE.txt
deleted file mode 100644
index 9a064f3..0000000
--- a/jwt-scratch/src/js/node_modules/buffer-equal-constant-time/LICENSE.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-Copyright (c) 2013, GoInstant Inc., a salesforce.com company
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
-
-* Neither the name of salesforce.com, nor GoInstant, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/jwt-scratch/src/js/node_modules/buffer-equal-constant-time/README.md b/jwt-scratch/src/js/node_modules/buffer-equal-constant-time/README.md
deleted file mode 100644
index 4f227f5..0000000
--- a/jwt-scratch/src/js/node_modules/buffer-equal-constant-time/README.md
+++ /dev/null
@@ -1,50 +0,0 @@
-# buffer-equal-constant-time
-
-Constant-time `Buffer` comparison for node.js. Should work with browserify too.
-
-[](https://travis-ci.org/goinstant/buffer-equal-constant-time)
-
-```sh
- npm install buffer-equal-constant-time
-```
-
-# Usage
-
-```js
- var bufferEq = require('buffer-equal-constant-time');
-
- var a = new Buffer('asdf');
- var b = new Buffer('asdf');
- if (bufferEq(a,b)) {
- // the same!
- } else {
- // different in at least one byte!
- }
-```
-
-If you'd like to install an `.equal()` method onto the node.js `Buffer` and
-`SlowBuffer` prototypes:
-
-```js
- require('buffer-equal-constant-time').install();
-
- var a = new Buffer('asdf');
- var b = new Buffer('asdf');
- if (a.equal(b)) {
- // the same!
- } else {
- // different in at least one byte!
- }
-```
-
-To get rid of the installed `.equal()` method, call `.restore()`:
-
-```js
- require('buffer-equal-constant-time').restore();
-```
-
-# Legal
-
-© 2013 GoInstant Inc., a salesforce.com company
-
-Licensed under the BSD 3-clause license.
diff --git a/jwt-scratch/src/js/node_modules/buffer-equal-constant-time/index.js b/jwt-scratch/src/js/node_modules/buffer-equal-constant-time/index.js
deleted file mode 100644
index 5462c1f..0000000
--- a/jwt-scratch/src/js/node_modules/buffer-equal-constant-time/index.js
+++ /dev/null
@@ -1,41 +0,0 @@
-/*jshint node:true */
-'use strict';
-var Buffer = require('buffer').Buffer; // browserify
-var SlowBuffer = require('buffer').SlowBuffer;
-
-module.exports = bufferEq;
-
-function bufferEq(a, b) {
-
- // shortcutting on type is necessary for correctness
- if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
- return false;
- }
-
- // buffer sizes should be well-known information, so despite this
- // shortcutting, it doesn't leak any information about the *contents* of the
- // buffers.
- if (a.length !== b.length) {
- return false;
- }
-
- var c = 0;
- for (var i = 0; i < a.length; i++) {
- /*jshint bitwise:false */
- c |= a[i] ^ b[i]; // XOR
- }
- return c === 0;
-}
-
-bufferEq.install = function() {
- Buffer.prototype.equal = SlowBuffer.prototype.equal = function equal(that) {
- return bufferEq(this, that);
- };
-};
-
-var origBufEqual = Buffer.prototype.equal;
-var origSlowBufEqual = SlowBuffer.prototype.equal;
-bufferEq.restore = function() {
- Buffer.prototype.equal = origBufEqual;
- SlowBuffer.prototype.equal = origSlowBufEqual;
-};
diff --git a/jwt-scratch/src/js/node_modules/buffer-equal-constant-time/package.json b/jwt-scratch/src/js/node_modules/buffer-equal-constant-time/package.json
deleted file mode 100644
index 79d2aa3..0000000
--- a/jwt-scratch/src/js/node_modules/buffer-equal-constant-time/package.json
+++ /dev/null
@@ -1,55 +0,0 @@
-{
- "_from": "buffer-equal-constant-time@1.0.1",
- "_id": "buffer-equal-constant-time@1.0.1",
- "_inBundle": false,
- "_integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=",
- "_location": "/buffer-equal-constant-time",
- "_phantomChildren": {},
- "_requested": {
- "type": "version",
- "registry": true,
- "raw": "buffer-equal-constant-time@1.0.1",
- "name": "buffer-equal-constant-time",
- "escapedName": "buffer-equal-constant-time",
- "rawSpec": "1.0.1",
- "saveSpec": null,
- "fetchSpec": "1.0.1"
- },
- "_requiredBy": [
- "/jwa"
- ],
- "_resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz",
- "_shasum": "f8e71132f7ffe6e01a5c9697a4c6f3e48d5cc819",
- "_spec": "buffer-equal-constant-time@1.0.1",
- "_where": "/home/rock64/git/qseow-scripts/jwt-scratch/src/js/node_modules/jwa",
- "author": {
- "name": "GoInstant Inc., a salesforce.com company"
- },
- "bugs": {
- "url": "https://github.com/goinstant/buffer-equal-constant-time/issues"
- },
- "bundleDependencies": false,
- "deprecated": false,
- "description": "Constant-time comparison of Buffers",
- "devDependencies": {
- "mocha": "~1.15.1"
- },
- "homepage": "https://github.com/goinstant/buffer-equal-constant-time#readme",
- "keywords": [
- "buffer",
- "equal",
- "constant-time",
- "crypto"
- ],
- "license": "BSD-3-Clause",
- "main": "index.js",
- "name": "buffer-equal-constant-time",
- "repository": {
- "type": "git",
- "url": "git+ssh://git@github.com/goinstant/buffer-equal-constant-time.git"
- },
- "scripts": {
- "test": "mocha test.js"
- },
- "version": "1.0.1"
-}
diff --git a/jwt-scratch/src/js/node_modules/buffer-equal-constant-time/test.js b/jwt-scratch/src/js/node_modules/buffer-equal-constant-time/test.js
deleted file mode 100644
index 0bc972d..0000000
--- a/jwt-scratch/src/js/node_modules/buffer-equal-constant-time/test.js
+++ /dev/null
@@ -1,42 +0,0 @@
-/*jshint node:true */
-'use strict';
-
-var bufferEq = require('./index');
-var assert = require('assert');
-
-describe('buffer-equal-constant-time', function() {
- var a = new Buffer('asdfasdf123456');
- var b = new Buffer('asdfasdf123456');
- var c = new Buffer('asdfasdf');
-
- describe('bufferEq', function() {
- it('says a == b', function() {
- assert.strictEqual(bufferEq(a, b), true);
- });
-
- it('says a != c', function() {
- assert.strictEqual(bufferEq(a, c), false);
- });
- });
-
- describe('install/restore', function() {
- before(function() {
- bufferEq.install();
- });
- after(function() {
- bufferEq.restore();
- });
-
- it('installed an .equal method', function() {
- var SlowBuffer = require('buffer').SlowBuffer;
- assert.ok(Buffer.prototype.equal);
- assert.ok(SlowBuffer.prototype.equal);
- });
-
- it('infected existing Buffers', function() {
- assert.strictEqual(a.equal(b), true);
- assert.strictEqual(a.equal(c), false);
- });
- });
-
-});
diff --git a/jwt-scratch/src/js/node_modules/ecdsa-sig-formatter/CODEOWNERS b/jwt-scratch/src/js/node_modules/ecdsa-sig-formatter/CODEOWNERS
deleted file mode 100644
index 4451d3d..0000000
--- a/jwt-scratch/src/js/node_modules/ecdsa-sig-formatter/CODEOWNERS
+++ /dev/null
@@ -1 +0,0 @@
-* @omsmith
diff --git a/jwt-scratch/src/js/node_modules/ecdsa-sig-formatter/LICENSE b/jwt-scratch/src/js/node_modules/ecdsa-sig-formatter/LICENSE
deleted file mode 100644
index 8754ed6..0000000
--- a/jwt-scratch/src/js/node_modules/ecdsa-sig-formatter/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
-Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "{}"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright 2015 D2L Corporation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/jwt-scratch/src/js/node_modules/ecdsa-sig-formatter/README.md b/jwt-scratch/src/js/node_modules/ecdsa-sig-formatter/README.md
deleted file mode 100644
index daa95d6..0000000
--- a/jwt-scratch/src/js/node_modules/ecdsa-sig-formatter/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-# ecdsa-sig-formatter
-
-[](https://travis-ci.org/Brightspace/node-ecdsa-sig-formatter) [](https://coveralls.io/r/Brightspace/node-ecdsa-sig-formatter)
-
-Translate between JOSE and ASN.1/DER encodings for ECDSA signatures
-
-## Install
-```sh
-npm install ecdsa-sig-formatter --save
-```
-
-## Usage
-```js
-var format = require('ecdsa-sig-formatter');
-
-var derSignature = '..'; // asn.1/DER encoded ecdsa signature
-
-var joseSignature = format.derToJose(derSignature);
-
-```
-
-### API
-
----
-
-#### `.derToJose(Buffer|String signature, String alg)` -> `String`
-
-Convert the ASN.1/DER encoded signature to a JOSE-style concatenated signature.
-Returns a _base64 url_ encoded `String`.
-
-* If _signature_ is a `String`, it should be _base64_ encoded
-* _alg_ must be one of _ES256_, _ES384_ or _ES512_
-
----
-
-#### `.joseToDer(Buffer|String signature, String alg)` -> `Buffer`
-
-Convert the JOSE-style concatenated signature to an ASN.1/DER encoded
-signature. Returns a `Buffer`
-
-* If _signature_ is a `String`, it should be _base64 url_ encoded
-* _alg_ must be one of _ES256_, _ES384_ or _ES512_
-
-## Contributing
-
-1. **Fork** the repository. Committing directly against this repository is
- highly discouraged.
-
-2. Make your modifications in a branch, updating and writing new unit tests
- as necessary in the `spec` directory.
-
-3. Ensure that all tests pass with `npm test`
-
-4. `rebase` your changes against master. *Do not merge*.
-
-5. Submit a pull request to this repository. Wait for tests to run and someone
- to chime in.
-
-### Code Style
-
-This repository is configured with [EditorConfig][EditorConfig] and
-[ESLint][ESLint] rules.
-
-[EditorConfig]: http://editorconfig.org/
-[ESLint]: http://eslint.org
diff --git a/jwt-scratch/src/js/node_modules/ecdsa-sig-formatter/package.json b/jwt-scratch/src/js/node_modules/ecdsa-sig-formatter/package.json
deleted file mode 100644
index 922a3ff..0000000
--- a/jwt-scratch/src/js/node_modules/ecdsa-sig-formatter/package.json
+++ /dev/null
@@ -1,73 +0,0 @@
-{
- "_from": "ecdsa-sig-formatter@1.0.11",
- "_id": "ecdsa-sig-formatter@1.0.11",
- "_inBundle": false,
- "_integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==",
- "_location": "/ecdsa-sig-formatter",
- "_phantomChildren": {},
- "_requested": {
- "type": "version",
- "registry": true,
- "raw": "ecdsa-sig-formatter@1.0.11",
- "name": "ecdsa-sig-formatter",
- "escapedName": "ecdsa-sig-formatter",
- "rawSpec": "1.0.11",
- "saveSpec": null,
- "fetchSpec": "1.0.11"
- },
- "_requiredBy": [
- "/jwa"
- ],
- "_resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz",
- "_shasum": "ae0f0fa2d85045ef14a817daa3ce9acd0489e5bf",
- "_spec": "ecdsa-sig-formatter@1.0.11",
- "_where": "/home/rock64/git/qseow-scripts/jwt-scratch/src/js/node_modules/jwa",
- "author": {
- "name": "D2L Corporation"
- },
- "bugs": {
- "url": "https://github.com/Brightspace/node-ecdsa-sig-formatter/issues"
- },
- "bundleDependencies": false,
- "dependencies": {
- "safe-buffer": "^5.0.1"
- },
- "deprecated": false,
- "description": "Translate ECDSA signatures between ASN.1/DER and JOSE-style concatenation",
- "devDependencies": {
- "bench": "^0.3.6",
- "chai": "^3.5.0",
- "coveralls": "^2.11.9",
- "eslint": "^2.12.0",
- "eslint-config-brightspace": "^0.2.1",
- "istanbul": "^0.4.3",
- "jwk-to-pem": "^1.2.5",
- "mocha": "^2.5.3",
- "native-crypto": "^1.7.0"
- },
- "homepage": "https://github.com/Brightspace/node-ecdsa-sig-formatter#readme",
- "keywords": [
- "ecdsa",
- "der",
- "asn.1",
- "jwt",
- "jwa",
- "jsonwebtoken",
- "jose"
- ],
- "license": "Apache-2.0",
- "main": "src/ecdsa-sig-formatter.js",
- "name": "ecdsa-sig-formatter",
- "repository": {
- "type": "git",
- "url": "git+ssh://git@github.com/Brightspace/node-ecdsa-sig-formatter.git"
- },
- "scripts": {
- "check-style": "eslint .",
- "pretest": "npm run check-style",
- "report-cov": "cat ./coverage/lcov.info | coveralls",
- "test": "istanbul cover --root src _mocha -- spec"
- },
- "typings": "./src/ecdsa-sig-formatter.d.ts",
- "version": "1.0.11"
-}
diff --git a/jwt-scratch/src/js/node_modules/ecdsa-sig-formatter/src/ecdsa-sig-formatter.d.ts b/jwt-scratch/src/js/node_modules/ecdsa-sig-formatter/src/ecdsa-sig-formatter.d.ts
deleted file mode 100644
index 9693aa0..0000000
--- a/jwt-scratch/src/js/node_modules/ecdsa-sig-formatter/src/ecdsa-sig-formatter.d.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-///
-
-declare module "ecdsa-sig-formatter" {
- /**
- * Convert the ASN.1/DER encoded signature to a JOSE-style concatenated signature. Returns a base64 url encoded String.
- * If signature is a String, it should be base64 encoded
- * alg must be one of ES256, ES384 or ES512
- */
- export function derToJose(signature: Buffer | string, alg: string): string;
-
- /**
- * Convert the JOSE-style concatenated signature to an ASN.1/DER encoded signature. Returns a Buffer
- * If signature is a String, it should be base64 url encoded
- * alg must be one of ES256, ES384 or ES512
- */
- export function joseToDer(signature: Buffer | string, alg: string): Buffer
-}
diff --git a/jwt-scratch/src/js/node_modules/ecdsa-sig-formatter/src/ecdsa-sig-formatter.js b/jwt-scratch/src/js/node_modules/ecdsa-sig-formatter/src/ecdsa-sig-formatter.js
deleted file mode 100644
index 38eeb9b..0000000
--- a/jwt-scratch/src/js/node_modules/ecdsa-sig-formatter/src/ecdsa-sig-formatter.js
+++ /dev/null
@@ -1,187 +0,0 @@
-'use strict';
-
-var Buffer = require('safe-buffer').Buffer;
-
-var getParamBytesForAlg = require('./param-bytes-for-alg');
-
-var MAX_OCTET = 0x80,
- CLASS_UNIVERSAL = 0,
- PRIMITIVE_BIT = 0x20,
- TAG_SEQ = 0x10,
- TAG_INT = 0x02,
- ENCODED_TAG_SEQ = (TAG_SEQ | PRIMITIVE_BIT) | (CLASS_UNIVERSAL << 6),
- ENCODED_TAG_INT = TAG_INT | (CLASS_UNIVERSAL << 6);
-
-function base64Url(base64) {
- return base64
- .replace(/=/g, '')
- .replace(/\+/g, '-')
- .replace(/\//g, '_');
-}
-
-function signatureAsBuffer(signature) {
- if (Buffer.isBuffer(signature)) {
- return signature;
- } else if ('string' === typeof signature) {
- return Buffer.from(signature, 'base64');
- }
-
- throw new TypeError('ECDSA signature must be a Base64 string or a Buffer');
-}
-
-function derToJose(signature, alg) {
- signature = signatureAsBuffer(signature);
- var paramBytes = getParamBytesForAlg(alg);
-
- // the DER encoded param should at most be the param size, plus a padding
- // zero, since due to being a signed integer
- var maxEncodedParamLength = paramBytes + 1;
-
- var inputLength = signature.length;
-
- var offset = 0;
- if (signature[offset++] !== ENCODED_TAG_SEQ) {
- throw new Error('Could not find expected "seq"');
- }
-
- var seqLength = signature[offset++];
- if (seqLength === (MAX_OCTET | 1)) {
- seqLength = signature[offset++];
- }
-
- if (inputLength - offset < seqLength) {
- throw new Error('"seq" specified length of "' + seqLength + '", only "' + (inputLength - offset) + '" remaining');
- }
-
- if (signature[offset++] !== ENCODED_TAG_INT) {
- throw new Error('Could not find expected "int" for "r"');
- }
-
- var rLength = signature[offset++];
-
- if (inputLength - offset - 2 < rLength) {
- throw new Error('"r" specified length of "' + rLength + '", only "' + (inputLength - offset - 2) + '" available');
- }
-
- if (maxEncodedParamLength < rLength) {
- throw new Error('"r" specified length of "' + rLength + '", max of "' + maxEncodedParamLength + '" is acceptable');
- }
-
- var rOffset = offset;
- offset += rLength;
-
- if (signature[offset++] !== ENCODED_TAG_INT) {
- throw new Error('Could not find expected "int" for "s"');
- }
-
- var sLength = signature[offset++];
-
- if (inputLength - offset !== sLength) {
- throw new Error('"s" specified length of "' + sLength + '", expected "' + (inputLength - offset) + '"');
- }
-
- if (maxEncodedParamLength < sLength) {
- throw new Error('"s" specified length of "' + sLength + '", max of "' + maxEncodedParamLength + '" is acceptable');
- }
-
- var sOffset = offset;
- offset += sLength;
-
- if (offset !== inputLength) {
- throw new Error('Expected to consume entire buffer, but "' + (inputLength - offset) + '" bytes remain');
- }
-
- var rPadding = paramBytes - rLength,
- sPadding = paramBytes - sLength;
-
- var dst = Buffer.allocUnsafe(rPadding + rLength + sPadding + sLength);
-
- for (offset = 0; offset < rPadding; ++offset) {
- dst[offset] = 0;
- }
- signature.copy(dst, offset, rOffset + Math.max(-rPadding, 0), rOffset + rLength);
-
- offset = paramBytes;
-
- for (var o = offset; offset < o + sPadding; ++offset) {
- dst[offset] = 0;
- }
- signature.copy(dst, offset, sOffset + Math.max(-sPadding, 0), sOffset + sLength);
-
- dst = dst.toString('base64');
- dst = base64Url(dst);
-
- return dst;
-}
-
-function countPadding(buf, start, stop) {
- var padding = 0;
- while (start + padding < stop && buf[start + padding] === 0) {
- ++padding;
- }
-
- var needsSign = buf[start + padding] >= MAX_OCTET;
- if (needsSign) {
- --padding;
- }
-
- return padding;
-}
-
-function joseToDer(signature, alg) {
- signature = signatureAsBuffer(signature);
- var paramBytes = getParamBytesForAlg(alg);
-
- var signatureBytes = signature.length;
- if (signatureBytes !== paramBytes * 2) {
- throw new TypeError('"' + alg + '" signatures must be "' + paramBytes * 2 + '" bytes, saw "' + signatureBytes + '"');
- }
-
- var rPadding = countPadding(signature, 0, paramBytes);
- var sPadding = countPadding(signature, paramBytes, signature.length);
- var rLength = paramBytes - rPadding;
- var sLength = paramBytes - sPadding;
-
- var rsBytes = 1 + 1 + rLength + 1 + 1 + sLength;
-
- var shortLength = rsBytes < MAX_OCTET;
-
- var dst = Buffer.allocUnsafe((shortLength ? 2 : 3) + rsBytes);
-
- var offset = 0;
- dst[offset++] = ENCODED_TAG_SEQ;
- if (shortLength) {
- // Bit 8 has value "0"
- // bits 7-1 give the length.
- dst[offset++] = rsBytes;
- } else {
- // Bit 8 of first octet has value "1"
- // bits 7-1 give the number of additional length octets.
- dst[offset++] = MAX_OCTET | 1;
- // length, base 256
- dst[offset++] = rsBytes & 0xff;
- }
- dst[offset++] = ENCODED_TAG_INT;
- dst[offset++] = rLength;
- if (rPadding < 0) {
- dst[offset++] = 0;
- offset += signature.copy(dst, offset, 0, paramBytes);
- } else {
- offset += signature.copy(dst, offset, rPadding, paramBytes);
- }
- dst[offset++] = ENCODED_TAG_INT;
- dst[offset++] = sLength;
- if (sPadding < 0) {
- dst[offset++] = 0;
- signature.copy(dst, offset, paramBytes);
- } else {
- signature.copy(dst, offset, paramBytes + sPadding);
- }
-
- return dst;
-}
-
-module.exports = {
- derToJose: derToJose,
- joseToDer: joseToDer
-};
diff --git a/jwt-scratch/src/js/node_modules/ecdsa-sig-formatter/src/param-bytes-for-alg.js b/jwt-scratch/src/js/node_modules/ecdsa-sig-formatter/src/param-bytes-for-alg.js
deleted file mode 100644
index 9fe67ac..0000000
--- a/jwt-scratch/src/js/node_modules/ecdsa-sig-formatter/src/param-bytes-for-alg.js
+++ /dev/null
@@ -1,23 +0,0 @@
-'use strict';
-
-function getParamSize(keySize) {
- var result = ((keySize / 8) | 0) + (keySize % 8 === 0 ? 0 : 1);
- return result;
-}
-
-var paramBytesForAlg = {
- ES256: getParamSize(256),
- ES384: getParamSize(384),
- ES512: getParamSize(521)
-};
-
-function getParamBytesForAlg(alg) {
- var paramBytes = paramBytesForAlg[alg];
- if (paramBytes) {
- return paramBytes;
- }
-
- throw new Error('Unknown algorithm "' + alg + '"');
-}
-
-module.exports = getParamBytesForAlg;
diff --git a/jwt-scratch/src/js/node_modules/enigma.js/CHANGELOG.md b/jwt-scratch/src/js/node_modules/enigma.js/CHANGELOG.md
deleted file mode 100644
index d1e1c90..0000000
--- a/jwt-scratch/src/js/node_modules/enigma.js/CHANGELOG.md
+++ /dev/null
@@ -1,166 +0,0 @@
-# Changelog
-
-## 2.7.2
-
-- fix massive arrays breaking the json patch
-
-## 2.7.1
-
-- fix: corrected the "Socket closed" and "Socket error" to be true enigma errors (#739)
-
-## 2.7.0
-
-- feat: added new schema, 12.612.0
-- fix: malformed api specification
-
-## 2.6.2 / 2.6.3
-
-### Fixes
-
-- fix: no undefined error on closed resolver (#678)
-- chore(deps): pdate minor and patch (#679)
-- chore(deps): update qlikcore/engine docker tag to v12.515.0 (#680)
-
-## 2.6.1
-
-### Fixes
-
-- chore(deps): update dependency rollup to v1.27.0 (#676)
-- fix(session): no echo code on suspend in rpcClosed (#675)
-
-## 2.6.0
-
-### New features
-
-- feat: send code and reason through suspend chain (#673)
-
-### Fixes
-
-- chore(deps): update dependency rollup to v1.26.4 (#671)
-- chore(deps): update minor and patch (#670)
-- chore(deps): update dependency rollup to v1.26.3 (#668)
-- chore(deps): update minor and patch (#667)
-- chore: dont generate source maps for error-codes (#666)
-- fix(error-codes): wrong description (#664)
-
-## 2.5.0
-
-### New features
-
-- Thrown errors now contain an error code (#661)
-
-### Fixes
-
-- prefer sessionid in session app creation methods (#662)
-
-## 2.4.1
-
-- fix: allow code and reason on session close to pass through (#656)
-
-## 2.4.0
-
-### New features
-
-- Traffic events on generated APIs which allows a developer to listen to handle-specific traffic for e.g. debugging purposes or tracking raw responses. See [documentation](https://github.com/qlik-oss/enigma.js/blob/master/docs/api.md#event-trafficsent-1).
-
-## 2.3.2
-
-- Added `error.code` with value `-1` when requests are rejected due to closed socket.
-
-## 2.3.1
-
-- API specification published.
-
-## 2.3.0
-
-- New schema: 12.170.2
-
-## 2.2.1
-
-- Bugfix for single-parameter method calls when using arrays which would cause the named parameters logic to take over.
-
-## 2.2.0
-
-- Expose `session.config`. See [documentation](https://github.com/qlik-oss/enigma.js/blob/master/docs/api.md#sessionconfig).
-- Use `Promise.reject` instead of `throw` in the api and error response interceptors.
-- Removed `bluebird` dependency in tests.
-- Made `retry aborted` example more robust.
-
-## 2.1.1
-
-- Bugfix for response interceptor execution order
-- Bugfix for failed delta patching when falsy values are unchanged
-
-## 2.1.0
-
-### New features
-
-- Possibility to add request interceptors. See [documentation](https://github.com/qlik-oss/enigma.js/blob/master/docs/api.md#requests).
-
-- Bugfix for delta flag (was unable to turn it off, regression from 2.0 rewrite)
-
-- New schema: 12.34.11
-
-## 2.0.2
-
-- Bugfix for suspended state when network caused a socket disconnect.
-
-## 2.0.1
-
-- Bugfix for `suspendOnClose` configuration option when session is closed by network.
-
-## 2.0.0
-
-This is a new major version and introduces some breaking changes. Please check the migration guide
-and make sure you understand the impact on your application before upgrading.
-
-See [migration guide](https://github.com/qlik-oss/enigma.js/blob/master/docs/migrate-v1.md).
-
-### New features
-
-- Interceptor concept publicly available. See [documentation](https://github.com/qlik-oss/enigma.js/blob/master/docs/api.md#interceptors).
-- Support for named QIX method parameters. See [documentation](https://github.com/qlik-oss/enigma.js/blob/master/docs/concepts.md#schemas-the-qix-interface).
-- New optional module sense-utilities. See [documentation](https://github.com/qlik-oss/enigma.js/blob/master/docs/api.md#sense-utilities-api).
-
-### Notable changes
-
-- No more product-specific configuration, 23 settings down to 8. See [documentation](https://github.com/qlik-oss/enigma.js/blob/master/docs/api.md#configuration).
-- Dropped enigma.js REST service. See [documentation](https://github.com/qlik-oss/enigma.js/blob/master/docs/migrate-v1.md#service-concept-dropped).
-- File size is ~15 times smaller (around 7kb gzipped)
-- Full control of session life-cycles. See [documentation](https://github.com/qlik-oss/enigma.js/blob/master/docs/api.md#session-api).
-
-## 1.2.1
-
-- Bugfix related to suspend/resume, notification should be qSessionState (not qConnectedState).
-
-## 1.2.0
-
-### Features
-- Suspend/Resume: It is now possible to suspend an resume qix sessions. See [session.md](https://github.com/qlik-oss/enigma.js/blob/master/docs/qix/session.md#sessions).
-
-## 1.1.1
-
-### Features
-
-- Logging (QIX/REST): It is now possible to (optionally) log traffic (request/response), this may be expanded to log other things in the future. See configuration entry `handleLog` for [QIX](docs/qix/configuration.md#config-object) and [REST](docs/rest/configuration.md#configuration).
-- API types (QIX): All object APIs returned from enigma.js now exposes their generic type (e.g. `sheet`), and their "engine" type (e.g. `GenericObject`). They can be accessed using `api.genericType` and `api.type`.
-- URL Parameters (QIX): You can now specify additional querystring parameters that should be added to the websocket URL by using `session.urlParams` configuration option. See [configuration documentation](docs/qix/configuration.md#configuration).
-- New schema (QIX): A schema for version `3.2` has been added.
-- Documentation (QIX): Added [documentation of the object API `.session` property](docs/qix/session.md), which (among other things) allows you to close apps.
-
-### Deprecations
-
-- Configuration (QIX): `config.session.reloadUri` in favor of `config.session.urlParams`.
-- Configuration (QIX/REST): `config.unsecure` (default `false`) in favor of `config.secure` (default `true`).
-
-## 1.1.0
-
-Broken release. Do not use.
-
-## 1.0.1
-
-- Fix #5: Make / optional in prefix
-
-## 1.0.0
-
-Initial public release.
diff --git a/jwt-scratch/src/js/node_modules/enigma.js/LICENSE b/jwt-scratch/src/js/node_modules/enigma.js/LICENSE
deleted file mode 100644
index 58480f7..0000000
--- a/jwt-scratch/src/js/node_modules/enigma.js/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License
-
-Copyright (c) 2016-present QlikTech International AB
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
\ No newline at end of file
diff --git a/jwt-scratch/src/js/node_modules/enigma.js/README.md b/jwt-scratch/src/js/node_modules/enigma.js/README.md
deleted file mode 100644
index dd48113..0000000
--- a/jwt-scratch/src/js/node_modules/enigma.js/README.md
+++ /dev/null
@@ -1,120 +0,0 @@
-
-
-[](https://circleci.com/gh/qlik-oss/enigma.js)
-[](https://coveralls.io/github/qlik-oss/enigma.js)
-
-enigma.js is a library that helps you communicate with Qlik QIX Engine. Examples of use may be building your own browser-based analytics tools, back-end services, or command-line scripts.
-
----
-
-- [Getting started](#getting-started)
-- [High-level concepts](./docs/concepts.md#high-level-concepts)
-- [API documentation](./docs/api.md#api-documentation)
-- [API documentation for v1.x](https://github.com/qlik-oss/enigma.js/tree/v1.x/docs#overview)
-- [Migrating from v1.x](./docs/migrate-v1.md#migrating-from-version-1x)
-- [Contributing](./.github/CONTRIBUTING.md#contributing-to-enigmajs)
-- [Releasing](./.github/CONTRIBUTING.md#releasing)
-- [Runnable examples](./examples/README.md#runnable-examples)
-
----
-
-## Getting started
-
-### Prerequisites
-
-Before continuing, make sure that you have these tools installed:
-
-* Node.js >= 4.0
-* Git bash if on Windows
-
-And know of at least some of these web technologies:
-
-* JavaScript
-* Promises
-* Websockets
-
-### Schemas
-
-enigma.js use schemas as a source when generating the QIX Engine API. The exact
-version of the schema you need is based on the QIX Engine version you want to
-communicate with, as well as what you plan on using in the QIX Engine API.
-
-Keep in mind that before version `12.20.0` the schema version corresponds to the
-Qlik Sense Enterprise version, and from `12.20.0` and forward, the schema version
-is mapped to the QIX Engine API version.
-
-Read more:
-
-* [High-level concepts: Schemas](./docs/concepts.md#schemas-the-qix-interface) for more information about how they work.
-* [schemas/](/schemas) for the available schemas.
-* [API Insights on Qlik Sense Help](https://api-insights.qlik.com/#/manifest) to identify your QIX Engine API version.
-
-### Usage
-
-First off, install enigma.js and a WebSocket library:
-
-```sh
-npm i -S enigma.js ws
-```
-
-Next, create a new file called `my-file.js` and put the following code into it:
-
-```js
-const enigma = require('enigma.js');
-const WebSocket = require('ws');
-const schema = require('enigma.js/schemas/12.20.0.json');
-
-// create a new session:
-const session = enigma.create({
- schema,
- url: 'ws://localhost:9076/app/engineData',
- createSocket: url => new WebSocket(url),
-});
-
-// bind traffic events to log what is sent and received on the socket:
-session.on('traffic:sent', data => console.log('sent:', data));
-session.on('traffic:received', data => console.log('received:', data));
-
-// open the socket and eventually receive the QIX global API, and then close
-// the session:
-session.open()
- .then((/*global*/) => console.log('We are connected!'))
- .then(() => session.close())
- .then(() => console.log('Session closed'))
- .catch(err => console.log('Something went wrong :(', err));
-```
-
-And then run it:
-
-```sh
-node my-file.js
-```
-
-You may need to adjust the code so the URL points towards your running QIX Engine.
-
-
-
-You may also use a service like [unpkg](https://unpkg.com/#/) to test enigma.js directly in your browser without using Node.js for development purposes.
-
-Create a HTML file `index.html` and insert the following example content:
-
-```html
-
-
-```
diff --git a/jwt-scratch/src/js/node_modules/enigma.js/enigma.js b/jwt-scratch/src/js/node_modules/enigma.js/enigma.js
deleted file mode 100644
index 7b9b575..0000000
--- a/jwt-scratch/src/js/node_modules/enigma.js/enigma.js
+++ /dev/null
@@ -1,3263 +0,0 @@
-/**
- * enigma.js v2.7.2
- * Copyright (c) 2020 QlikTech International AB
- * This library is licensed under MIT - See the LICENSE file for full details
- */
-
-(function (global, factory) {
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
- typeof define === 'function' && define.amd ? define(factory) :
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.enigma = factory());
-}(this, (function () { 'use strict';
-
- /**
- * Utility functions
- */
-
- var util = {};
-
- util.isObject = function isObject(arg) {
- return typeof arg === 'object' && arg !== null;
- };
-
- util.isNumber = function isNumber(arg) {
- return typeof arg === 'number';
- };
-
- util.isUndefined = function isUndefined(arg) {
- return arg === void 0;
- };
-
- util.isFunction = function isFunction(arg){
- return typeof arg === 'function';
- };
-
-
- /**
- * EventEmitter class
- */
-
- function EventEmitter() {
- EventEmitter.init.call(this);
- }
- var nodeEventEmitter = EventEmitter;
-
- // Backwards-compat with node 0.10.x
- EventEmitter.EventEmitter = EventEmitter;
-
- EventEmitter.prototype._events = undefined;
- EventEmitter.prototype._maxListeners = undefined;
-
- // By default EventEmitters will print a warning if more than 10 listeners are
- // added to it. This is a useful default which helps finding memory leaks.
- EventEmitter.defaultMaxListeners = 10;
-
- EventEmitter.init = function() {
- this._events = this._events || {};
- this._maxListeners = this._maxListeners || undefined;
- };
-
- // Obviously not all Emitters should be limited to 10. This function allows
- // that to be increased. Set to zero for unlimited.
- EventEmitter.prototype.setMaxListeners = function(n) {
- if (!util.isNumber(n) || n < 0 || isNaN(n))
- throw TypeError('n must be a positive number');
- this._maxListeners = n;
- return this;
- };
-
- EventEmitter.prototype.emit = function(type) {
- var er, handler, len, args, i, listeners;
-
- if (!this._events)
- this._events = {};
-
- // If there is no 'error' event listener then throw.
- if (type === 'error' && !this._events.error) {
- er = arguments[1];
- if (er instanceof Error) {
- throw er; // Unhandled 'error' event
- } else {
- throw Error('Uncaught, unspecified "error" event.');
- }
- }
-
- handler = this._events[type];
-
- if (util.isUndefined(handler))
- return false;
-
- if (util.isFunction(handler)) {
- switch (arguments.length) {
- // fast cases
- case 1:
- handler.call(this);
- break;
- case 2:
- handler.call(this, arguments[1]);
- break;
- case 3:
- handler.call(this, arguments[1], arguments[2]);
- break;
- // slower
- default:
- len = arguments.length;
- args = new Array(len - 1);
- for (i = 1; i < len; i++)
- args[i - 1] = arguments[i];
- handler.apply(this, args);
- }
- } else if (util.isObject(handler)) {
- len = arguments.length;
- args = new Array(len - 1);
- for (i = 1; i < len; i++)
- args[i - 1] = arguments[i];
-
- listeners = handler.slice();
- len = listeners.length;
- for (i = 0; i < len; i++)
- listeners[i].apply(this, args);
- }
-
- return true;
- };
-
- EventEmitter.prototype.addListener = function(type, listener) {
- var m;
-
- if (!util.isFunction(listener))
- throw TypeError('listener must be a function');
-
- if (!this._events)
- this._events = {};
-
- // To avoid recursion in the case that type === "newListener"! Before
- // adding it to the listeners, first emit "newListener".
- if (this._events.newListener)
- this.emit('newListener', type,
- util.isFunction(listener.listener) ?
- listener.listener : listener);
-
- if (!this._events[type])
- // Optimize the case of one listener. Don't need the extra array object.
- this._events[type] = listener;
- else if (util.isObject(this._events[type]))
- // If we've already got an array, just append.
- this._events[type].push(listener);
- else
- // Adding the second element, need to change to array.
- this._events[type] = [this._events[type], listener];
-
- // Check for listener leak
- if (util.isObject(this._events[type]) && !this._events[type].warned) {
- var m;
- if (!util.isUndefined(this._maxListeners)) {
- m = this._maxListeners;
- } else {
- m = EventEmitter.defaultMaxListeners;
- }
-
- if (m && m > 0 && this._events[type].length > m) {
- this._events[type].warned = true;
-
- if (util.isFunction(console.error)) {
- console.error('(node) warning: possible EventEmitter memory ' +
- 'leak detected. %d listeners added. ' +
- 'Use emitter.setMaxListeners() to increase limit.',
- this._events[type].length);
- }
- if (util.isFunction(console.trace))
- console.trace();
- }
- }
-
- return this;
- };
-
- EventEmitter.prototype.on = EventEmitter.prototype.addListener;
-
- EventEmitter.prototype.once = function(type, listener) {
- if (!util.isFunction(listener))
- throw TypeError('listener must be a function');
-
- var fired = false;
-
- function g() {
- this.removeListener(type, g);
-
- if (!fired) {
- fired = true;
- listener.apply(this, arguments);
- }
- }
-
- g.listener = listener;
- this.on(type, g);
-
- return this;
- };
-
- // emits a 'removeListener' event iff the listener was removed
- EventEmitter.prototype.removeListener = function(type, listener) {
- var list, position, length, i;
-
- if (!util.isFunction(listener))
- throw TypeError('listener must be a function');
-
- if (!this._events || !this._events[type])
- return this;
-
- list = this._events[type];
- length = list.length;
- position = -1;
-
- if (list === listener ||
- (util.isFunction(list.listener) && list.listener === listener)) {
- delete this._events[type];
- if (this._events.removeListener)
- this.emit('removeListener', type, listener);
-
- } else if (util.isObject(list)) {
- for (i = length; i-- > 0;) {
- if (list[i] === listener ||
- (list[i].listener && list[i].listener === listener)) {
- position = i;
- break;
- }
- }
-
- if (position < 0)
- return this;
-
- if (list.length === 1) {
- list.length = 0;
- delete this._events[type];
- } else {
- list.splice(position, 1);
- }
-
- if (this._events.removeListener)
- this.emit('removeListener', type, listener);
- }
-
- return this;
- };
-
- EventEmitter.prototype.removeAllListeners = function(type) {
- var key, listeners;
-
- if (!this._events)
- return this;
-
- // not listening for removeListener, no need to emit
- if (!this._events.removeListener) {
- if (arguments.length === 0)
- this._events = {};
- else if (this._events[type])
- delete this._events[type];
- return this;
- }
-
- // emit removeListener for all listeners on all events
- if (arguments.length === 0) {
- for (key in this._events) {
- if (key === 'removeListener') continue;
- this.removeAllListeners(key);
- }
- this.removeAllListeners('removeListener');
- this._events = {};
- return this;
- }
-
- listeners = this._events[type];
-
- if (util.isFunction(listeners)) {
- this.removeListener(type, listeners);
- } else if (Array.isArray(listeners)) {
- // LIFO order
- while (listeners.length)
- this.removeListener(type, listeners[listeners.length - 1]);
- }
- delete this._events[type];
-
- return this;
- };
-
- EventEmitter.prototype.listeners = function(type) {
- var ret;
- if (!this._events || !this._events[type])
- ret = [];
- else if (util.isFunction(this._events[type]))
- ret = [this._events[type]];
- else
- ret = this._events[type].slice();
- return ret;
- };
-
- EventEmitter.listenerCount = function(emitter, type) {
- var ret;
- if (!emitter._events || !emitter._events[type])
- ret = 0;
- else if (util.isFunction(emitter._events[type]))
- ret = 1;
- else
- ret = emitter._events[type].length;
- return ret;
- };
-
- /**
- * @module EventEmitter
- * @private
- */
-
- var Events = {
- /**
- * Function used to add event handling to objects passed in.
- * @param {Object} obj Object instance that will get event handling.
- */
- mixin: function mixin(obj) {
- Object.keys(nodeEventEmitter.prototype).forEach(function (key) {
- obj[key] = nodeEventEmitter.prototype[key];
- });
- nodeEventEmitter.init(obj);
- }
- };
-
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
-
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
-
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
-
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
-
- function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }
-
- function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
-
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
-
- function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
-
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
-
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
-
- /**
- * Error containing a custom error code.
- * @extends Error
- * @property {number} code The error code as defined by `errorCodes`
- * @property {boolean} enigmaError=true
- */
- var EnigmaError = /*#__PURE__*/function (_Error) {
- _inherits(EnigmaError, _Error);
-
- var _super = _createSuper(EnigmaError);
-
- function EnigmaError(name, code) {
- var _this;
-
- _classCallCheck(this, EnigmaError);
-
- _this = _super.call(this, name);
- _this.code = code;
- _this.enigmaError = true;
- return _this;
- }
-
- return EnigmaError;
- }( /*#__PURE__*/_wrapNativeSuper(Error));
- /**
- * Create an enigmaError
- * @private
- * @param {Number} code A proper error code from `errorCodes`
- * @param {String} name A message/name of the enigmaError.
- * @returns {EnigmaError}
- */
-
-
- function createEnigmaError(code, name) {
- return new EnigmaError(name, code);
- }
-
- /**
- * This is a list of error codes that can be thrown from enigma.js API calls.
- * @entry
- * @see EnigmaError
- * @enum
- * @example
Handling an enigma.js error
- * const { NOT_CONNECTED } = require('enigma.js/error-codes');
- * try {
- * const layout = await model.getLayout();
- * } catch (err) {
- * if (err.code === NOT_CONNECTED) {
- * console.log('Tried to communicate on a session that is closed');
- * }
- * }
- */
- var errorCodes = {
- /**
- * You're trying to send data on a socket that's not connected
- * @type {number}
- */
- NOT_CONNECTED: -1,
-
- /**
- * The object you're trying to fetch does not exist
- * @type {number}
- */
- OBJECT_NOT_FOUND: -2,
-
- /**
- * Unexpected RPC response, expected array of patches
- * @type {number}
- */
- EXPECTED_ARRAY_OF_PATCHES: -3,
-
- /**
- * Patchee is not an object we can patch
- * @type {number}
- */
- PATCH_HAS_NO_PARENT: -4,
-
- /**
- * This entry is already defined with another key
- * @type {number}
- */
- ENTRY_ALREADY_DEFINED: -5,
-
- /**
- * You need to supply a configuration
- * @type {number}
- */
- NO_CONFIG_SUPPLIED: -6,
-
- /**
- * There's no promise object available (polyfill required?)
- * @type {number}
- */
- PROMISE_REQUIRED: -7,
-
- /**
- * The schema struct type you requested does not exist
- * @type {number}
- */
- SCHEMA_STRUCT_TYPE_NOT_FOUND: -8,
-
- /**
- * Can't override this function
- * @type {number}
- */
- SCHEMA_MIXIN_CANT_OVERRIDE_FUNCTION: -9,
-
- /**
- * Extend is not allowed for this mixin
- * @type {number}
- */
- SCHEMA_MIXIN_EXTEND_NOT_ALLOWED: -10,
-
- /**
- * Session suspended - no interaction allowed
- * @type {number}
- */
- SESSION_SUSPENDED: -11,
-
- /**
- * onlyIfAttached supplied, but you got SESSION_CREATED
- * @type {number}
- */
- SESSION_NOT_ATTACHED: -12
- };
-
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
-
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
-
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
-
- function _classCallCheck$1(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
-
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
- var RPC_CLOSE_NORMAL = 1000;
- var RPC_CLOSE_MANUAL_SUSPEND = 4000;
- var cacheId = 0;
- /**
- * The QIX Engine session object
- */
-
- var Session = /*#__PURE__*/function () {
- /**
- * Handle all JSON-RPC notification event, 'notification:*. Or handle a specific JSON-RPC
- * notification event, 'notification:OnConnected'. These events depend on the product you use QIX
- * Engine from.
- * @event Session#notification
- * @type {Object}
- * @example Bind the notification events
- * // bind all notifications to console.log:
- * session.on('notification:*', console.log);
- * // bind a specific notification to console.log:
- * session.on('notification:OnConnected', console.log);
- */
-
- /**
- * Handle websocket messages. Generally used in debugging purposes. `traffic:*` will handle all
- * websocket messages, `traffic:sent` will handle outgoing messages and `traffic:received` will
- * handle incoming messages.
- * @event Session#traffic
- * @type {Object}
- * @example Bind the traffic events
- * // bind both in- and outbound traffic to console.log:
- * session.on('traffic:*', console.log);
- * // bind outbound traffic to console.log:
- * session.on('traffic:sent', console.log);
- * // bind inbound traffic to console.log:
- * session.on('traffic:received', console.log);
- */
- function Session(options) {
- _classCallCheck$1(this, Session);
-
- var session = this;
- Object.assign(session, options);
- this.Promise = this.config.Promise;
- this.definition = this.config.definition;
- Events.mixin(session);
- cacheId += 1;
- session.id = cacheId;
- session.rpc.on('socket-error', session.onRpcError.bind(session));
- session.rpc.on('closed', session.onRpcClosed.bind(session));
- session.rpc.on('message', session.onRpcMessage.bind(session));
- session.rpc.on('notification', session.onRpcNotification.bind(session));
- session.rpc.on('traffic', session.onRpcTraffic.bind(session));
- session.on('closed', function () {
- return session.onSessionClosed();
- });
- }
- /**
- * Event handler for re-triggering error events from RPC.
- * @private
- * @emits socket-error
- * @param {Error} err Webocket error event.
- */
-
-
- _createClass(Session, [{
- key: "onRpcError",
- value: function onRpcError(err) {
- if (this.suspendResume.isSuspended) {
- return;
- }
-
- this.emit('socket-error', err);
- }
- /**
- * Event handler for the RPC close event.
- * @private
- * @emits Session#suspended
- * @emits Session#closed
- * @param {Event} evt WebSocket close event.
- */
-
- }, {
- key: "onRpcClosed",
- value: function onRpcClosed(evt) {
- var _this = this;
-
- /**
- * Handle suspended state. This event is triggered in two cases (listed below). It is useful
- * in scenarios where you for example want to block interaction in your application until you
- * are resumed again. If config.suspendOnClose is true and there was a network disconnect
- * (socked closed) or if you ran session.suspend().
- * @event Session#suspended
- * @type {Object}
- * @param {Object} evt Event object.
- * @param {String} evt.initiator String indication what triggered the suspended state. Possible
- * values network, manual.
- * @example Handling session suspended
- * session.on('suspended', () => {
- * console.log('Session was suspended, retrying...');
- * session.resume();
- * });
- */
- if (this.suspendResume.isSuspended) {
- return;
- }
-
- if (evt.code === RPC_CLOSE_NORMAL || evt.code === RPC_CLOSE_MANUAL_SUSPEND) {
- return;
- }
-
- if (this.config.suspendOnClose) {
- var code = evt.code,
- reason = evt.reason;
- this.suspendResume.suspend().then(function () {
- return _this.emit('suspended', {
- initiator: 'network',
- code: code,
- reason: reason
- });
- });
- } else {
- this.emit('closed', evt);
- }
- }
- /**
- * Event handler for the RPC message event.
- * @private
- * @param {Object} response JSONRPC response.
- */
-
- }, {
- key: "onRpcMessage",
- value: function onRpcMessage(response) {
- var _this2 = this;
-
- if (this.suspendResume.isSuspended) {
- return;
- }
-
- if (response.change) {
- response.change.forEach(function (handle) {
- return _this2.emitHandleChanged(handle);
- });
- }
-
- if (response.close) {
- response.close.forEach(function (handle) {
- return _this2.emitHandleClosed(handle);
- });
- }
- }
- /**
- * Event handler for the RPC notification event.
- * @private
- * @emits Session#notification
- * @param {Object} response The JSONRPC notification.
- */
-
- }, {
- key: "onRpcNotification",
- value: function onRpcNotification(response) {
- this.emit('notification:*', response.method, response.params);
- this.emit("notification:".concat(response.method), response.params);
- }
- /**
- * Event handler for the RPC traffic event.
- * @private
- * @emits Session#traffic
- * @param {String} dir The traffic direction, sent or received.
- * @param {Object} data JSONRPC request/response/WebSocket message.
- * @param {Number} handle The associated handle.
- */
-
- }, {
- key: "onRpcTraffic",
- value: function onRpcTraffic(dir, data, handle) {
- this.emit('traffic:*', dir, data);
- this.emit("traffic:".concat(dir), data);
- var api = this.apis.getApi(handle);
-
- if (api) {
- api.emit('traffic:*', dir, data);
- api.emit("traffic:".concat(dir), data);
- }
- }
- /**
- * Event handler for cleaning up API instances when a session has been closed.
- * @private
- * @emits API#closed
- */
-
- }, {
- key: "onSessionClosed",
- value: function onSessionClosed() {
- this.apis.getApis().forEach(function (entry) {
- entry.api.emit('closed');
- entry.api.removeAllListeners();
- });
- this.apis.clear();
- }
- /**
- * Function used to get an API for a backend object.
- * @private
- * @param {Object} args Arguments used to create object API.
- * @param {Number} args.handle Handle of the backend object.
- * @param {String} args.id ID of the backend object.
- * @param {String} args.type QIX type of the backend object. Can for example
- * be "Doc" or "GenericVariable".
- * @param {String} args.genericType Custom type of the backend object, if defined in qInfo.
- * @returns {Object} Returns the generated and possibly augmented API.
- */
-
- }, {
- key: "getObjectApi",
- value: function getObjectApi(args) {
- var handle = args.handle,
- id = args.id,
- type = args.type,
- genericType = args.genericType;
- var api = this.apis.getApi(handle);
-
- if (api) {
- return api;
- }
-
- var factory = this.definition.generate(type);
- api = factory(this, handle, id, genericType);
- this.apis.add(handle, api);
- return api;
- }
- /**
- * Establishes the websocket against the configured URL and returns the Global instance.
- * @emits Session#opened
- * @returns {Promise