Skip to content

Commit

Permalink
Merge pull request #3 from fingerprintjs/fix-repo
Browse files Browse the repository at this point in the history
chore: add name to package json file
  • Loading branch information
Orkuncakilkaya authored Oct 29, 2024
2 parents 461750b + 55f891f commit d138fcd
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 46 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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](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).

* **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.
Expand Down
2 changes: 1 addition & 1 deletion commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = { extends: ['@commitlint/config-conventional'] }
module.exports = { extends: ['@fingerprintjs/commit-lint-dx-team'] }
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "fingerprint-pro-fastly-compute-proxy-integration",
"version": "0.0.0",
"engines": {
"node": ">=20"
Expand All @@ -7,8 +8,8 @@
"@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",
"@fingerprintjs/fingerprintjs-pro-server-api": "^5.0.0",
"@fingerprintjs/prettier-config-dx-team": "^0.2.0",
Expand All @@ -18,18 +19,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"
},
Expand Down
48 changes: 19 additions & 29 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/utils/processOpenClientResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
17 changes: 5 additions & 12 deletions src/utils/unsealData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<EventResponse | null> {
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)
}

0 comments on commit d138fcd

Please sign in to comment.