1610 Commits

Author SHA1 Message Date
Paul Frazee
70c525f806
Rework post text slices to be objects (#311) 2022-11-04 18:26:33 -05:00
Paul Frazee
6053031d0d
A couple improvements to the markdown generator to improve clarity (#310) 2022-11-04 15:28:00 -05:00
devin ivy
d6a189f59a
Healthchecks for PDS and PLC (#309)
* Add plc healthcheck, unify plc server interface with pds

* Add pds healthcheck

* Make plc test util file consistent with other packages

* Fix types in dev-env

* Type fixes

* Tidy

* Rename healthcheck routes, place pds's under /xrpc
2022-11-04 16:26:56 -04:00
Paul Frazee
e61127111a
Split lexicons into more specific namespaces (#306)
* Segment lexicons into more specific namespaces and tighten up some naming conventions

* Update API to use new lexicons

* Update pds and dev-env to use new lexicons
2022-11-04 12:59:00 -05:00
Daniel Holmgren
7ee821312a
Handle package (#305)
* handle package

* forgot a couple things

* few more fixes
2022-11-03 17:55:33 -05:00
Daniel Holmgren
7fdbb4dbb5
Username -> Handle (#303)
* schemas

* db

* atproto xrpc

* bsky xrpc

* got er done
2022-11-03 11:35:21 -05:00
devin ivy
f87cb10d36
Add subject to password reset email (#302) 2022-11-02 20:35:56 -04:00
devin ivy
a42d98b280
Allow duplicate block by the same did w/ sql blockstore (#301)
* Allow duplicate block by the same did w/ sql blockstore

* Typo
2022-11-02 20:27:41 -04:00
Paul Frazee
9289ce15c6
Rename getHomeFeed to getTimeline to improve some semantic clarity (#300) 2022-11-02 16:52:25 -05:00
Paul Frazee
c986066e4c
Update XRPC procedures to use request body by default (#297)
* Update lexicons of xprc procedures to avoid using query params when possible

* Update code generated by lex-cli to reduce param counts

* Update all API usages to new signatures

* Fix readme

* Remove params from postNotifiactionsSeen lexicon schema
2022-11-02 16:37:58 -05:00
Daniel Holmgren
4229ac91a5
Remove badges (#291)
* rm schemas

* rm db

* wrapping up

Co-authored-by: Devin Ivy <devinivy@gmail.com>
2022-11-02 10:30:23 -05:00
Paul Frazee
794d87e8c1
Lexicon tokens (#292)
* Add token schema types to lexicon package

* Add token-schema support to lex-cli package generation of markdown, client code, and server code

* Add two token lexicons: actorUser and actorScene

* Remove dead code
2022-11-02 10:20:04 -05:00
devin ivy
55a07dd4d5
Fix app.bsky.post entity def to be more intuitive (#294) 2022-11-02 10:19:07 -05:00
joev
aa604b0a98
Fix typo in PLC docs to point to correct key for recovery (#293)
* Fix typo to point to correct key for recovery.

* Fix another typo: 'recovery' -> 'recover'.
2022-11-02 10:33:59 -04:00
devin ivy
a6c5737bb5
Session management in PDS client (#288)
* Move codegen api client into its own directory

* Implement session-aware client for pds

* Test pds session client, fixes

* Use pds lexicon rather than api types where possible

* Tidy
2022-11-02 09:55:51 -04:00
Daniel Holmgren
2fb128d94f
Account declaration & invites (#289)
* schemas

* database & buffing up schemas

* declaration on createAccount, + fixing up test client

* fix up dev-env

* schema comments

* nsid for declaration actorType

* declaration description

* oops token schema slipped in

* declaration -> declarationCid

* missed a couple of db things
2022-11-01 18:15:52 -05:00
Daniel Holmgren
6bf748bc70
Remove outdated cli (#290)
remove cli
2022-11-01 15:00:22 -05:00
Daniel Holmgren
8982e13ff4
Username validation (#282)
* user-did table

* yay fixed it

* resolve available domains from db

* serverDid + tests

* check for invalid domains

* username validation

* woopsied on merge

* fix migration

* lower indexes

* even moar validation
2022-11-01 14:30:37 -05:00
devin ivy
51dd5665a1
Session refresh token for PDS (#286)
* Update lexicons for auth refresh token

* Implement pds refresh tokens

* Test pds auth sessions

* Fix dev-env

* Tidy

* Ignore invalid revoked and expired tokens during deleteSession
2022-10-31 20:41:51 -04:00
Daniel Holmgren
94a4f7ec41
simple repo benchmarks (#246)
* simple repo benchmarks

* cleanup
2022-10-31 12:13:38 -05:00
devin ivy
817d238880
Fix PDS readme link (#285)
Fix pds link
2022-10-30 10:34:05 -04:00
Daniel Holmgren
ac8569496c
Name Resolution (#278)
* user-did table

* yay fixed it

* resolve available domains from db

* serverDid + tests

* check for invalid domains

* mv available domain check to constructor

* oops reverse check
2022-10-28 18:06:17 -05:00
devin ivy
b3966734de
Misc HTTP error fixes (#280)
* Avoid double decode for plc params

* Unify http error handling across plc and pds, avoid reflected xss, details of unexpected errors

* Check headersSent in plc error handler

* Test pds error handler in isolation
2022-10-28 17:40:36 -04:00
devin ivy
4cc8f02575
Add public url config to pds for setting did service endpoint (#281)
* Add public url config to pds for setting did service endpoint

* Test pds public URL
2022-10-28 17:13:10 -04:00
Daniel Holmgren
9879f673ad
SQL Blockstore (#276)
* setting up sql-blockstore

* drop table migration

* unblock sqlite tx

* correct binary types

* lol woops

* block encoding utilities

* no longer store raw record in record table

* fix dev-env

* pr feedback

* tx check
2022-10-27 13:26:17 -05:00
Daniel Holmgren
21ff052da9
Dont reexport CID type (#277)
dont reexport cid
2022-10-26 23:13:50 -05:00
Daniel Holmgren
9b66f20abb
Kms keypair (#270)
* scaffold package

* kms working!

* interface

* normlize for low s

* no der encoding in crypto

* comments

* rm kms tests

* pr feedback
2022-10-26 23:13:36 -05:00
Daniel Holmgren
e9428647c5
Fix a couple build issues (#275)
* build issues

* hoist better-sqlite3 to monorepo root
2022-10-26 16:32:10 -05:00
Paul Frazee
07a2bd117d
Improve codegen quality (shorter typenames) (#269)
* Improve lex-cli's generated code (specifically type names)

* Update to use the shorter typenames

Co-authored-by: Devin Ivy <devinivy@gmail.com>
2022-10-26 13:45:42 -05:00
devin ivy
4a65804db5
Miscellaneous dep and build fixes (#272)
Misc dep and build fixes
2022-10-26 14:19:14 -04:00
Daniel Holmgren
e507d95dd2
Secp256k1 support (#267)
* add secp256k1 to crypto module

* integrate into plc

* use secp256k1 key in test

* use jwt alg consts & fix did resolution
2022-10-25 16:35:27 -05:00
Daniel Holmgren
d6fd69d3a3
Rename pds (#266)
* clean up old todos

* some more cleanup

* rename server -> pds
2022-10-25 15:52:46 -05:00
Daniel Holmgren
7e6019fbda
PDS cleanup (#265)
* clean up old todos

* some more cleanup

* remove server did for now
2022-10-25 15:36:44 -05:00
Daniel Holmgren
29463093c1
Recovery key (#263)
* clean up old todos

* recovery key in server cfg & allow user provided key

* tests & rename

* testing did creation

* recoveryKey in dev-env

* require recovery key
2022-10-25 15:25:44 -05:00
devin ivy
e3c4efd7d9
PDS transactions (#245)
* Run getProfile in transaction, setup/test transaction helpers

* Test tidy

* Transactionalize invite code usage in acct creation, add transaction assertions

* Transactionalize account creation

* crud txns

* test txns for account

* cleanup

* lock table

* fixed up crud operations

* fixed updateProfile route

* test data races

* cleanup

* Transactional invite code use, username/email creation (#253)

* Remove table lock for invite code use, surface username race

* Add and use db constraint for unique account username/email

* Update packages/server/src/db/index.ts

Co-authored-by: devin ivy <devinivy@gmail.com>

* Update packages/server/src/db/records/badgeAccept.ts

Co-authored-by: devin ivy <devinivy@gmail.com>

* Update packages/server/src/db/util.ts

Co-authored-by: devin ivy <devinivy@gmail.com>

* pr fixups

* remove old todos

* test for updateProfile races

* logging on repo update errors

* give feedback on misuse of forUpdate

Co-authored-by: dholms <dtholmgren@gmail.com>
2022-10-24 15:59:40 -05:00
Daniel Holmgren
a8368d148d
Linting (#262)
* move eslint ignore to eslintrc

* dont verify codgen stuff

* require node 18
2022-10-24 14:48:43 -05:00
devin ivy
26b554fee2
Setup PDS server with migrations (#254)
* Setup PDS with kysely migrations

* Nix KyselyWithDialect from PLC, found it didn't work as intended in PDS

* Fix down migration in PDS

* Fix update profile on postgres

* Support postgres and migrations in PDS bin

* Lint
2022-10-24 15:27:30 -04:00
zhuowei
3d2ea06bb5
server: fix startup by adding better-sqlite3 to externals, create tables (#257)
* server: fix startup by adding better-sqlite3 to externals, create tables

* Lint

Co-authored-by: devin ivy <devinivy@gmail.com>
2022-10-24 15:17:08 -04:00
devin ivy
000507e491
Setup PLC server with postgres and migrations (#249)
* Setup PLC with postgres

* Setup PLC with kysely migrations

* Add note to PLC migrations file
2022-10-21 09:47:18 -04:00
Daniel Holmgren
960a0fce1e
Immutable repo structure (#247)
* immutable repo

* wrap mutable repo around immutable

* fixing up repo & structure

* added back in safeCommit

* fix up server

* return rebase cid on commit callback

* getReocrd on structure + a bit of cleanup

* pr cleanup
2022-10-20 11:11:51 -05:00
dholms
287fc40f48 Fix typo 2022-10-18 16:14:34 -05:00
Paul Frazee
feca3622c1
Rename ADX -> ATP (#244)
* Rename ADX to ATP

* Remove old docs (now in atproto website repo)

* Update readme

* Update README.md

Co-authored-by: devin ivy <devinivy@gmail.com>

* A couple of @ -> AT

Co-authored-by: devin ivy <devinivy@gmail.com>
2022-10-18 12:21:59 -05:00
Daniel Holmgren
fd18da2cb5
Schema keyed hint (#243)
* update schemas for keyed

* codegen dict

* codgen record ids

* determine key type from schema

* allow non-tid keys

* rm tids from batch write schema

* use schema ids record in db layouts

* standardize on rkey

* doc update

* crud test

* repo tests for custom rkeys
2022-10-18 11:14:47 -05:00
devin ivy
0820013316
Unify pagination interface across all methods (#242)
* Update lexicons for cursor convention, fix minor cid usage in interface

* Liked by cursor pagination, temp fix for other tests

* Home and author feed cursor pagination

* Paginate crud list w/ cursor, minor adjustments to lex and xrpc

* Paginate notifications view w/ cursor

* Paginate reposts view w/ cursor

* Paginate follow views w/ cursor

* Paginate user search view w/ cursor

* Fix notification tests

* Make repoListRecords order desc by default for consistency

* Paginate badge memebers view w/ cursor
2022-10-17 18:19:37 -04:00
Daniel Holmgren
60a537a6e4
MIT license (#241)
mit license errything
2022-10-17 13:20:06 -05:00
Daniel Holmgren
83691da3f6
Repo metadata (#240)
* repo metadata

* tests & write meta to car file
2022-10-17 13:11:09 -05:00
Daniel Holmgren
3679719571
Badging utilities (#237)
* record type for accepted badge

* getBadgeMembers view

* updateProfile procedure

* better return type on updateProfile & gen client

* add badges to getProfile view

* testing & bug fixes

* tests for updating profile & linking badges

* errors

* badgeOffer record type

* getProfile view ensures badges are both offered & accepted

* getBadgeMembers test

* PR feedback

* cid check
2022-10-17 11:18:08 -05:00
devin ivy
e314974d1b
User search (#238)
* Add initial schemas for getUsersSearch and getUsersTypeahead

* Stub-out pds user search/typeahead, add pg indexes to support it

* Implement and test user typeahead method for postgres

* Implement user typeahead for sqlite

* Tidy

* Get user search view working, except pagination

* Get pagination working on pds user search w/ postgres

* Bail on jest snapshots for the conditional pg/sqlite search results

* Refactor user search queries out of user search method

* Apply user search helpers to typeahead

* Tidy user search implementation

* Test bad search input for sqlite

* Fix loading of pg_trgm extension to be friendly with the test suite

* Fix typo

* Query consistency

* All server tests can reference app

* Handle bad user search cursors
2022-10-14 16:16:32 -04:00
Paul Frazee
90b3792d90
Finalize lexicon reference behaviors, adding lex: URI references (#236)
* Update lexicon doc format to support .defs field and .descriptions within method bodies

* Add correct  resolution to lexicon, including to lex: URIs

* Update lexicons and generated code to use new  resolution
2022-10-13 14:08:09 -05:00
Daniel Holmgren
7a9d773e7e
Postbuild typecheck (#235)
* typecheck postbuild

* rm space

Co-authored-by: devin ivy <devinivy@gmail.com>

Co-authored-by: devin ivy <devinivy@gmail.com>
2022-10-12 20:03:43 -05:00