-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tighten eligibility vpn check #2150
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,13 @@ export const FingerprintIpInfoSchema = z.object({ | |
export type FingerprintIpInfo = z.infer<typeof FingerprintIpInfoSchema>; | ||
|
||
export const FingerprintVpnSchema = z.object({ | ||
data: z.object({ result: z.boolean() }).nullish().default(null), | ||
data: z | ||
.object({ | ||
result: z.boolean(), | ||
confidence: z.enum(['low', 'medium', 'high']), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: we should add an |
||
}) | ||
.nullish() | ||
.default(null), | ||
}); | ||
|
||
export type FingerprintVpn = z.infer<typeof FingerprintVpnSchema>; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,7 +39,9 @@ export class FingerprintApiService implements IIdentityApi { | |
return { | ||
requestId, | ||
isAllowed: this.isAllowed(unsealedData), | ||
isVpn: unsealedData.products.vpn?.data?.result === true, | ||
isVpn: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: maybe we could extract this to a new |
||
unsealedData.products.vpn?.data?.result === true && | ||
unsealedData.products.vpn?.data?.confidence === 'high', | ||
}; | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Taken from their documentation: https://dev.fingerprint.com/docs/smart-signals-reference#confidence
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: could we extract this to an
enum
, as it's used in across several places?(as an example):