Skip to content

Commit

Permalink
Generic PDS proxy (#2425)
Browse files Browse the repository at this point in the history
* add proxy handler & remove old routes

* fwd content-type header

* use baseurl instead of path

* handle global ratelimits in catchall

* fix build

* base defaultService off req.originalUrl

* error handling around res.arrayBuffer()

* check & format url before doing auth verification
  • Loading branch information
dholms authored May 9, 2024
1 parent 7cdcd58 commit c37b0e4
Show file tree
Hide file tree
Showing 63 changed files with 266 additions and 940 deletions.
17 changes: 0 additions & 17 deletions packages/pds/src/api/app/bsky/actor/getSuggestions.ts

This file was deleted.

6 changes: 0 additions & 6 deletions packages/pds/src/api/app/bsky/actor/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,11 @@ import AppContext from '../../../../context'
import getPreferences from './getPreferences'
import getProfile from './getProfile'
import getProfiles from './getProfiles'
import getSuggestions from './getSuggestions'
import putPreferences from './putPreferences'
import searchActors from './searchActors'
import searchActorsTypeahead from './searchActorsTypeahead'

export default function (server: Server, ctx: AppContext) {
getPreferences(server, ctx)
getProfile(server, ctx)
getProfiles(server, ctx)
getSuggestions(server, ctx)
putPreferences(server, ctx)
searchActors(server, ctx)
searchActorsTypeahead(server, ctx)
}
15 changes: 0 additions & 15 deletions packages/pds/src/api/app/bsky/actor/searchActors.ts

This file was deleted.

15 changes: 0 additions & 15 deletions packages/pds/src/api/app/bsky/actor/searchActorsTypeahead.ts

This file was deleted.

15 changes: 0 additions & 15 deletions packages/pds/src/api/app/bsky/feed/getActorFeeds.ts

This file was deleted.

4 changes: 1 addition & 3 deletions packages/pds/src/api/app/bsky/feed/getFeed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ export default function (server: Server, ctx: AppContext) {
{ feed: params.feed },
await ctx.appviewAuthHeaders(requester),
)
return pipethrough(ctx, req, requester, feed.view.did, {
reqHeadersToForward: ['x-bsky-topics'],
})
return pipethrough(ctx, req, requester, feed.view.did)
},
})
}
15 changes: 0 additions & 15 deletions packages/pds/src/api/app/bsky/feed/getFeedGenerator.ts

This file was deleted.

15 changes: 0 additions & 15 deletions packages/pds/src/api/app/bsky/feed/getFeedGenerators.ts

This file was deleted.

15 changes: 0 additions & 15 deletions packages/pds/src/api/app/bsky/feed/getLikes.ts

This file was deleted.

15 changes: 0 additions & 15 deletions packages/pds/src/api/app/bsky/feed/getListFeed.ts

This file was deleted.

15 changes: 0 additions & 15 deletions packages/pds/src/api/app/bsky/feed/getPosts.ts

This file was deleted.

15 changes: 0 additions & 15 deletions packages/pds/src/api/app/bsky/feed/getRepostedBy.ts

This file was deleted.

15 changes: 0 additions & 15 deletions packages/pds/src/api/app/bsky/feed/getSuggestedFeeds.ts

This file was deleted.

20 changes: 0 additions & 20 deletions packages/pds/src/api/app/bsky/feed/index.ts
Original file line number Diff line number Diff line change
@@ -1,35 +1,15 @@
import { Server } from '../../../../lexicon'
import AppContext from '../../../../context'
import getActorFeeds from './getActorFeeds'
import getActorLikes from './getActorLikes'
import getAuthorFeed from './getAuthorFeed'
import getFeed from './getFeed'
import getFeedGenerator from './getFeedGenerator'
import getFeedGenerators from './getFeedGenerators'
import getLikes from './getLikes'
import getListFeed from './getListFeed'
import getPosts from './getPosts'
import getPostThread from './getPostThread'
import getRepostedBy from './getRepostedBy'
import getSuggestedFeeds from './getSuggestedFeeds'
import getTimeline from './getTimeline'
import searchPosts from './searchPosts'
import sendInteractions from './sendInteractions'

export default function (server: Server, ctx: AppContext) {
getActorFeeds(server, ctx)
getActorLikes(server, ctx)
getAuthorFeed(server, ctx)
getFeed(server, ctx)
getFeedGenerator(server, ctx)
getFeedGenerators(server, ctx)
getLikes(server, ctx)
getListFeed(server, ctx)
getPosts(server, ctx)
getPostThread(server, ctx)
getRepostedBy(server, ctx)
getSuggestedFeeds(server, ctx)
getTimeline(server, ctx)
searchPosts(server, ctx)
sendInteractions(server, ctx)
}
15 changes: 0 additions & 15 deletions packages/pds/src/api/app/bsky/feed/searchPosts.ts

This file was deleted.

13 changes: 0 additions & 13 deletions packages/pds/src/api/app/bsky/feed/sendInteractions.ts

This file was deleted.

15 changes: 0 additions & 15 deletions packages/pds/src/api/app/bsky/graph/getBlocks.ts

This file was deleted.

15 changes: 0 additions & 15 deletions packages/pds/src/api/app/bsky/graph/getFollowers.ts

This file was deleted.

15 changes: 0 additions & 15 deletions packages/pds/src/api/app/bsky/graph/getFollows.ts

This file was deleted.

15 changes: 0 additions & 15 deletions packages/pds/src/api/app/bsky/graph/getList.ts

This file was deleted.

15 changes: 0 additions & 15 deletions packages/pds/src/api/app/bsky/graph/getListBlocks.ts

This file was deleted.

15 changes: 0 additions & 15 deletions packages/pds/src/api/app/bsky/graph/getListMutes.ts

This file was deleted.

15 changes: 0 additions & 15 deletions packages/pds/src/api/app/bsky/graph/getLists.ts

This file was deleted.

Loading

0 comments on commit c37b0e4

Please sign in to comment.