Skip to content

Commit

Permalink
pds: remove deprecated endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
bnewbold committed Mar 12, 2024
1 parent 447f36c commit dd1824a
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 90 deletions.
19 changes: 0 additions & 19 deletions pds/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,10 +316,6 @@ func (s *Server) handleComAtprotoSyncGetCheckout(ctx context.Context, did string
panic("not yet implemented")
}

func (s *Server) handleComAtprotoSyncGetCommitPath(ctx context.Context, did string, earliest string, latest string) (*comatprototypes.SyncGetCommitPath_Output, error) {
panic("not yet implemented")
}

func (s *Server) handleComAtprotoSyncGetHead(ctx context.Context, did string) (*comatprototypes.SyncGetHead_Output, error) {
user, err := s.lookupUserByDid(ctx, did)
if err != nil {
Expand Down Expand Up @@ -354,17 +350,6 @@ func (s *Server) handleComAtprotoSyncGetRepo(ctx context.Context, did string, si
return buf, nil
}

func (s *Server) handleComAtprotoAdminGetRecord(ctx context.Context, cid string, uri string) (*comatprototypes.AdminDefs_RecordViewDetail, error) {
panic("nyi")
}

func (s *Server) handleComAtprotoAdminGetRepo(ctx context.Context, did string) (*comatprototypes.AdminDefs_RepoViewDetail, error) {
panic("nyi")
}
func (s *Server) handleComAtprotoAdminSearchRepos(ctx context.Context, cursor string, limit int, q string, term string) (*comatprototypes.AdminSearchRepos_Output, error) {
panic("nyi")
}

func (s *Server) handleComAtprotoSyncGetBlocks(ctx context.Context, cids []string, did string) (io.Reader, error) {
panic("nyi")
}
Expand Down Expand Up @@ -466,10 +451,6 @@ func (s *Server) handleComAtprotoSyncGetLatestCommit(ctx context.Context, did st
panic("nyi")
}

func (s *Server) handleComAtprotoTempUpgradeRepoVersion(ctx context.Context, body *comatprototypes.TempUpgradeRepoVersion_Input) error {
panic("nyi")
}

func (s *Server) handleComAtprotoAdminGetAccountInfo(ctx context.Context, did string) (*comatprototypes.AdminDefs_AccountView, error) {
panic("nyi")
}
Expand Down
59 changes: 0 additions & 59 deletions pds/stubs.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ func (s *Server) RegisterHandlersComAtproto(e *echo.Echo) error {
e.POST("/xrpc/com.atproto.admin.enableAccountInvites", s.HandleComAtprotoAdminEnableAccountInvites)
e.GET("/xrpc/com.atproto.admin.getAccountInfo", s.HandleComAtprotoAdminGetAccountInfo)
e.GET("/xrpc/com.atproto.admin.getInviteCodes", s.HandleComAtprotoAdminGetInviteCodes)
e.GET("/xrpc/com.atproto.admin.getRecord", s.HandleComAtprotoAdminGetRecord)
e.GET("/xrpc/com.atproto.admin.getRepo", s.HandleComAtprotoAdminGetRepo)
e.GET("/xrpc/com.atproto.admin.getSubjectStatus", s.HandleComAtprotoAdminGetSubjectStatus)
e.GET("/xrpc/com.atproto.admin.searchRepos", s.HandleComAtprotoAdminSearchRepos)
e.POST("/xrpc/com.atproto.admin.sendEmail", s.HandleComAtprotoAdminSendEmail)
e.POST("/xrpc/com.atproto.admin.updateAccountEmail", s.HandleComAtprotoAdminUpdateAccountEmail)
e.POST("/xrpc/com.atproto.admin.updateAccountHandle", s.HandleComAtprotoAdminUpdateAccountHandle)
Expand Down Expand Up @@ -162,35 +159,6 @@ func (s *Server) HandleComAtprotoAdminGetInviteCodes(c echo.Context) error {
return c.JSON(200, out)
}

func (s *Server) HandleComAtprotoAdminGetRecord(c echo.Context) error {
ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleComAtprotoAdminGetRecord")
defer span.End()
cid := c.QueryParam("cid")
uri := c.QueryParam("uri")
var out *comatprototypes.AdminDefs_RecordViewDetail
var handleErr error
// func (s *Server) handleComAtprotoAdminGetRecord(ctx context.Context,cid string,uri string) (*comatprototypes.AdminDefs_RecordViewDetail, error)
out, handleErr = s.handleComAtprotoAdminGetRecord(ctx, cid, uri)
if handleErr != nil {
return handleErr
}
return c.JSON(200, out)
}

func (s *Server) HandleComAtprotoAdminGetRepo(c echo.Context) error {
ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleComAtprotoAdminGetRepo")
defer span.End()
did := c.QueryParam("did")
var out *comatprototypes.AdminDefs_RepoViewDetail
var handleErr error
// func (s *Server) handleComAtprotoAdminGetRepo(ctx context.Context,did string) (*comatprototypes.AdminDefs_RepoViewDetail, error)
out, handleErr = s.handleComAtprotoAdminGetRepo(ctx, did)
if handleErr != nil {
return handleErr
}
return c.JSON(200, out)
}

func (s *Server) HandleComAtprotoAdminGetSubjectStatus(c echo.Context) error {
ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleComAtprotoAdminGetSubjectStatus")
defer span.End()
Expand All @@ -207,33 +175,6 @@ func (s *Server) HandleComAtprotoAdminGetSubjectStatus(c echo.Context) error {
return c.JSON(200, out)
}

func (s *Server) HandleComAtprotoAdminSearchRepos(c echo.Context) error {
ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleComAtprotoAdminSearchRepos")
defer span.End()
cursor := c.QueryParam("cursor")

var limit int
if p := c.QueryParam("limit"); p != "" {
var err error
limit, err = strconv.Atoi(p)
if err != nil {
return err
}
} else {
limit = 50
}
q := c.QueryParam("q")
term := c.QueryParam("term")
var out *comatprototypes.AdminSearchRepos_Output
var handleErr error
// func (s *Server) handleComAtprotoAdminSearchRepos(ctx context.Context,cursor string,limit int,q string,term string) (*comatprototypes.AdminSearchRepos_Output, error)
out, handleErr = s.handleComAtprotoAdminSearchRepos(ctx, cursor, limit, q, term)
if handleErr != nil {
return handleErr
}
return c.JSON(200, out)
}

func (s *Server) HandleComAtprotoAdminSendEmail(c echo.Context) error {
ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleComAtprotoAdminSendEmail")
defer span.End()
Expand Down
12 changes: 0 additions & 12 deletions testing/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -399,18 +399,6 @@ func (u *TestUser) ChangeHandle(t *testing.T, nhandle string) {
}
}

func (u *TestUser) DoRebase(t *testing.T) {
t.Helper()

ctx := context.TODO()
err := atproto.RepoRebaseRepo(ctx, u.client, &atproto.RepoRebaseRepo_Input{
Repo: u.did,
})
if err != nil {
t.Fatal(err)
}
}

func TestPLC(t *testing.T) *plc.FakeDid {
// TODO: just do in memory...
tdir, err := os.MkdirTemp("", "plcserv")
Expand Down

0 comments on commit dd1824a

Please sign in to comment.