From cd399f752d0e714ee18f738efa8522c021a5d5c9 Mon Sep 17 00:00:00 2001
From: Orkun
Date: Tue, 29 Oct 2024 11:52:32 +0300
Subject: [PATCH 01/10] chore: add name to package json file
---
package.json | 1 +
1 file changed, 1 insertion(+)
diff --git a/package.json b/package.json
index 7babbeb..94a0ede 100644
--- a/package.json
+++ b/package.json
@@ -1,4 +1,5 @@
{
+ "name": "fingerprint-pro-fastly-compute-proxy-integration",
"version": "0.0.0",
"engines": {
"node": ">=20"
From 88528b8f8e867421ba8cd9fb659991a4ff8d467e Mon Sep 17 00:00:00 2001
From: Orkun
Date: Tue, 29 Oct 2024 12:05:06 +0300
Subject: [PATCH 02/10] docs(readme): add beta badge to the readme
---
README.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/README.md b/README.md
index 04df5da..47b00cf 100644
--- a/README.md
+++ b/README.md
@@ -22,6 +22,8 @@ The Fastly Compute Proxy Integration is responsible for proxying identification
## 🚧 Requirements and expectations
+* **Integration in Beta**: Please report any issues to our support team.
+
* **Limited to Enterprise customers**: At this point, this proxy integration is accessible and exclusively supported for customers on the **Enterprise** Plan. Other customers are encouraged to use [Custom subdomain setup](https://dev.fingerprint.com/docs/custom-subdomain-setup) or [Cloudflare Proxy Integration](https://dev.fingerprint.com/docs/cloudflare-integration).
* **Manual updates occasionally required**: The underlying data contract in the identification logic can change to keep up with browser updates. Using the Fastly Compute Proxy Integration might require occasional manual updates on your side. Ignoring these updates will lead to lower accuracy or service disruption.
From 7b9b4158eeedad7762ba5fa3619a9aea474ad4c8 Mon Sep 17 00:00:00 2001
From: Orkun
Date: Tue, 29 Oct 2024 12:19:14 +0300
Subject: [PATCH 03/10] chore(deps): add commitlint package from fingerprint
dx-team
---
commitlint.config.js | 2 +-
package.json | 5 +++--
pnpm-lock.yaml | 26 ++++++++++++++++++++++++++
3 files changed, 30 insertions(+), 3 deletions(-)
diff --git a/commitlint.config.js b/commitlint.config.js
index 4fedde6..4f140a3 100644
--- a/commitlint.config.js
+++ b/commitlint.config.js
@@ -1 +1 @@
-module.exports = { extends: ['@commitlint/config-conventional'] }
+module.exports = { extends: ['@fingerprintjs/commit-lint-dx-team'] }
diff --git a/package.json b/package.json
index 94a0ede..9c86876 100644
--- a/package.json
+++ b/package.json
@@ -10,6 +10,7 @@
"@babel/preset-typescript": "^7.24.7",
"@commitlint/config-conventional": "^19.4.1",
"@fastly/cli": "^10.15.0",
+ "@fingerprintjs/commit-lint-dx-team": "^0.1.0",
"@fingerprintjs/eslint-config-dx-team": "^0.1.0",
"@fingerprintjs/fingerprintjs-pro-server-api": "^5.0.0",
"@fingerprintjs/prettier-config-dx-team": "^0.2.0",
@@ -19,18 +20,18 @@
"@types/cookie": "^0.6.0",
"@types/jest": "^29.5.12",
"@types/node": "^22.7.0",
+ "@types/pako": "^2.0.3",
"babel-jest": "^29.7.0",
"esbuild": "^0.24.0",
"fastly": "7.3.0",
- "@types/pako": "^2.0.3",
"fs": "0.0.1-security",
"husky": "^9.1.5",
"jest": "^29.7.0",
"pako": "^2.1.0",
"path": "^0.12.7",
"ts-jest": "^29.2.5",
- "ts-node": "^10.9.2",
"ts-loader": "^9.5.1",
+ "ts-node": "^10.9.2",
"tslib": "^2.7.0",
"typescript": "5.3.3"
},
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 174d812..919a2f0 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -30,6 +30,9 @@ importers:
'@fastly/cli':
specifier: ^10.15.0
version: 10.15.0
+ '@fingerprintjs/commit-lint-dx-team':
+ specifier: ^0.1.0
+ version: 0.1.0
'@fingerprintjs/eslint-config-dx-team':
specifier: ^0.1.0
version: 0.1.0(prettier@3.2.4)(typescript@5.3.3)
@@ -752,6 +755,10 @@ packages:
engines: {node: '>=16'}
hasBin: true
+ '@commitlint/config-conventional@17.8.1':
+ resolution: {integrity: sha512-NxCOHx1kgneig3VLauWJcDWS40DVjg7nKOpBEEK9E5fjJpQqLCilcnKkIIjdBH98kEO1q3NpE5NSrZ2kl/QGJg==}
+ engines: {node: '>=v14'}
+
'@commitlint/config-conventional@19.5.0':
resolution: {integrity: sha512-OBhdtJyHNPryZKg0fFpZNOBM1ZDbntMvqMuSmpfyP86XSfwzGw4CaoYRG4RutUPg0BTK07VMRIkNJT6wi2zthg==}
engines: {node: '>=v18'}
@@ -992,6 +999,9 @@ packages:
resolution: {integrity: sha512-wSmc8FOH8hdl/swTV2c44eau5yMMrulZVFxZsVye2tlje8XBGAv/ogSFXRHiEXDyUSxHwUIyr2DRUSz5qpRgLQ==}
hasBin: true
+ '@fingerprintjs/commit-lint-dx-team@0.1.0':
+ resolution: {integrity: sha512-MSYn4bRt9Iyob8hB3Oc/IXz3O8DA2E3ccqlG46pYYhdF090W6u9BNa9uCaVg611FUzqMU41+vs8ztXLkICbKkw==}
+
'@fingerprintjs/eslint-config-dx-team@0.1.0':
resolution: {integrity: sha512-Yet9e0dDGmAhMsXnnRWbvTAWLlA2qWGvsOBnRscZtlJnv/Xm4xzurR4C4bqPBcX3rVZkedv9dBTLW3t/wRY0mA==}
peerDependencies:
@@ -1711,6 +1721,10 @@ packages:
concat-map@0.0.1:
resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==}
+ conventional-changelog-conventionalcommits@6.1.0:
+ resolution: {integrity: sha512-3cS3GEtR78zTfMzk0AizXKKIdN4OvSh7ibNz6/DPbhWWQu7LqE/8+/GqSodV+sywUR2gpJAdP/1JFf4XtN7Zpw==}
+ engines: {node: '>=14'}
+
conventional-changelog-conventionalcommits@7.0.2:
resolution: {integrity: sha512-NKXYmMR/Hr1DevQegFB4MwfM5Vv0m4UIxKZTTYuD98lpTknaZlSRrDOG4X7wIXpGkfsYxZTghUN+Qq+T0YQI7w==}
engines: {node: '>=16'}
@@ -4021,6 +4035,10 @@ snapshots:
'@bytecodealliance/wizer-linux-x64': 7.0.5
'@bytecodealliance/wizer-win32-x64': 7.0.5
+ '@commitlint/config-conventional@17.8.1':
+ dependencies:
+ conventional-changelog-conventionalcommits: 6.1.0
+
'@commitlint/config-conventional@19.5.0':
dependencies:
'@commitlint/types': 19.5.0
@@ -4192,6 +4210,10 @@ snapshots:
magic-string: 0.30.12
regexpu-core: 6.1.1
+ '@fingerprintjs/commit-lint-dx-team@0.1.0':
+ dependencies:
+ '@commitlint/config-conventional': 17.8.1
+
'@fingerprintjs/eslint-config-dx-team@0.1.0(prettier@3.2.4)(typescript@5.3.3)':
dependencies:
'@typescript-eslint/eslint-plugin': 6.19.1(@typescript-eslint/parser@6.19.1(eslint@8.56.0)(typescript@5.3.3))(eslint@8.56.0)(typescript@5.3.3)
@@ -5063,6 +5085,10 @@ snapshots:
concat-map@0.0.1: {}
+ conventional-changelog-conventionalcommits@6.1.0:
+ dependencies:
+ compare-func: 2.0.0
+
conventional-changelog-conventionalcommits@7.0.2:
dependencies:
compare-func: 2.0.0
From 82c3aacd7b6b11d97720017fb5c58b1c7989d434 Mon Sep 17 00:00:00 2001
From: Orkun
Date: Tue, 29 Oct 2024 12:25:25 +0300
Subject: [PATCH 04/10] docs(readme): add beta warning and mailto link
---
README.md | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 47b00cf..0f9da02 100644
--- a/README.md
+++ b/README.md
@@ -14,6 +14,9 @@
+> [!WARNING]
+> This integration is in Beta
+
# Fingerprint Pro Fastly Compute Proxy Integration
[Fingerprint](https://fingerprint.com) is a device intelligence platform offering highly accurate visitor identification.
@@ -22,7 +25,7 @@ The Fastly Compute Proxy Integration is responsible for proxying identification
## 🚧 Requirements and expectations
-* **Integration in Beta**: Please report any issues to our support team.
+* **Integration in Beta**: Please report any issues to our [support team](mailto:support@fingerprint.com).
* **Limited to Enterprise customers**: At this point, this proxy integration is accessible and exclusively supported for customers on the **Enterprise** Plan. Other customers are encouraged to use [Custom subdomain setup](https://dev.fingerprint.com/docs/custom-subdomain-setup) or [Cloudflare Proxy Integration](https://dev.fingerprint.com/docs/cloudflare-integration).
From 33f6da03c770dcc7bb4d9748db5d5c5211bd1eda Mon Sep 17 00:00:00 2001
From: Orkun
Date: Tue, 29 Oct 2024 12:38:06 +0300
Subject: [PATCH 05/10] docs(readme): update support link to the website
Co-authored-by: Juraj Uhlar
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 0f9da02..93e284a 100644
--- a/README.md
+++ b/README.md
@@ -25,7 +25,7 @@ The Fastly Compute Proxy Integration is responsible for proxying identification
## 🚧 Requirements and expectations
-* **Integration in Beta**: Please report any issues to our [support team](mailto:support@fingerprint.com).
+* **Integration in Beta**: Please report any issues to our [support team](https://fingerprint.com/support/).
* **Limited to Enterprise customers**: At this point, this proxy integration is accessible and exclusively supported for customers on the **Enterprise** Plan. Other customers are encouraged to use [Custom subdomain setup](https://dev.fingerprint.com/docs/custom-subdomain-setup) or [Cloudflare Proxy Integration](https://dev.fingerprint.com/docs/cloudflare-integration).
From 51f97aa45bcf716fc1be00c742ae6e3d2a57954f Mon Sep 17 00:00:00 2001
From: Orkun
Date: Tue, 29 Oct 2024 12:39:07 +0300
Subject: [PATCH 06/10] chore(deps): remove commitlint package
---
package.json | 1 -
pnpm-lock.yaml | 36 ------------------------------------
2 files changed, 37 deletions(-)
diff --git a/package.json b/package.json
index 9c86876..658fd1b 100644
--- a/package.json
+++ b/package.json
@@ -8,7 +8,6 @@
"@babel/core": "^7.25.2",
"@babel/preset-env": "^7.25.4",
"@babel/preset-typescript": "^7.24.7",
- "@commitlint/config-conventional": "^19.4.1",
"@fastly/cli": "^10.15.0",
"@fingerprintjs/commit-lint-dx-team": "^0.1.0",
"@fingerprintjs/eslint-config-dx-team": "^0.1.0",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 919a2f0..7f31048 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -24,9 +24,6 @@ importers:
'@babel/preset-typescript':
specifier: ^7.24.7
version: 7.25.9(@babel/core@7.25.9)
- '@commitlint/config-conventional':
- specifier: ^19.4.1
- version: 19.5.0
'@fastly/cli':
specifier: ^10.15.0
version: 10.15.0
@@ -759,14 +756,6 @@ packages:
resolution: {integrity: sha512-NxCOHx1kgneig3VLauWJcDWS40DVjg7nKOpBEEK9E5fjJpQqLCilcnKkIIjdBH98kEO1q3NpE5NSrZ2kl/QGJg==}
engines: {node: '>=v14'}
- '@commitlint/config-conventional@19.5.0':
- resolution: {integrity: sha512-OBhdtJyHNPryZKg0fFpZNOBM1ZDbntMvqMuSmpfyP86XSfwzGw4CaoYRG4RutUPg0BTK07VMRIkNJT6wi2zthg==}
- engines: {node: '>=v18'}
-
- '@commitlint/types@19.5.0':
- resolution: {integrity: sha512-DSHae2obMSMkAtTBSOulg5X7/z+rGLxcXQIkg3OmWvY6wifojge5uVMydfhUvs7yQj+V7jNmRZ2Xzl8GJyqRgg==}
- engines: {node: '>=v18'}
-
'@cspotcode/source-map-support@0.8.1':
resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==}
engines: {node: '>=12'}
@@ -1292,9 +1281,6 @@ packages:
'@types/babel__traverse@7.20.6':
resolution: {integrity: sha512-r1bzfrm0tomOI8g1SzvCaQHo6Lcv6zu0EA+W2kHrt8dyrHQxGzBBL4kdkzIS+jBMV+EYcMAEAqXqYaLJq5rOZg==}
- '@types/conventional-commits-parser@5.0.0':
- resolution: {integrity: sha512-loB369iXNmAZglwWATL+WRe+CRMmmBPtpolYzIebFaX4YA3x+BEfLqhUAV9WanycKI3TG1IMr5bMJDajDKLlUQ==}
-
'@types/cookie@0.6.0':
resolution: {integrity: sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==}
@@ -1725,10 +1711,6 @@ packages:
resolution: {integrity: sha512-3cS3GEtR78zTfMzk0AizXKKIdN4OvSh7ibNz6/DPbhWWQu7LqE/8+/GqSodV+sywUR2gpJAdP/1JFf4XtN7Zpw==}
engines: {node: '>=14'}
- conventional-changelog-conventionalcommits@7.0.2:
- resolution: {integrity: sha512-NKXYmMR/Hr1DevQegFB4MwfM5Vv0m4UIxKZTTYuD98lpTknaZlSRrDOG4X7wIXpGkfsYxZTghUN+Qq+T0YQI7w==}
- engines: {node: '>=16'}
-
convert-source-map@2.0.0:
resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==}
@@ -4039,16 +4021,6 @@ snapshots:
dependencies:
conventional-changelog-conventionalcommits: 6.1.0
- '@commitlint/config-conventional@19.5.0':
- dependencies:
- '@commitlint/types': 19.5.0
- conventional-changelog-conventionalcommits: 7.0.2
-
- '@commitlint/types@19.5.0':
- dependencies:
- '@types/conventional-commits-parser': 5.0.0
- chalk: 5.3.0
-
'@cspotcode/source-map-support@0.8.1':
dependencies:
'@jridgewell/trace-mapping': 0.3.9
@@ -4586,10 +4558,6 @@ snapshots:
dependencies:
'@babel/types': 7.25.9
- '@types/conventional-commits-parser@5.0.0':
- dependencies:
- '@types/node': 22.7.9
-
'@types/cookie@0.6.0': {}
'@types/estree@1.0.6': {}
@@ -5089,10 +5057,6 @@ snapshots:
dependencies:
compare-func: 2.0.0
- conventional-changelog-conventionalcommits@7.0.2:
- dependencies:
- compare-func: 2.0.0
-
convert-source-map@2.0.0: {}
cookie@0.7.0: {}
From 685006e7d8a40b900c3018aba2322db47ccd8bcb Mon Sep 17 00:00:00 2001
From: Orkun
Date: Tue, 29 Oct 2024 12:44:03 +0300
Subject: [PATCH 07/10] chore(ci): add reset prerelease branch action
---
.github/workflows/reset-prerelease-branch.yml | 12 ++++++++++++
1 file changed, 12 insertions(+)
create mode 100644 .github/workflows/reset-prerelease-branch.yml
diff --git a/.github/workflows/reset-prerelease-branch.yml b/.github/workflows/reset-prerelease-branch.yml
new file mode 100644
index 0000000..a621b18
--- /dev/null
+++ b/.github/workflows/reset-prerelease-branch.yml
@@ -0,0 +1,12 @@
+name: Reset Prerelease Branch
+on:
+ workflow_dispatch:
+
+jobs:
+ reset-feature-branch:
+ uses: fingerprintjs/dx-team-toolkit/.github/workflows/reset-prerelease-branch.yml@v1
+ with:
+ branch_name: 'rc'
+ appId: ${{ vars.APP_ID }}
+ secrets:
+ APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
From f4837838abb817e2aeb1ce26166061d9e9840cb7 Mon Sep 17 00:00:00 2001
From: Orkun
Date: Tue, 29 Oct 2024 15:38:58 +0300
Subject: [PATCH 08/10] chore: dont catch error for decryption
---
src/utils/processOpenClientResponse.ts | 2 +-
src/utils/unsealData.ts | 17 +++++------------
2 files changed, 6 insertions(+), 13 deletions(-)
diff --git a/src/utils/processOpenClientResponse.ts b/src/utils/processOpenClientResponse.ts
index bf4bd14..810bd4f 100644
--- a/src/utils/processOpenClientResponse.ts
+++ b/src/utils/processOpenClientResponse.ts
@@ -19,7 +19,7 @@ export async function processOpenClientResponse(body: string | undefined, respon
throw new Error('Decryption key not found in secret store')
}
const parsedText = JSON.parse(body ?? '') as FingerprintSealedIngressResponseBody
- const event = await unsealData(parsedText.sealedResult, decryptionKey)
+ const event = unsealData(parsedText.sealedResult, decryptionKey)
const filteredPlugins = plugins.filter((t) => t.type === 'processOpenClientResponse')
for (const filteredPlugin of filteredPlugins) {
try {
diff --git a/src/utils/unsealData.ts b/src/utils/unsealData.ts
index d48787b..2fcf3ba 100644
--- a/src/utils/unsealData.ts
+++ b/src/utils/unsealData.ts
@@ -2,17 +2,10 @@ import { EventResponse } from '@fingerprintjs/fingerprintjs-pro-server-api'
import { decrypt } from './decrypt'
import { base64StrToUint8Array } from './base64'
-export async function unsealData(rawSealedData: string, rawKey: string): Promise {
- try {
- const sealedData = base64StrToUint8Array(rawSealedData)
- const key = base64StrToUint8Array(rawKey)
+export function unsealData(rawSealedData: string, rawKey: string): EventResponse | null {
+ const sealedData = base64StrToUint8Array(rawSealedData)
+ const key = base64StrToUint8Array(rawKey)
+ const result = decrypt(sealedData, key)
- const result = decrypt(sealedData, key)
-
- return JSON.parse(result)
- } catch (e) {
- console.error('failed to unseal data', e)
-
- return null
- }
+ return JSON.parse(result)
}
From 0bd96660baa0f45aa93def3b44eee48246ba5156 Mon Sep 17 00:00:00 2001
From: Orkun
Date: Tue, 29 Oct 2024 15:40:19 +0300
Subject: [PATCH 09/10] docs(readme): remove big banner for beta badge
---
README.md | 3 ---
1 file changed, 3 deletions(-)
diff --git a/README.md b/README.md
index 93e284a..0bffe9e 100644
--- a/README.md
+++ b/README.md
@@ -14,9 +14,6 @@
-> [!WARNING]
-> This integration is in Beta
-
# Fingerprint Pro Fastly Compute Proxy Integration
[Fingerprint](https://fingerprint.com) is a device intelligence platform offering highly accurate visitor identification.
From 55f891f9f11966b678e457da27f61512b4274ffd Mon Sep 17 00:00:00 2001
From: Orkun
Date: Tue, 29 Oct 2024 16:03:48 +0300
Subject: [PATCH 10/10] chore: remove reset prerelease branch action
---
.github/workflows/reset-prerelease-branch.yml | 12 ------------
1 file changed, 12 deletions(-)
delete mode 100644 .github/workflows/reset-prerelease-branch.yml
diff --git a/.github/workflows/reset-prerelease-branch.yml b/.github/workflows/reset-prerelease-branch.yml
deleted file mode 100644
index a621b18..0000000
--- a/.github/workflows/reset-prerelease-branch.yml
+++ /dev/null
@@ -1,12 +0,0 @@
-name: Reset Prerelease Branch
-on:
- workflow_dispatch:
-
-jobs:
- reset-feature-branch:
- uses: fingerprintjs/dx-team-toolkit/.github/workflows/reset-prerelease-branch.yml@v1
- with:
- branch_name: 'rc'
- appId: ${{ vars.APP_ID }}
- secrets:
- APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}