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
5 changes: 2 additions & 3 deletions .github/workflows/identity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -309,9 +309,8 @@ jobs:
# Mirror what CircleCI ran: `npx mocha` with no args (the
# docker-compose.test.yml `test-identity-service` entrypoint shifted "test"
# off and invoked `npx mocha`). Mocha's default `test/*.{js,cjs,mjs}` glob
# picks up only the `.js` test files; `test/index.ts` (which transitively
# imports the solana relay tree and requires populated solana env vars) is
# intentionally skipped, matching prior CI behavior.
# picks up only the `.js` test files; `test/index.ts` is intentionally
# skipped, matching prior CI behavior.
- name: Run tests
timeout-minutes: 20
working-directory: packages/identity-service
Expand Down
33 changes: 1 addition & 32 deletions packages/common/src/services/audius-backend/AudiusBackend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import {
PushNotificationSetting,
PushNotifications
} from '../../store'
import { getErrorMessage, uuid, Maybe, Nullable } from '../../utils'
import { getErrorMessage, Maybe, Nullable } from '../../utils'

import { MintName } from './solana'

Expand Down Expand Up @@ -86,8 +86,6 @@ export const AuthHeaders = Object.freeze({
Signature: 'Encoded-Data-Signature'
})

const unauthenticatedUuid = uuid()

export type TransactionReceipt = { blockHash: string; blockNumber: number }

type AudiusBackendSolanaConfig = Partial<{
Expand Down Expand Up @@ -151,34 +149,6 @@ export const audiusBackend = ({
return new PublicKey(address)
}

async function recordTrackListen({
userId,
trackId,
sdk
}: {
userId: ID
trackId: ID
sdk: AudiusSdkWithServices
}) {
try {
const { data, signature } = await signIdentityServiceRequest({ sdk })
await fetch(`${identityServiceUrl}/tracks/${trackId}/listen`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
[AuthHeaders.Message]: data,
[AuthHeaders.Signature]: signature
},
body: JSON.stringify({
userId: userId ?? unauthenticatedUuid,
solanaListen: true
})
})
} catch (err) {
console.error(getErrorMessage(err))
}
}

async function updateCreator({
metadata,
sdk
Expand Down Expand Up @@ -1211,7 +1181,6 @@ export const audiusBackend = ({
getSignature,
getWAudioBalance,
identityServiceUrl,
recordTrackListen,
registerDeviceToken,
reportNotificationCampaignPushOpen,
sendTokens,
Expand Down
11 changes: 0 additions & 11 deletions packages/identity-service/default-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,6 @@
"rateLimitingOtpLimit": 10,
"rateLimitingTwitterLimit": 5000,
"rateLimitingTikTokLimit": 5000,
"rateLimitingListensPerTrackPerHour": 10,
"rateLimitingListensPerIPTrackPerHour": 20,
"rateLimitingListensPerIPPerHour": 100000,
"rateLimitingListensPerTrackPerDay": 40,
"rateLimitingListensPerIPTrackPerDay": 60,
"rateLimitingListensPerIPPerDay": 100000,
"rateLimitingListensPerTrackPerWeek": 120,
"rateLimitingListensPerIPTrackPerWeek": 180,
"rateLimitingListensPerIPPerWeek": 100000,
"rateLimitingListensIPWhitelist": "(.*192.168.*|ffff:172.*)",
"endpointRateLimits": "{\"/user\":{\"post\":[{\"expiry\":60,\"max\":100}]},\"/users/update\":{\"post\":[{\"expiry\":60,\"max\":100}]},\"/user_playlist_favorites\":{\"post\":[{\"expiry\":60,\"max\":40}]},\"/recovery\":{\"post\":[{\"expiry\":60,\"max\":5},{\"expiry\":3600,\"max\":20}]},\"/email/welcome\":{\"post\":[{\"expiry\":60,\"max\":5},{\"expiry\":3600,\"max\":20}]},\"/social_handles\":{\"post\":[{\"expiry\":60,\"max\":40}]},\"/push_notifications/settings\":{\"post\":[{\"expiry\":60,\"max\":40}]},\"/push_notifications/device_token\":{\"post\":[{\"expiry\":60,\"max\":40}]},\"/push_notifications/device_token/deregister\":{\"post\":[{\"expiry\":60,\"max\":40}]},\"/push_notifications/browser/settings\":{\"post\":[{\"expiry\":60,\"max\":40}]},\"/push_notifications/browser/register\":{\"post\":[{\"expiry\":60,\"max\":40}]},\"/push_notifications/browser/deregister\":{\"post\":[{\"expiry\":60,\"max\":40}]},\"/userEvents\":{\"post\":[{\"expiry\":60,\"max\":100}]},\"/twitter\":{\"post\":[{\"expiry\":60,\"max\":40}]},\"/twitter/callback\":{\"post\":[{\"expiry\":60,\"max\":40}]},\"/twitter/associate\":{\"post\":[{\"expiry\":60,\"max\":40}]},\"/instagram\":{\"post\":[{\"expiry\":60,\"max\":40}]},\"/instagram/associate\":{\"post\":[{\"expiry\":60,\"max\":40}]},\"/notifications/settings\":{\"post\":[{\"expiry\":60,\"max\":40}]},\"/authentication\":{\"post\":[{\"expiry\":60,\"max\":40}],\"get\":[{\"expiry\":60,\"max\":40}]}}",
"minimumBalance": 10,
Expand All @@ -62,8 +53,6 @@
"scoreSecret": "score_secret",
"recaptchaServiceKey": "",
"hCaptchaSecret": "",
"solanaFeePayerWallets": "[]",
"solanaEndpoint": "https://api.mainnet-beta.solana.com",
"solanaEndpointListensProgram": "https://api.mainnet-beta.solana.com",
"stripeSecretKey": ""
}
158 changes: 0 additions & 158 deletions packages/identity-service/scripts/fundSolanaFeePayer.js

This file was deleted.

3 changes: 0 additions & 3 deletions packages/identity-service/scripts/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ export redisHost='localhost'
export redisPort='6379'
export dbUrl="postgres://postgres:postgres@localhost:$PG_PORT/audius_identity_service_test"
export logLevel='debug' #should be error
export solanaTrackListenCountAddress=''
export solanaAudiusEthRegistryAddress=''
export solanaValidSigner=''
export environment='test'

# Locally, the docker-compose files set up a database named audius_identity_service. For
Expand Down
Loading
Loading