1610 Commits

Author SHA1 Message Date
Matthieu Sieben
3ebcd4e616
Remove "exp" from DPoP proofs (#2727)
* Remove "exp" from DPoP proofs

* Remove validity check on exp dpop proof claim
2024-08-20 11:21:11 +02:00
devin ivy
f9a2f3ed17
Fix calls from pds containing content-type but no body (#2725)
* pds: fix calls from pds containing content-type but no body

* build
2024-08-18 19:32:35 -04:00
github-actions[bot]
40c145fb16
Version packages (#2712)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-08-18 16:34:50 -04:00
Daniel Holmgren
50c0ec176c
Service auth method binding (lxm) (#2663)
* add scopes to service auth impl

* add error to getServiceAuth

* send scoped tokens from pds

* clean up privileged access scopes & allow simple service auth tokens for app passwords

* integration into ozone

* fix up bsky tests

* cleanup xrpc-server tests

* fix up tests & types

* one more test

* fix read after write tests

* fix mod auth test

* convert scopes to be a single method name

* add scope check callback for auth verifier

* pds changes only

* fix feed generation tests

* use scope for ozone service profile

* dont verify scopes on pds yet

* tidy

* tidy imports

* changeset

* add tests

* tidy

* another changeset

* scope -> lxm

* tidy

* clean up scope references

* update nonce size

* pr feedback

* trim trailing slash

* nonce -> jti

* fix xrpc-server test

* allow service auth on uploadBlob

* fix build error

* changeset

* build, tidy

* xrpc-server: update lxm claim check error

* appview: temporarily permit labeler service calls to omit lxm claim

* xrpc-server: fix test

* changeset

* fix merged tests

---------

Co-authored-by: Devin Ivy <devinivy@gmail.com>
2024-08-18 15:46:07 -04:00
Hailey
533774ce4a
exact matches always show profile regardless of block status (#2653)
* exact matches always show profile regardless of block status

* return false if no actor

* tweaks

* update the duplicate test...
2024-08-16 15:42:55 -04:00
Hailey
17e2d29474
Don't return profiles in reference lists/starter packs that have a block relationship with the owner (#2713)
* proposal

* clean

* create seed

* type

* update tests

* change pairs

* `maybeGetBlocksForReferenceList`

* add logic for filtering inside of `getStarterPack()`

* move seeding to test

* nits

* tweak getting blocks

* oops
2024-08-16 11:54:13 -04:00
Foysal Ahamed
bc131ebb01
Add index on createdAt column on moderation_event table (#2716)
*  Add index on createdAt column on moderation_event table

* Execute dropIndex

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

* tidy

---------

Co-authored-by: devin ivy <devinivy@gmail.com>
2024-08-15 18:25:31 -04:00
Matthieu Sieben
04112783db
Provide a ponyfill for CustomEvent (#2710)
* fix(oauth-client): provide a ponyfill for CustomEvent (required by NodeJS < 20)
2024-08-15 18:44:34 +02:00
Matthieu Sieben
acbacbbd56
Ensure presence of DPoP related response headers (#2711)
* fix(pds): ensure presence of DPoP related response headers

* Expose the request context for AuthVerifier and StreamAuthVerifier as distinct types

* Properly type ReqCtx for stream auth
2024-08-13 16:41:36 +02:00
github-actions[bot]
cf988a5b4c
Version packages (#2709)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-08-12 22:55:19 -04:00
devin ivy
22af354a5d
Export AtpAgentOptions type from @atproto/api (#2708)
Export AtpAgentOptions type to better support extending AtpAgent.
2024-08-12 18:00:56 -04:00
Devin Ivy
24fa446a2b tidy 2024-08-12 16:26:42 -04:00
github-actions[bot]
3940733bf0
Version packages (#2706)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-08-12 16:11:19 -04:00
Matthieu Sieben
2bdf75d7a6
Update changeset to better reflect changes (#2707)
* Update changeset to better reflect changes

* Remove un-necessary packages from changeset

* codegen

* expose lexicons instead of schemas

* export a copy of the internal lexicon

* typo

* fix minor typos in changesets

---------

Co-authored-by: Devin Ivy <devinivy@gmail.com>
2024-08-12 15:58:58 -04:00
Matthieu Sieben
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>
2024-08-12 19:57:21 +02:00
Daniel Holmgren
8092715ea0
Allow aud of pds or entryway for service auth tokens on pds (#2694)
allow aud of pds or entryway for service auth tokens on pds
2024-08-06 19:02:00 -05:00
github-actions[bot]
1072ba6fd9
Version packages (#2692)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-08-06 14:52:19 -05:00
github-actions[bot]
66484a1041
Version packages (#2689)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-08-05 18:10:44 -05:00
Daniel Holmgren
269cbc87c5
PDS - inspect bearer tokens (#2688)
* inspect bearer tokens to determine if theyre access tokens or service auth tokens

* changeset
2024-08-05 18:05:47 -05:00
github-actions[bot]
b0a5fa3d70
Version packages (#2685)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-08-05 15:21:57 -05:00
Daniel Holmgren
dc471da267
Service auth method binding - PDS (#2668)
* pds changes only

* use scope for ozone service profile

* dont verify scopes on pds yet

* tidy

* tidy imports

* changeset

* add tests

* another changeset

* scope -> lxm

* tidy

* update nonce size

* pr feedback

* trim trailing slash

* nonce -> jti

* fix xrpc-server test

* allow service auth on uploadBlob
2024-08-05 15:09:50 -05:00
bnewbold
a95a902bba
minor typos in descriptions and comments (#2681)
* lex: typos in descriptions

* more minor typos

* codegen lexicon typos

* more comment typos
2024-08-05 09:49:25 -07:00
github-actions[bot]
c007e930ed
Version packages (#2677)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-08-02 17:17:16 -05:00
Hailey
c7de8f07c5
Tweak some wording in oauth-client-browser readme (#2678) 2024-08-02 13:43:50 -07:00
Eric Bailey
951a3df15a
Remove detach (#2676)
* Remove detach record

* Changeset
2024-08-02 15:19:29 -05:00
Hailey
1419114394
Run test env with updateSnapshot (#2674)
* nit

* pds too
2024-08-01 13:41:59 -07:00
github-actions[bot]
c5c5203a6e
Version packages (#2671)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-07-31 16:51:04 -05:00
Eric Bailey
ff803fd2bf
[Detach] Lexicons (#2664)
* Define new detach record

* Codegen

* Add limit of 1k

* Codegen

* add protos

* tweak schema

* Add changeset

---------

Co-authored-by: dholms <dtholmgren@gmail.com>
2024-07-31 16:45:20 -05:00
github-actions[bot]
a5fbd8c0fa
Version packages (#2670)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-07-31 16:37:45 -05:00
Eric Bailey
77c5306d2a
Update muted words handling, add attributes (#2276)
* Sketch proposal for additional muted words attributes

* Rename ttl -> expiresAt

* Feedback

* Codegen

* Refactor muted words methods to integrate new attributes

* Add changeset

* Use datetime format

* Simplify migration

* Fix tests

* Format

* Re-integrate tests

* Let the lock cook

* Fix comments

* Integrate mute words enhancements (#2643)

* Check expiry when comparing mute words

* Check actors when comparing

* Tweak lex, condegen

* Integrate new prop

* Remove fake timers

(cherry picked from commit ad31910560ce938e3ff64944d46355c64635ebf8)

* Update changeset

* Prevent deleting value when updating

* Include missing test

* Add default

* Apply default 'all' value to existing mute words to satisfy Typescript

* Fix types in tests

* Fix types on new tests
2024-07-31 16:22:19 -05:00
Eric Bailey
803d1b6c0d
Use default Statsig export (#2660) 2024-07-24 17:54:16 -05:00
github-actions[bot]
5f2bcd1807
Version packages (#2652)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-07-23 21:36:34 +01:00
Daniel Holmgren
76c91f8325
Priority notification setting (#2648)
* priority notif settings in bsync

* lint

* priority notifications lexicon update

* codegen

* putNotificationPreferences -> putPreferences

* bsync: reorg around notif "priority", fix build, add validation & tests

* bsync: notif channel fix, tests fix

* bsky: update protos for priority notifs

* api prerelease

* add priority notif to actor state table

* dataplane impl

* appview: wire-up notif priority params

* appview: notif priority tests

* dataplane impl

* fix up tests

* tidy

* add changeset

---------

Co-authored-by: Samuel Newman <10959775+mozzius@users.noreply.github.com>
Co-authored-by: Devin Ivy <devinivy@gmail.com>
2024-07-23 12:33:01 -07:00
Yoshihiro Sugi
12dcdb668c
fix(api): hasMutedWord for facets with multiple features (#2570)
* Fix hasMutedWord for facets with multiple features

* Add changeset
2024-07-19 14:07:03 -07:00
devin ivy
7e88f6fc1d
Appview: enable insight into full thread context (#2651)
* appview: enable mods viewing full thread context

* build
2024-07-18 19:06:26 -07:00
Foysal Ahamed
5d2fdeba47
🐛 include takedowns in post thread for admins (#2642) 2024-07-16 23:56:30 -07:00
Matthieu Sieben
f7bf2dd24d
Minor OAuth client fixes (#2640)
feat(oauth-client-browser): add staging and prod env config
2024-07-15 23:37:25 -07:00
github-actions[bot]
f2f8de63b3
Version packages (#2639)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-07-12 17:34:56 +02:00
Matthieu Sieben
acc9093d28
OAuth: 2FA (#2633)
* chore(ci): update setup-node & checkout actions to v4

* refactor(oauth): rename internal types to avoid conflicting types
fix(oauth): support building from parcel
feat(oauth): add runtime lock support to prevent concurrent session updates
feat(oauth): improve metadata validation
fix(oauth): allow use of handle as login hint
fix: proper parsing of authorization header
feat(oauth): add email 2fa support
feat(oauth): adapt auth UI to match app UI

* fix(oauth): improve parsing of digest algo

* fix(oauth-provider): dead code cleanup

* fix(oauth-provider): avoid inconsistent use of "id" prop in InputCheckbox

* style(oauth-provider): use if/else instead of switch

* feat(oauth-provider): stronger validation of customization data

Invalid oauth customization would cause the server to crash at startup.

* docs(oauth-client): explain why the abortRequest method is not mandatory

* fix(oauth-client): cancel fetch response body when not used

* docs: typo

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

* feat(oauth-provider:metadata): add client_id_metadata_document_supported metadata

* fix(oauth-provider): require the content-type to be set on client metadata response

* feat(common): add obfuscation utilities
fix(pds): show user did in logs
fix(ozone): show user did in logs

* tidy

* fix(simple-store): avoid leaking context when calling hooks

* fix: use patch level changeset

* chore(oauth-types): add changeset regarding client_id_metadata_document_supported

* chore: add changeset for bsky & ozone

* unify loggerMiddleware instantiation

* tidy

---------

Co-authored-by: devin ivy <devinivy@gmail.com>
2024-07-12 17:28:03 +02:00
github-actions[bot]
b899505293
Version packages (#2622)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-07-12 11:22:11 -04:00
Eric Bailey
8f22a2521c
Update data source for getSuggestedFollowsByActor (#2630)
* Update lex

* Codegen

* Set up StatSig

* Integrate new implementation into old endpoint

* Add todo to crypto module

* Format

* Specify StatSig env

* Downgrade pnpm to match CI, bump lock

* Catch StatSig errors

* Use sep env

* Reset lockfile

* Re-add new dep using correct pnpm version

* tidy

* Integrate into AppContext and lifecycle

* Use camelCase

* Switcheroo

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

* Init prior to server listen start

* Move test env check up to server config

* Add logger and log

* Better comment

---------

Co-authored-by: devin ivy <devinivy@gmail.com>
2024-07-11 17:14:54 -04:00
Daniel Holmgren
2f40203fb4
Add in-memory did cache to Ozone backend (#2635)
* add ozone in-memory did cache

* changeset
2024-07-10 16:21:30 -05:00
Hailey
7761a463b2
Filter out reference lists from getLists (#2629)
* filter out reference lists

* appview: use a rule to exclude reference lists from getLists

---------

Co-authored-by: Devin Ivy <devinivy@gmail.com>
2024-07-08 22:25:12 -04:00
bnewbold
aab465deb7
lexicons: add missing ozone Tag event type to unions (#2632)
* lex: add missing tag events to unions

* make codegen
2024-07-08 18:54:27 -07:00
Foysal Ahamed
34c1b9bd7e
Add ozone proxy for getLikes and getRepostedBy (#2624)
*  Add getLikes proxy through ozone

*  Add getRepostedBy proxy

* 🧹 Cleanup

---------

Co-authored-by: Devin Ivy <devinivy@gmail.com>
2024-07-03 19:02:11 -04:00
Foysal Ahamed
7083c49cc3
Add proxy for user typeahead through ozone (#2612) 2024-07-03 23:21:38 +02:00
Hailey
ed58101790
Add starter packs to post hydration (#2613)
* add hydration state

* add view to post

* oops. `graph.defs` not `starterpack.defs`

* add tests, update snapshots

* update record lexicon

* codegen

* add changeset

---------

Co-authored-by: Devin Ivy <devinivy@gmail.com>
2024-07-02 17:52:28 -04:00
Eric Bailey
e54518f69b
Social proof blocks (#2603)
* Add bidirectional blocks state

* Filter out edge blocks from knownFollowers

* Add tests

* Destructure map

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

* Cleanup

* Consolidate known followers tests

* Clean up seed, nice naming, update tests

* Add mixed test

* Add mergeNestedMaps, add tests

* Appease linting gods

* Clarify naming

* minor tidy

---------

Co-authored-by: devin ivy <devinivy@gmail.com>
2024-07-02 17:48:14 -04:00
devin ivy
f05539db4c
Appview: apply hosting status in getRecord (#2620)
appview: apply hosting status in getRecord
2024-07-02 17:43:21 -04:00
Yoshihiro Sugi
0529bec991
Add labelersPref to getPreferences union return types (#2554)
* Add missing getPreferences union types

* Add changeset
2024-07-02 09:40:52 -07:00