modify-pds
8 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
9af7a2d122 |
Password based agent implementation (#4443)
* Password based agent implementation * tidy * tidy * wip * tidy * wip * tidy * wip * tests * tidy * websocket * tidy * tidy * tidy * tidy * tidy * tidy * tidy * tidy * changeset * codegen * tidy * tidy * tidy * tidy * tests * tidy * tidy * tests * tidy * tidy * tidy * wip * tidy * memoize * tidy * tests * tidy * files reorg * Ensure that default values match constraints * wip * use vitest to test lex * Add readme * fix lint * add vitest workspace config * vitest config * vitest-cfg * tests * ignore coverage * tidy |
||
|
|
261968fd65 |
New TS SDK (#4366)
* lex * packaging * moke packaging * revert test changes * do not build temp * tidy * automatically build the list of `@atproto/lex/com` lexicons * fix build * Remove "com" export * ridy * remove manifest option * tidy * rename * tidy * tidy * tidy * tests * add procedure params * stricter tests * tidy * Improve ui8 parsing * tidy * tidy * code split * code split * fix reserved keywords conflict * exclude packages/lex/src/tests/lexicons from lint * reserved keywords * safe identifier * fix build * move lib.js to src/lib.ts * Move tests dir * fix ci ? * increast lint size * Remove `Record` type alias for recordsz * fix package json exports * Add support for unsafe characters in defs and nsids * tidy * token tests * tidy * name consistency * remove unused `unknownKeys` params option * Fix "moving" keys in `DictSchema` (remove `IntersectionSchema`) * REview comments * adapt shebang in `env` * Make sure union object have their $type property set in typings * fix * Improve typing of `UnknownTypedObject` * lex improvements * code reorg * split lex-builder * tidy * improve packaging * rename lex-validation to lex-schema * lex client * rename prettifier option * add lex-client as dependency to "lex" * Export client as part of main export * re-write example app using @atproto/lex * add missing lex-client to tsconfig * tidy * add "null" schema type * Smaller bundle code footprint * tidy * correctness * tidy * code split and improved testing * tidy * refactor common utils * test all implementations * improve tests * tidy * fix build * fixes * tidy * lint * tests * tidy * fix oauth-example app * tidy * tidy * tests * tidy * Return an actual `Uint8Array` from `fromBase64Node` * tidy * adapt xrpc-server * Rename `Lex` to `LexValue` * minor fixes * fix tests * fix tests * tidy * fix * tidy * tidy * fix `verifyCidForBytes` implementation * fix imports * tidy * split lex-json in own package * make base64 tests faster * Add interop tests * lint error * tidy * tidy * changeset * implement lex-resolver and lex-install * remove need for polyfill * readme * more details * tidy * allow specifying `service` header on a per request basis * tidy * tidy * tidy * tidy * add custom/intersection validation schemas * tidy * tidy * remive un-necessary util * improve typing of `l.object` output * make "name" required in lexicon method errors * fix tests * tidy * tidy * add error responses * update readme * add "like " to example * readme improvements * tidy * error management improvements * Improve error results * tidy * refactor * tidy * lock * Update binary to `ts-lex` * tidy * tidy * Add "Overview" section * fix build * update bin * readme-improvements * paul's feedback * Update packages/lex/lex/README.md Co-authored-by: Daniel Holmgren <dtholmgren@gmail.com> * Update packages/lex/lex/README.md Co-authored-by: Daniel Holmgren <dtholmgren@gmail.com> * Update packages/lex/lex/README.md Co-authored-by: Daniel Holmgren <dtholmgren@gmail.com> * Update packages/lex/lex/README.md Co-authored-by: Daniel Holmgren <dtholmgren@gmail.com> * Update packages/lex/lex/README.md Co-authored-by: Daniel Holmgren <dtholmgren@gmail.com> * Initial plan * Address README review comments Co-authored-by: matthieusieben <813661+matthieusieben@users.noreply.github.com> * Clarify client configuration inheritance behavior Co-authored-by: matthieusieben <813661+matthieusieben@users.noreply.github.com> * Document allowLegacyBlobs default and compatibility implications (#15) * Initial plan * Add notes about default setting and compatibility for allowLegacyBlobs Co-authored-by: matthieusieben <813661+matthieusieben@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: matthieusieben <813661+matthieusieben@users.noreply.github.com> * Rename `Json` to `JsonValue` in lex-json package (#14) * Initial plan * Rename Json to JsonValue in lex-json package and dependent packages Co-authored-by: matthieusieben <813661+matthieusieben@users.noreply.github.com> * Remove import alias for JsonValue in ipld.ts Co-authored-by: matthieusieben <813661+matthieusieben@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: matthieusieben <813661+matthieusieben@users.noreply.github.com> * Update packages/lex/lex/README.md Co-authored-by: Paul Frazee <pfrazee@gmail.com> * Update packages/lex/lex/README.md Co-authored-by: Paul Frazee <pfrazee@gmail.com> * Update packages/lex/lex/README.md Co-authored-by: Paul Frazee <pfrazee@gmail.com> * Update packages/lex/lex/README.md Co-authored-by: Paul Frazee <pfrazee@gmail.com> * Update packages/lex/lex/README.md Co-authored-by: Paul Frazee <pfrazee@gmail.com> * Update packages/lex/lex/README.md Co-authored-by: Paul Frazee <pfrazee@gmail.com> * review comments and fixes * Add lex to the dockerfiles * tidy * changeset for lex packages * tidy * Tidy * tidy * tidy * Move language parsing to lex-data * tidy * doctoc * error handling * tidy * tidy * tidy * fix --------- Co-authored-by: Daniel Holmgren <dtholmgren@gmail.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: matthieusieben <813661+matthieusieben@users.noreply.github.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> |
||
|
|
fefe70126d |
oauth-client-expo (#4220)
* `oauth-client-expo` * working on android * remove example app * tidy * tidy * Do not install full expo * tidy * chngeset * chngeset * load expo * tidy |
||
|
|
850e39843c |
OAuth: Reset password & Sign-up (#2945)
* Adds "password reset" during OAuth flows * Adds "Sign up" during OAuth flows * Adds support for multiple languages in the OAuth flow * Adds "fr" translation for the OAuth flow Co-authored-by: devin ivy <devinivy@gmail.com> Co-authored-by: Eric Bailey <git@esb.lol> |
||
|
|
c53d943c8b |
Improve codegen typings (#2999)
* Make codegen types stricter * Add .js file extension to import statements in generated code * Fixes a bug that would clear interests prefs when updating hidden posts prefs. |
||
|
|
b934b396b1 |
Client SDK rework (#2483)
* feat(api): support creation of oauth based AtpAgents * oauth: misc fixes for confidential clients * fix(xprc): remove ReadableStream.from polyfill * OAuth docs tweaks (#2679) * OAuth: clarification about client_name being shown * OAuth: re-write handle resolution privacy concern * avoid relying on ReadableStream.from in xrpc-server tests * feat(oauth-types): expose "ALLOW_UNSECURE_ORIGINS" constant * feat(handle-resolver): expose "AtprotoIdentityDidMethods" type * fix(oauth-client): ensure that the oauth metadata document contains client_id_metadata_document_supported * fix(oauth-types): prevent unknown query string in loopback client id * fix(identity-resolver): check that handle is in did doc's "alsoKnownAs" * feat(oauth-client:oauth-resolver): allow logging in using either the PDS URL or Entryway URL * fix(oauth-client): return better error in case of invalid "oauth-protected-resource" status code * refactor(did): group atproto specific checks in own * feat(api): relax typing of "appLabelers" and "labelers" AtpClient properties * allow any did as labeller (for tests mainly) * fix(api): allow to override "atproto-proxy" on a per-request basis * remove release candidate versions from changelog * update changeset for api and xrpc packages * Add missing changeset * revert RC versions * Proper wording in OAUTH.md api example * remove "pre" changeset file * xrpc: restore original behavior of setHEader and unsetHeader * docs: add comment for XrpcClient 's constructor arg * feat(api): expose "schemas" publicly * feat(api): allow customizing the whatwg fetch function of the AtpAgent * docs(api): improve migration docs * docs: change reference to BskyAgent to AtpAgent * docs: mention the breaking change regarding setSessionPersistHandler * fix(api): better split AtpClient concerns * fix(xrpc): remove unused import * refactor(api): simplify class hierarchu by removeing AtpClient * fix(api): mock proper method for facets detection * restore ability to restore session asynchronously * feat(api): allow instantiating Agent with same argument as super class * docs(api): properly extend Agent class * style(xrpc): var name * docs(api): remove "async" to header getter --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: bnewbold <bnewbold@robocracy.org> Co-authored-by: Hailey <me@haileyok.com> |
||
|
|
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> |
||
|
|
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> |