go scratch code for atproto

updates for indigo SDK changes

+10 -23
+4 -4
cmd/astrolabe/handlers.go
··· 71 71 return echo.NewHTTPError(404, "failed to parse handle or DID") 72 72 } 73 73 74 - ident, err := srv.dir.Lookup(ctx, *atid) 74 + ident, err := srv.dir.Lookup(ctx, atid) 75 75 if err != nil { 76 76 // TODO: proper error page? 77 77 return err ··· 103 103 return echo.NewHTTPError(400, "failed to parse handle or DID") 104 104 } 105 105 106 - ident, err := srv.dir.Lookup(ctx, *atid) 106 + ident, err := srv.dir.Lookup(ctx, atid) 107 107 if err != nil { 108 108 // TODO: proper error page? 109 109 return err ··· 145 145 return echo.NewHTTPError(400, "failed to parse collection NSID") 146 146 } 147 147 148 - ident, err := srv.dir.Lookup(ctx, *atid) 148 + ident, err := srv.dir.Lookup(ctx, atid) 149 149 if err != nil { 150 150 // TODO: proper error page? 151 151 return err ··· 208 208 return echo.NewHTTPError(400, "failed to parse record key") 209 209 } 210 210 211 - ident, err := srv.dir.Lookup(ctx, *atid) 211 + ident, err := srv.dir.Lookup(ctx, atid) 212 212 if err != nil { 213 213 // TODO: proper error page? 214 214 return err
+1 -1
cmd/glot/lex_publish.go
··· 73 73 } 74 74 75 75 cdir := identity.DefaultDirectory() 76 - c, err := atclient.LoginWithPassword(ctx, cdir, *atid, pass, "", nil) 76 + c, err := atclient.LoginWithPassword(ctx, cdir, atid, pass, "", nil) 77 77 if err != nil { 78 78 return nil 79 79 }
+1 -1
cmd/glot/lex_unpublish.go
··· 52 52 } 53 53 54 54 cdir := identity.DefaultDirectory() 55 - c, err := atclient.LoginWithPassword(ctx, cdir, *atid, pass, "", nil) 55 + c, err := atclient.LoginWithPassword(ctx, cdir, atid, pass, "", nil) 56 56 if err != nil { 57 57 return nil 58 58 }
+4 -14
cmd/glot/lexlint/lint.go
··· 189 189 issues = append(issues, reciss...) 190 190 } 191 191 } 192 - if v.Message != nil { 193 - // TODO: v.Message.Schema must only have local references (same file), and should have at least one defined 194 - reciss := lintSchemaRecursive(nsid, lexicon.SchemaDef{Inner: v.Message.Schema}) 195 - if len(reciss) > 0 { 196 - issues = append(issues, reciss...) 197 - } 198 - } else { 199 - issues = append(issues, LintIssue{ 200 - NSID: nsid, 201 - LintLevel: "warn", 202 - LintName: "subscription-no-messages", 203 - LintDescription: "no subscription message types defined", 204 - Message: "no subscription message types defined", 205 - }) 192 + // TODO: v.Message.Schema must only have local references (same file), and should have at least one defined 193 + reciss := lintSchemaRecursive(nsid, lexicon.SchemaDef{Inner: v.Message.Schema}) 194 + if len(reciss) > 0 { 195 + issues = append(issues, reciss...) 206 196 } 207 197 // TODO: at least one message type 208 198 case lexicon.SchemaPermissionSet:
-3
cmd/lexidex/schema.go
··· 191 191 return nil, err 192 192 } 193 193 def.Fields = qp 194 - if s.Message == nil { 195 - return nil, fmt.Errorf("empty subscription message type") 196 - } 197 194 u := s.Message.Schema 198 195 def.Closed = u.Closed != nil && *u.Closed 199 196 def.Options = u.Refs