72 Commits

Author SHA1 Message Date
Matthieu Sieben
72eba67af1
Drop axios dependency (#3177)
* Minor adaptation of VerifyCidTransform implementation

* refactor: factorize content-encoding negotiation into new lib

* bsky: Use undici to stream blob

* fixup! bsky: Use undici to stream blob

* disable ssrf bsky protection in dev-env

* remove http requests to self to host "/img/"

* drop axios from tests

* fixes

* fix tests

* reviex changes

* properly handle HEAD requests

* handle client disconnection

* fix tests

* drop unrelated change

* tidy

* tidy

* tidy

* remove axios from dev-env

* remove axios from identity package

* use undici 6

* remove axios dependency from ozone

* tidy

* remove axios from PDS package

* avoid killing bsky-pds connections

* improve debugging data

* Better handle invalid CID

* tidy

* tidy

* refactor "allFulfilled" util in @atproto/common

* tidy

---------

Co-authored-by: devin ivy <devinivy@gmail.com>
2025-01-06 18:34:11 +01:00
Matthieu Sieben
3365bf8b22
install pnpm through corepack (#2864)
* install pnpm through corepack

* remove engine from services package.json
2025-01-02 22:04:43 -05:00
Matthieu Sieben
9d40ccbb69
Various OAuth related fixes (#2871)
* wip

* tidy

* tidy

* tidy

* Update packages/oauth/oauth-client/src/session-getter.ts

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

* fix combineSignals

* tidy

* tidy

* improve typing of atprotoScopeSchema

* stronger typings

* tidy

* ci

* Fix cors error

* downgrade ioredis dependency

* fix ioredis version

* tidy

---------

Co-authored-by: devin ivy <devinivy@gmail.com>
2024-10-18 20:23:33 +02:00
Matthieu Sieben
fabc8a9381
Update typescript to version 5.6.2 (#2863) 2024-10-11 14:05:53 +02:00
Matthieu Sieben
a07b21151f
PDS pipethrough optimizations (#2770)
* Micro optimization in request proxying

* Request NSID parsing optimization

* DID document parsing optimization

* remove un-necessary call to next()

* Allow HandlerPipeThrough to be used with streams

* Refactor pipethrough to work with streams

* Expose "unicastLookup" DNS lookup and "isUnicastIp" utilities

* Use a hardened, HTTP2 compatible, client to perform proxied requests

* changeset

* tidy

* Properly handle compressed streams

* tidy

* update @types/node

* refactor

* Improved error management

* Expose parseContentEncoding() util

* use pipeline from nodejs

* Avoid decoding in read-after-write (if possible)

* Various fixes

* Return Buffer instance from streamToBytes

* fixes

* Add omit() utility

* tidy

* lint

* typo

* Use Buffer instead of ArrayBuffer form pipe through handler result

* optimization

* tidy

* refactor

* increase highWaterMark

* remove un-necessary type check

* Use undici.request where more relevant

* Improve soc in fetch utils

* feedback

* fidy

* tidy

* test refactor

* safer fetch

* changeset

* expose and re-use extractUrl util

* small optimizations

* tidy

* optimization

* build branch

---------

Co-authored-by: dholms <dtholmgren@gmail.com>
2024-09-19 18:24:20 -05:00
Samuel Newman
70e2bff0e2
Use corepack to manage the pnpm version (#2680)
* use corepack, specify package manager, add nvmrc

* rm version in github action

---------

Co-authored-by: Samuel Newman <10959775+mozzius@users.noreply.github.com>
2024-08-26 22:07:35 +01:00
Matthieu Sieben
a8d6c11235
🚧 OAuth2 - Authorization Server (#2482)
* chore(deps): update zod

* chore(deps): update pino to match entryway version

* chore(tsconfig): remove truncation of types through noErrorTruncation

* add support for DPoP token type when logging

* fix(bsky): JSON.parse does not return value of type JSON

* fix(pds): add res property to ReqCtx

* fix(pds): properly type getPreferences return value

* chore(tsconfig): disable noFallthroughCasesInSwitch

* refactor(pds): move tracer config in own file

* feat(dev-env): start with "pnpm dev"

* feat(oauth): add oauth provider & client libs

* feat(pds): add oauth provider

* chore: changeset

* feat: various fixes and improvements

* chore(deps): update better-sqlite3 to version 10.0.0 for node 22 compatibility

* chore(deps): drop unused tslib

* fix(did): normalize service IDs before looking for duplicates

* fix(did): avoid minor type casting

* fix(did): improve argument validation

* fix(fetch): explicit use of negation around number comparison

* fix(oauth-provider): improve argument validation

* feat(did): add ATPROTO specific "isAtprotoDidWeb" method

* feat(rollup-plugin-bundle-manifest): add readme

* feat(lint): add eqeqeq rule (only allow == and != with null)

* fix(oauth-client-browser): typo in gitignore

* fix(oauth-provider): properly name error class file

* fix(oauth-provider): remove un-necessary useMemo

* fix(did-resolver): properly build did:web document url

* fix(did-resolver): remove unused types

* fix(fetch): remove unused utils

* fix(pds): remove unused script and dependency

* fix(oauth-provider): simplify isSubPath util

* fix(oauth-provider): add InvalidRedirectUriError static constructor

* fix(jwk): improve JWT validation to provide better error messages and distinguish between signed and unsigned tokens

* fix(pds): use "debug" log level for fetch method

* fix(pds): allow access tokens to contain an unknown "typ" claim (with the exception of "dpop+jwt")

* fix(jwk): remove un-necessary code

* fix(pds): account for whitespace chars when checking JSON

* fix(pds): remove oauth specific config

* fix(pds): run all write queries through transaction or executeWithRetry
fix(pds): remove outdated comments
fix(pds): rename used_refresh_token columns & added primary key
fix(pds): run cleanup task through backgroundQueue
fix(pds): add device.id foreign key to device_account
fix(pds): add comment on cleanup of used_refresh_token
fix(pds): add primary key on device_account

* fix(oauth-provider:time): simplify constantTime util

* fix(pds): rename disableSsrf into disableSsrfProtection

* fix(oauth-client-react-native): remove incomplete package

* refactor(pds): remove status & active from ActorAccount

* fix(pds): invalidate all oauth tokens on takedown

* fix(oauth-provider): enforce token expiry

* fix(pds): properly support deactivated accounts

* perf(pds:db): allow transaction function to be sync

* refactor(psq:account-manager): expose only query builders & data transformations utils from helpers

* fix(oauth-provider): imports from self

* fix(ci): add nested packages to build artifacts

* style(fetch): rename TODO into @TODO

* style(rollup-plugin-bundle-manifest): remove "TODO" from comment

* style(oauth-client): rename TODO into @TODO

* style(oauth-provider): rename TODO into @TODO

* refactor(oauth-client): remove "OAuth" prefix from types

* fix(oauth-client-browser): better type SessionListener

* style(oauth): rename TODO into @TODO

* fix(oauth-provider): enforce provider max session age

* fix(oauth-provider): check authentication parameters against all client metadata

* fix(api): tests

* fix(pds): remove .js from imports for tests

* fix(pds): change account status to match tests

* chore(deps): make all packages depend on the same zod version

* fix(common-web): remove un-necessary binding of Checkable to "zod"

* refactor(jwk): infer jwt schema from refinement definition

* fix(handle-resolver): allow resolution errors to propagate
docs(handle-resolver): better handling of DNS resolution errors
fix(handle-resolver): properly handle DOH responses

* fix(did): service endpoint arrays must contain "one or more" element

* refactor(pipe): simplify implementation

* fix(pds): add missing DB indexes

* feat(oauth): Resolve Authorization Server URI through Protected Resource Metadata

* style:(oauth-client): import order

* docs(oauth-provider:redirect-uri): add reference url

* feat(oauth): implement "OAuth Client ID Metadata Document" from draft-parecki-oauth-client-id-metadata-document-latest internet draft

* feat(oauth-client): backport changes from feat-oauth-client

* docs(simple-store): improve comments

* feat(lexicons): add iterable capabilities

* fix(pds): type error in dev mode

* feat(oauth-provider): improved error reporting

* fix(oauth-types): allow insecure issuer during tests

* fix(xrpc-server): allow upload of empty files

* fix: lint

* feat(fetch): keep request reference in errors
feat(fetch): utilities improvements

* fix(pds): allow more than one session token per user

* feat(ozone): improve env validation error messages

* fix(oauth-client): account for DPoP when checking for invalid_token errors

* fixup! feat(fetch): keep request reference in errors feat(fetch): utilities improvements

* fixup! feat(fetch): keep request reference in errors feat(fetch): utilities improvements

* fix(oauth): various validation fixes
feat(oauth): share client_id validation and parsing utilities between client & provider

* feat(dev-env): fix ozone port number

* fix(fetch-node): prevent fetch against invalid domain names

* fix(oauth-provider): add typings for psl dep

* feat(jwk): make type def compatible with TS 4.x

* fix(oauth): fixed various spec compliance
fix(oauth): return "sub" in refresh token response
fix(oauth): limit token validity for third party clients
fix(oauth): hide client image when not trusted

* fix(oauth): lint

* pds: switch changeset to patch, no breaking changes

* changeset and config for new oauth deps

---------

Co-authored-by: Devin Ivy <devinivy@gmail.com>
2024-06-18 15:11:37 -04:00
Matthieu Sieben
b8f8f06a12
fix(codegen): fix use of prettier.format for codegen (#2393)
* fix(codegen): fix use of prettier.format for codegen

* chore(deps): remove unused "babel" dependency

* chore(deps): update typescript to latest (5.4.4)
2024-04-09 10:07:47 -04:00
Matthieu Sieben
97482da17a
Update prettier & eslint (#2373)
* chore(deps): update linting tools

* style(lint): format code
2024-04-03 21:39:11 +02:00
Matthieu Sieben
f689bd51a2
Build system rework (#2169)
* refactor(crypto): remove circular dependency

* refactor(crypto): expose compress/decompress as part of the DidKeyPlugin interface

* fix(crypto): remove import from private file

* refactor: isolate tsconfig

* fix: remove unused bench file

* chore(repo): remove unused deps

* fix(ozone): properly list dependencies

* fix(services): do lint js files

* fix(services/pds): remove unused deps

* chore(pds): remove bench

* chore(dev-env): remove unused deps

* chore(api): remove bench

* remove unused babel.config.js files

* fix: remove .ts extension from import

* fix(pds): remove imports of src files

* fix(tsconfig): properly list all projects

* fix(dev-env): remove imports of src files

* fix(bsky): remove direct import to crypto src

* fix(api): remove imports to api internals

* chore(build): prevent bundling of built output

* chore(dev): add "dev" script to build in watch mode

* chore(deps): move ts-node dependency where it is actually used

* fix(deps): add dev-env as project dependency

* fix(xrpc-server): properly type kexicon

* fix(bsky): improve typings

* fix(pds): fully type formatRecordEmbedInternal return value

* fix(repo): remove imports from @ipld/car/api

* feat(dev-env): re-export BskyIngester

* fix: properly lint & type jest config & test files

* fix(ci): test after build

* fix(types): use NodeJS.Timeout instead of NodeJS.Timer

* fix(bsky): make types exportable

* fix(ozone): make types exportable

* fix(xrpc-server): make types exportable

* fix(xprc-server): make code compliant with "node" types

* fix(xrpc-server): avoid accessing properties of unknown

* chore(deps): update @types/node

* feat(tsconfig): narrow down available types depending on the package's target environment

* fix(pds): remove unused prop

* fix(bsync): Database's migrator not always initialized

* fix(dev-env): remove unreachable code

* fix(xrpc-server): remove unused import

* fix(xrpc-server): mark header property as abstract

* fix(pds): initialize LeakyTxPlugin's txOver property

* fix(bsky): initialize LeakyTxPlugin's txOver property

* fix(bsky): remove unused migrator from DatabaseCoordinator

* fix(bsky): Properly initialize LabelService's cache property

* fix(ozone): Database's migrator not initialized

* fix(ozone): initialize LeakyTxPlugin's txOver property

* fix(crypto): ignore unused variable error

* feat(tsconfig): use stricter rules

* feat(tsconfig): enable useDefineForClassFields

* feat(xrpc-server): add support for brotli incoming payload

* fix(xrpc-server): properly parse & process content-encoding

* fix(common:stream): always call cb in _transform

* tidy/fix tests and service entrypoints

* Revert "fix(xrpc-server): properly parse & process content-encoding"

This reverts commit 2b1c66e153820d3e128fc839fcc1834d52a66686.

* Revert "feat(xrpc-server): add support for brotli incoming payload"

This reverts commit e710c21e6118214ddf215b0515e68cb87299a952.

* remove special node env for tests (defaults to jest val of "test")

* kill mute sync handler on disconnect

* work around connect-es bug w/ request aborts

* style(crypto): rename imports from uint8arrays

* fix update package-lock

* fix lint

* force hbs files to be bundled as cjs

* fix: use concurrently instead of npm-run-all

npm-run-all seems not to be maintained anymore. Additionally, concurrently better forwards signals to child processes.

* remove concurrently alltogether

* ignore sqlite files in services/pds

* fix verify

* fix verify

* tidy, fix verify

* fix blob diversion test

* build rework changeset

---------

Co-authored-by: Devin Ivy <devinivy@gmail.com>
2024-03-18 17:10:58 -04:00
devin ivy
c2d0578b5a
Bsky appview sync service (#2031)
* init bsky-sync

* add bsync models and config

* rename bsky-sync to bsync

* protos and gen for bsync service

* start roughing-out bsync routes

* adjust bsync model, validation

* bsync auth, context, notify

* implement bsync scan mute ops, listen for mute op event

* setup basic bsync tests, misc fixes

* rename some files

* reorg bsync server routes

* reorg bsync server routes

* tests

* test input validation to addMuteOperation

* add db stats to bsync

* add bsync service

* redact bsync auth header from logs

* upgrade typescript to v5.3

* prettier on codegened bsync files
2024-01-09 15:40:35 -05:00
Matthieu Sieben
9cb81426dd
pre-compile handlebar templates at build time (#1833)
feat(pds): pre-compile handlebar templates at build time
2023-12-05 11:48:22 -05:00
bnewbold
498e4ace31
update Bluesky PBLLC to PBC (Public Benefit Corporation) (#1600) 2023-09-14 16:29:31 -07:00
Eric Bailey
a7c42cfe39
Clean up prettier/eslint scripts (#1514)
* add prettierignore, hoist script

* upgrade prettier

* bump prettier eslint deps

* format all files

* hoist prettier check

* remove unused scripts, hoist lint:fix

* remove npm-run-all, unused

* hoist lint

* remove lint scripts

* improve lint scripts

* remove prettierignores

* downgrade prettier deps to fix codgen

* reformat all files

* update makefile, format

* fix locklife

* final format

---------

Co-authored-by: dholms <dtholmgren@gmail.com>
2023-09-06 19:27:50 -05:00
Eric Bailey
b3eb3d76a0
Add Changesets (#1513)
* add changesets

* clean up scripts

* remove test changeset

* only build containers on push to production, clean up other workflows

* keep building from main

* remove production branch for now
2023-09-06 18:37:54 -05:00
Eric Bailey
90e8325e5f
pnpm setup (#1532)
* use pnpm

* fix dependency issues, replace yarn and lerna scripts

* remove the main/dist scripts

* update Dockerfiles

* use pnpm

* fix dependency issues, replace yarn and lerna scripts

* remove the main/dist scripts

* update Dockerfiles

* update bin script

* remove unused zod dep

* fix type errors in pds

* add types prop to packages

* remove unused, bump lock

* fix test running

* build before test

* fix pino types

* format

* pds depends on dev-env in test

* refer to src instead of built packages

* pds relies on bsky in test too

* remove yarn.lock

* add -r flag to root test

* test push to aws

* remove docker test

* add publishConfig to new package

* move services to top level dir

(cherry picked from commit f5012bec33435a4473e9960066807623334f3aff)

* update workflow paths

(cherry picked from commit 5c70f0176d381ca35d6be10cfa173e22373a5b5d)

* add main-to-dist script

* use script in all packages, remove old Dockerfiles

* remove old bsky service

* remove newline

* test container builds

* Revert "test container builds"

This reverts commit c228611f5e8e1624d4b124be4976c49590130f43.

* remove unused config

* test build containers

* pnpm in syntax

* bump dd-trace

* shamefully hoist

* even more shame

* hoist, externalize deps

* clean install for prod and smaller containers

* dont build branches

---------

Co-authored-by: dholms <dtholmgren@gmail.com>
2023-09-05 18:45:49 -05:00
Daniel Holmgren
891bf3bb7a
Application ratelimits (#1382)
* initial setup

* lexgen

* tidying things up

* add in some rate limiting

* testing rate limits

* small bugfix

* fix build

* increase rate limit

* more limits

* config

* optional rate limiter

* tweak headers

* ratelimit headers

* multiple rate limits

* tests & bugfixes

* test bypass

* slight refactor

* fail open

* fail open

* right most xff ip

* setup redis for ratelimiting

* redis test

* more tests

* use new dev-infra package

* adjust limits

* temporarily remove repo write limits

* codegen

* redis scratch var name

* cfg var host -> address
2023-08-21 16:10:04 -05:00
devin ivy
30b41029c1
Partitioning in bsky indexer (#1368)
* setup redis infra for appview indexer

* barebones bsky ingester

* add ioredis to bsky

* remove some indexer functionality from bsky api

* setup for bsky indexer

* tidy

* tidy, observe basic pipeline functioning

* process messages on bsky indexer pipeline, tidy tests and lifecycle

* trim partitions when moving cursor

* simplify config for partitions

* misc fixes for redis setup in bsky tests, add namespacing

* fix pds proxy tests

* remove cursor state from indexer partitions, simplify ingester state

* tidy

* utils for testing w/ multiple indexers, fix off-by-one xtrim

* test reingesting

* test indexer repartitioning

* add entrypoints for bsky ingester and indexer, fix db schema config, api entrypoint name, tidy

* setup and test bsky ingester backpressure, add config

* tidy

* add missing test file

* tidy redis calls, add redis sentinel config

* tidy/test some utils used in bsky pipeline

* tidy bsky pipeline tests, move helpers into dev-env

* fix pds crud test

* support redis host and password config

* better loggin/observability in ingester and indexer, make build

* add bsky ingester initial cursor config

* temporarily remove migrations from indexer/ingester

* allow ingester to batch

* packages/pg becomes packages/dev-infra with some cleanup (#1402)

* packages/dev-infra/

* Extract packages/dev-infra/_common.sh and use it

* Use period instead of source because of /bin/sh

* add docs for redis test script

* fix repartition test

* add logs to debug ci

* simplify repartitioning test, remove ci logs

---------

Co-authored-by: Jerry Chen <jerry@redelm.net>
2023-08-01 14:59:00 -04:00
Daniel Holmgren
ba870d3dbe
Run test DB for full monorepo tests (#1225)
* run with-test-db in monorepo test

* improve pg script

* tidy

* namespace bsky pg schemas

* differentiate schemas

* clean up script

* tweaking script
2023-06-28 15:12:37 -05:00
Gabe
4a91ae1f50
fix: macos install (#982)
fix: add updated node-gyp dep

This fixes better-sqlite3 from using an old version of node-gyp to build from source.
2023-05-08 17:23:34 -05:00
Daniel Holmgren
4447228e37
Use swc for jest (#722)
* use swc for jest

* fix up deps

* cleanup
2023-03-27 19:01:44 -05:00
Daniel Holmgren
0735d7acee
Speed up CI tests (#704)
* couple of ci changes

* change script name

* missed quotes

* bump cache version

* try without matrices

* try with matrix again

* one more shard
2023-03-23 14:30:41 -05:00
Daniel Holmgren
8dfcb4f996
Integrating PLC lib (#607)
* integrating new plc lib

* patching up did-resolver

* buffing up pds tests

* didResolver on ctx & plc in postgres

* bring dev env up to date

* re-add extension for linting

* tidy

* use current env vars

* pr feedback
2023-03-04 19:43:59 -06:00
Daniel Holmgren
9598a22ef5
Cleanup dependencies (#410)
* cleaning up & deleting unused deps

* oops we were using npm-run-all
2022-12-14 12:31:28 -06:00
devin ivy
d19fbe5473
Image processing interface (#378)
* Setup interface for image processing

* Implement getInfo() on SharpImageProcessor

* Reorganize pds image processing code

* Implement initial resize() on SharpImageProcessor

* Test sharp image processor, apply a couple fixes

* Tidy

* Implement initial pds image uri builder/signer/verifier

* Initial implementation of image processing server

* Update node types for node v18

* Add disk caching to pds image service

* Test pds image process caching, tidy

* Move pds image processor away from an interface

* Add sharp to pds build externals

* Move away from xrpc-server errors to http-errors for pds image server

* Tidy pds image exports

* Tidy
2022-12-07 09:44:34 -06:00
devin ivy
13aead171c
Support shallow builds and sourcemaps (#352)
* Enable all modules to be built shallowly, externalizing their deps

* Setup shallow builds to modify package.json main

* Hoist update-main-to-dist to separate call, fix lex-cli and plc shallow builds

* Generate sourcemaps during build

* Tidy

* Hoist new build deps up to root
2022-11-15 19:24:58 -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
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
Harlan T Wood
28f4d50ab4
Basic CI (#256) 2022-10-24 13:48:07 -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
7f2dfb8d50
Switch TypeORM to Kysely (#229)
* kysely interfaces

* migrated record plugins

* db types + notifications

* index record emthods on db

* Convert author feed to kysely

* rest of db index

* Convert home feed to kysely

* Remove references to sqlite3 package

* Convert liked by view to kysely

* create tables

* Convert notif count view to kysely

* move scrypt to own file

* Fix typo

* Convert notifs view to kysely

* Convert post thread to kysely

* Convert profile view to kysely

* accounts tests passing!

* Convert reposted by view to kysely

* Convert followers view to kysely

* Convert follows view to kysely

* Convert notifs last seen to kysely

* Tidy

* Re-enable social methods

* Minor tidy of author and home feed queries

* Tidying and minor fixes for pds view queries

* fix up crud, disabled PUTs for now

* Fix profile view, use nulls in table interfaces

* Fix pds follow/follower views, remove special db date logic

* Fix pds notification count view

* Fix pds feed views, reposted by join

* Remove typeorm from server

Co-authored-by: Devin Ivy <devinivy@gmail.com>
2022-10-11 13:39:11 -05:00
Daniel Holmgren
214e4a14bb
Plc tests & cleanup (#226)
* ensure we understand the key type a user is rotating to

* race condition test

* handle username/pds with or without https://

* fix a quick types issue

* adding logging

* fix better-sqlite3 build issues

* bring did-resolver up to date w plc

* fix pds tests for plc
2022-10-10 09:50:49 -05:00
Daniel Holmgren
b26eb75277
Logging (#209)
* messing around w pino

* rework locals & add pino-http

* subsystem logging off env vars

* remove auth tokens from logs

* lots of logging

* re-enable tests

* update enabled check

* fix subsystem logging

* pr fixups
2022-10-05 17:47:00 -05:00
dholms
5392501847 Updating some dev tools 2022-09-29 13:11:03 -05:00
Daniel Holmgren
55e6e54fcf
Did PLC (#181)
* validate the signatures
add the id to the did doc
pid from sha256 of oragin doc
added the tick to diffs extractor
added the key authorisation
add lots of types
add routes for calling the aic
refactor to jest based repo structure

* WIP

* migrate the tests

* more test fixes

* test.

* replace snake case with camel case

* moved to use isolated server for aic

* remove the aic test from the PDS

* clean up some changes outside the aic folder

* fix CaS for saving ticks

* rearange the folder

* missed  one

* cleaned up aic package.json

* broken build

* test passing

* prettier

* pid tests refactor

* fix eslint/prettier setup, add eslint-config-prettier

* misc linting and style tweaks in aic

* minor touchups to aic sign/verify

* tidy error-handling in aic

* tidy-up crypto init in aic

* add aic route for getting a did doc, update /tick routes

* knex -> typeorm

* refactor crypto

* error handling & dependencies

* switching op model & some other cleanup

* change db to use operations

* add cid references to ops & ensure no branching in DB tx

* cleaning up

* rotues

* working on client & tests

* document & oepration tests

* server tests

* cleanup

* remove lobby page & static

* formatting did documents

* aic/pch -> plc

* fixing up some doc semantics

* tooling/test server

* added recovery window

* tx mutex

* test on document formatting

* take validate op out of write tx

* error handling

* readme

* couple bug fixes

* quick readme edit

Co-authored-by: Aaron Goldman <aaron@aarons-mbp.lan>
Co-authored-by: Aaron D Goldman <aaron@blueskyweb.xyz>
Co-authored-by: Devin Ivy <devin@bigroomstudios.com>
2022-09-20 21:28:00 -05:00
dholms
efe3f622b7 run test server from within test suite 2022-09-12 12:35:24 -05:00
Paul Frazee
fd08591933
API package (#148)
* WIP API branch squash

 * Cleanup

 * Add missing pieces of API package's api

 * Add locale support to schemas package

 * Add test for view schemas

 * Add validation to the view api

 * Add createViewValidator() to schemas

 * Add client-side schema validation to record CRUD ops

 * Add writes to API client

 * WIP make progress on the PDS API (server and client)

 * Add .collection and .recordKey to AdxUri

 * Move name-resolution code to common

 * Remove leftover imports

 * WIP progress on API client code-structure

 * More progress on API module

 * WIP: Refactor server routes

 * Update schemas to use the canonical name & id for keying

 * Fix a bug in the schemas readme

 * Schemas readme improvements

 * Add @adxp/schemas

 * Fix typo in AdxUri regex that allowed invalid characters in names

 * Remove accidental commit

 * WIP: Add @adxp/api package

 * WIP: add .mkuser to dev-env repl

 * Allow colons in the adx uri name section

 * Update did:web devenv server to allow overwriting dids

 * Add AdxUri utility class

* Move api and schemas packages to the packages folder

* Update schemas package to use new repo structure

* Update API package to use new build system

* Fix some merge conflicts that werent caught earlier

* Switch from .incompatible to .compatible

* Dont send authStore over the wire

* Quick patch - refactor followup (#153)

* patching ws-relay build

* added @babel/core

* fixed package exports (#154)

* Quick auth lobby fix (#155)

* readme update

* fixed up api build

* cleaned up uri tests

* api types

* fix old esm imports & temporarily remove server tests

Co-authored-by: Daniel Holmgren <dtholmgren@gmail.com>
2022-07-14 18:36:23 -05:00
Daniel Holmgren
559fb42476
Quick patch - refactor followup (#153)
* patching ws-relay build

* added @babel/core
2022-07-11 07:25:03 -05:00
Daniel Holmgren
a11c1754a2
Tooling refactor + @ucans/core integration (#152)
* revamp crypto lib

* reworkign ucan capabilities

* fixing up auth lib

* migrating to monorepo

* got jest working with esm

* tests & fixed CID parsing

* common tests up to date

* ported did-sdk

* cli + did:web hanging fix

* ported server

* poted example app

* working on server build

* server build working

* integrating dev-env

* patched up frontend scripts

* patching up cli & dev env build script

* docs & readme

* fixing up package.jsons

* wiped out unneeded dev deps
2022-07-08 11:41:55 -05:00
Daniel Holmgren
85cea5844c
Dev Env (#143)
* split out did-network

* yarn.lock

* fix up network file

* add db to did:web & add timeout

* run did web server

* import/export keypairs

* fix padding issue in key compression

* accept didDoc creation on web server

* did stuff

* key manager + .env for dev-env

* cleanup

* point key manager at correct server
2022-06-23 16:23:41 -05:00
Paul Frazee
05a83af971 Merge did-sdk into dev 2022-06-16 10:39:13 -05:00
Daniel Holmgren
3d1894dd67
Crypto lib with public key compression (#139)
* split out crypto lib & add public key compress/decompress

* split out crypto lib & integrate into awake

* better semantics around aes keys
2022-06-16 09:09:07 -05:00
Paul Frazee
a1abf25805
Rename packages from @adx to @adxp (#137)
* Rename packages from @adx to @adxp

* @adxp/server@0.0.1

* @adxp/ws-relay@0.0.1

* @adxp/auth-lobby@0.0.1
2022-06-14 11:46:50 -05:00
Daniel Holmgren
4bb2d48cfe
Browser wallet (#134)
* port over ws-relay

* port awake

* port auth lobby

* on success fns

* checkpoint

* move from callbacks to promises

* revamp frontend

* fix bug in ws-relay

* cleaning up error handling, allow subsequent auth flows

* port over example app & fix errors

* refactor app auth code;

* auth app for unauthed device working

* cleaning up

* README

* cleanup logs

* added envs

* ucanReq -> appReq

* cleanup

* remove env vars from authstore

* redirect application auth flow

* fn name change
2022-06-13 18:29:07 -05:00
Daniel Holmgren
4eda6bbd27
Auth lib (#130)
* splitting out auth lib & updating ucan version

* checks

* builders & tests

* fix tests

* more builders

* add in schemas

* better comment

* update export

* package.json things
2022-06-06 23:18:55 -05:00
dholms
89b9cd6be1 add to monorepo packages 2022-06-06 16:52:57 -05:00
dholms
c495d551cb Require Node>=16 2022-05-10 09:54:59 -06:00
Paul Frazee
1410d981bf
Readme tweaks (#98)
* Readme tweaks

* typo

* update references to adx

Co-authored-by: dholms <dtholmgren@gmail.com>
2022-05-03 11:48:23 -05:00
dholms
74d534216a Small fixes 2022-05-02 18:56:35 -05:00
Daniel Holmgren
f23cf12dae
Change protocol name to ADX (#96)
* Name change to ADX

* readme updates

* use did:example

* quick readme edit

* typo
2022-05-02 17:33:08 -05:00