Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 0 additions & 49 deletions package-lock.json

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

1 change: 0 additions & 1 deletion packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
"@audius/fetch-nft": "0.2.8",
"@audius/fixed-decimal": "*",
"@audius/sdk": "*",
"@fingerprintjs/fingerprintjs-pro": "3.5.6",
"@jup-ag/api": "6.0.48",
"@metaplex-foundation/mpl-token-metadata": "2.5.2",
"@optimizely/optimizely-sdk": "4.0.0",
Expand Down
3 changes: 0 additions & 3 deletions packages/common/src/services/auth/authService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export type AuthService = {
signIn: (
email: string,
password: string,
visitorId?: string,
otp?: string
) => Promise<SignInResponse>
signOut: () => Promise<void>
Expand Down Expand Up @@ -65,14 +64,12 @@ export const createAuthService = ({
const signIn = async (
email: string,
password: string,
visitorId?: string,
otp?: string
) => {
const wallet = await hedgehogInstance.login({
email,
username: email,
password,
visitorId,
otp
})

Expand Down
2 changes: 0 additions & 2 deletions packages/common/src/services/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ export type Env = {
ETH_TOKEN_BRIDGE_ADDRESS: Nullable<string>
EXPLORE_CONTENT_URL: string
FCM_PUSH_PUBLIC_KEY: Nullable<string>
FINGERPRINT_ENDPOINT: Nullable<string>
FINGERPRINT_PUBLIC_API_KEY: Nullable<string>
GA_HOSTNAME: string
GA_MEASUREMENT_ID: string
HCAPTCHA_BASE_URL: string
Expand Down
61 changes: 0 additions & 61 deletions packages/common/src/services/fingerprint/FingerprintClient.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/common/src/services/fingerprint/index.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/common/src/services/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ export * from './auth'
export * from './remote-config'
export * from './RandomImage'
export * from './audius-backend'
export * from './fingerprint'
export * from './local-storage'
export * from './wallet-client'
export * from './env'
Expand Down
2 changes: 0 additions & 2 deletions packages/common/src/store/storeContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import { AudioPlayer } from '../services/audio-player'
import { AudiusBackend } from '../services/audius-backend'
import { Env } from '../services/env'
import { Explore } from '../services/explore'
import { FingerprintClient } from '../services/fingerprint'
import { LocalStorage } from '../services/local-storage'
import { FeatureFlags, RemoteConfigInstance } from '../services/remote-config'
import { TrackDownload } from '../services/track-download'
Expand Down Expand Up @@ -53,7 +52,6 @@ export type CommonStoreContext = {
getHostUrl: () => string
remoteConfigInstance: RemoteConfigInstance
audiusBackendInstance: AudiusBackend
fingerprintClient: FingerprintClient<any>
walletClient: WalletClient
localStorage: LocalStorage
isNativeMobile: boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'dotenv/config'

import postgres from 'postgres'
import fetch from 'cross-fetch'
import { useEmailDeliverable, useFingerprintDeviceCount } from './identity'
import { useEmailDeliverable } from './identity'

export const sql = postgres(process.env.audius_db_url || '')

Expand Down Expand Up @@ -157,8 +157,7 @@ export async function getUserNormalizedScore(userId: number, wallet: string) {
// Convert values to numbers
const shadowbanScore = Number(shadowban_score)

const numberOfUserWithFingerprint = (await useFingerprintDeviceCount(userId))!
let overallScore = shadowbanScore - numberOfUserWithFingerprint
let overallScore = shadowbanScore

const isEmailDeliverable = await useEmailDeliverable(wallet)
if (!isEmailDeliverable) {
Expand All @@ -184,7 +183,6 @@ export async function getUserNormalizedScore(userId: number, wallet: string) {
challengeCount: challenge_count,
followingCount: following_count,
chatBlockCount: chat_block_count,
fingerprintCount: numberOfUserWithFingerprint,
isAudiusImpersonator: is_audius_impersonator,
hasProfilePicture: has_profile_picture,
isEmailDeliverable,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,50 +4,6 @@ import postgres from 'postgres'

export const sql = postgres(process.env.IDENTITY_DB_URL || '')

type FingerprintCount = {
fingerprint: string
userCount: number
userIds: number[]
}

export async function userFingerprints(userId: number) {
const rows: FingerprintCount[] = await sql`
select
"visitorId" as "fingerprint",
count(distinct "userId") as "userCount",
array_agg("userId") as "userIds"
from "Fingerprints"
where "visitorId" in (
select "visitorId" from "Fingerprints" where "userId" = ${userId}
)
group by 1 order by 2 desc limit 90;
`

for (const row of rows) {
row.userIds.sort()
}

return rows
}

export async function useFingerprintDeviceCount(userId: number) {
const rows = await sql`
SELECT
MAX("userCount") AS "maxUserCount"
FROM (
SELECT
"visitorId",
COUNT(DISTINCT "userId") AS "userCount"
FROM "Fingerprints"
WHERE "visitorId" IN (
SELECT "visitorId" FROM "Fingerprints" WHERE "userId" = ${userId}
)
GROUP BY "visitorId"
) t;
`
return rows[0].maxUserCount ?? 0
}

export async function useEmailDeliverable(wallet: string) {
const rows = await sql`
select "isEmailDeliverable" from "Users" where "walletAddress" = ${wallet}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@ import {
sql,
type ActionRow,
type TrackDetails,
type UserDetails,
queryUsers
type UserDetails
} from './actionLog'
import { logger } from 'hono/logger'
import { config } from './config'
import { HashId } from '@audius/sdk'
import { SolanaUtils, Utils } from '@audius/sdk-legacy'
import bn from 'bn.js'
import { useEmail, userFingerprints } from './identity'
import { useEmail } from './identity'
import { cors } from 'hono/cors'
import { getAudiusSdk } from './sdk'

Expand Down Expand Up @@ -359,11 +358,6 @@ app.get('/attestation/ui/user', async (c) => {

if (!signals) return c.text(`user id not found: ${idOrHandle}`, 404)

const fingerprints = await userFingerprints(user.id)
const fingerprintUsers = await queryUsers({
ids: fingerprints.flatMap((f) => f.userIds)
})

let lastDate = ''
function dateHeader(timestamp: Date) {
const d = timestamp?.toDateString()
Expand Down Expand Up @@ -489,16 +483,12 @@ app.get('/attestation/ui/user', async (c) => {
<table>
<thead>
<tr>
<th class='text-left'>Fingerprint Count</th>
<th class='text-left'>Deliverable Email</th>
<th class='text-left'>Override</th>
<th class='text-left'>Overall Score</th>
</tr>
</thead>
<tbody>
<td class={userScore.fingerprintCount > 0 ? 'text-red-500' : ''}>
{userScore.fingerprintCount}
</td>
<td class={!userScore.isEmailDeliverable ? 'text-red-500' : ''}>
{userScore.isEmailDeliverable.toString()}
</td>
Expand Down Expand Up @@ -560,36 +550,6 @@ app.get('/attestation/ui/user', async (c) => {
</tbody>
</table>

<h2 class='text-xl font-bold mt-4'>Fingerprints</h2>
<table>
<thead>
<tr>
<th class='text-left'>Fingerprint</th>
<th class='text-left'>User Count</th>
<th class='text-left'>Users</th>
</tr>
</thead>
<tbody>
{fingerprints.map((f) => (
<tr>
<td>{f.fingerprint}</td>
<td>{f.userCount}</td>
<td class='flex gap-2'>
{f.userIds
.slice(0, 20)
.map((id) => fingerprintUsers.find((u) => u.id == id))
.filter(Boolean)
.map((u) => (
<a href={`/attestation/ui/user?q=${u!.handle}`}>
{u!.handle}
</a>
))}
</td>
</tr>
))}
</tbody>
</table>

<h2 class='text-xl font-bold mt-4'>Actions</h2>
<table>
{rows.map((r) => (
Expand Down
1 change: 0 additions & 1 deletion packages/identity-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"@audius/sdk-legacy": "*",
"@audius/spl": "*",
"@certusone/wormhole-sdk": "0.1.1",
"@fingerprintjs/fingerprintjs-pro-server-api": "4.1.2",
"@improbable-eng/grpc-web-node-http-transport": "0.15.0",
"@opentelemetry/api": "1.3.0",
"@opentelemetry/instrumentation": "0.31.0",
Expand Down
Loading
Loading