This PR implements an eligibility check for the Safe clients. The main criterion for eligibility (e.g.: eligible for rewards) is the country of origin of the incoming request.
For that purpose, FingerprintJS is used. This service requires the client to install a JS Agent, that makes a request to Fingerprint servers. The response contains a sealed data payload, holding anonymous identity data like browser type, VPN information, IP location, etc. Then, this data can be sent to the CGW, which unseals it, and applies the eligibility logic.
Summary
This PR implements an eligibility check for the Safe clients. The main criterion for eligibility (e.g.: eligible for rewards) is the country of origin of the incoming request.
For that purpose, FingerprintJS is used. This service requires the client to install a JS Agent, that makes a request to Fingerprint servers. The response contains a sealed data payload, holding anonymous identity data like browser type, VPN information, IP location, etc. Then, this data can be sent to the CGW, which unseals it, and applies the eligibility logic.
A more detailed explanation of how this works can be found in the Fingerprint documentation for Sealed Client Results.
Changes
CommunityRepository['checkEligibility']
function to check if a specific request is eligible.FingerprintApiService
that wraps aFingerprintJS
library, to unseal the request identity payload.FINGERPRINT_NON_ELIGIBLE_COUNTRIES
as a non-mandatory environment variable (defaulting to['US']
).FINGERPRINT_ENCRYPTION_KEY
as a mandatory environment variable.Out of scope