Wykres commitów

128 Commity (main)

Autor SHA1 Wiadomość Data
Ryan Barrett ca8e70de6a
ATProto: switch polling getAuthorFeed to posts_with_replies
for #1011, #1018
2024-05-07 08:16:41 -07:00
Ryan Barrett c98d8fce00
switch ATProto polling from cursor to indexedAt
for #954
2024-05-05 07:31:12 -07:00
Ryan Barrett 6f0f53bdb8
ATProto post polling: stop using cursor
this was unintentionally walking backward and backfilling

for #954
2024-05-05 07:31:09 -07:00
Ryan Barrett a576e54796
ATProto polling: include limit even with cursor 2024-05-03 15:40:57 -07:00
Ryan Barrett 2bf526ab7c
refactor validating handles in ATProto and elsewhere
for https://github.com/snarfed/bridgy-fed/issues/982
2024-05-03 15:18:16 -07:00
Ryan Barrett b8e67829e3
ids.translate_handle: validate ATProto handles
https://atproto.com/specs/handle#handle-identifier-syntax

for https://github.com/snarfed/bridgy-fed/issues/982
2024-05-03 14:51:26 -07:00
Ryan Barrett 2f1ec8779f
ATProto: start using cursors in feed and notif polls
for #954
2024-05-03 12:54:59 -07:00
Ryan Barrett f4a0c3deaa
fix tests for 7b3fa6e82b 2024-05-02 20:22:35 -07:00
Ryan Barrett 7b3fa6e82b
ATProto: switch polling posts from getTimeline to getAuthorFeed
for #992
2024-05-02 20:11:21 -07:00
Ryan Barrett 1bcd675ecd
Bluesky _/~ => - characters in handles: docs, another test
for #982
2024-05-02 15:54:41 -07:00
Ryan Barrett ee9bb53745
ATProto: drop trailing slash from PDS URL
the ATProto DID spec says it shouldn't be there: https://atproto.com/specs/did#did-documents

> The serviceEndpoint field must contain an HTTPS URL of server. It should contain only the URI scheme (http or https), hostname, and optional port number, not any "userinfo", path prefix, or other components.

thanks for the nudge @mackuba!
2024-05-01 17:45:48 -07:00
Ryan Barrett 853b4be142
ATroto.send: for flag activities, send createReport to mod service
for snarfed/granary#596. background:
* https://docs.bsky.app/docs/advanced-guides/moderation#reporting
* https://github.com/bluesky-social/atproto/discussions/2350#discussioncomment-8847613
* https://github.com/snarfed/granary/issues/596
2024-04-26 13:59:04 -07:00
Ryan Barrett 4efb0d3e35
ATProto: tweak polling: every 5 min, 10 items each call 2024-04-23 16:58:30 -07:00
Ryan Barrett 10023d17fd
Protocol.enable_protocol: create copy user if necessary 2024-04-21 12:18:12 -07:00
Ryan Barrett 6b597c90c3
User.get_or_create: abstract propagate and create_for across protocols 2024-04-21 11:40:13 -07:00
Ryan Barrett 393605bde9
change ATProto.ABBREV to bsky
🤞, for #961
2024-04-17 06:54:16 -07:00
Ryan Barrett e913ad1f53
ATProto.convert: refetch subject for cid if we don't have it 2024-04-15 07:31:05 -07:00
Ryan Barrett 5b5ed4173a
fix tests for f840c8b784 2024-04-14 14:57:00 -07:00
Ryan Barrett 5ec2159546
user page: link to bridged Bluesky profile
for #825
2024-04-12 08:46:59 -07:00
Ryan Barrett 561c763fd4
atproto handle resolution: test, comments, minor refactoring
for snarfed/granary@d4bff45637
2024-04-10 16:34:50 -07:00
Ryan Barrett 2b7598cf94
update test_atproto for snarfed/granary@8dd5e470b2 2024-04-08 15:33:21 -07:00
Ryan Barrett 5a1dda151c
ATProto.create_for: better support for local testing 2024-03-24 08:59:54 -04:00
Ryan Barrett 048cd17ba5
bug fix for pds_for change in e86763f: don't use Object.as1 since that infinite loops 2024-03-14 21:16:09 -07:00
Ryan Barrett 878bbde328
atproto: handle bsky.app URLs in load, not fetch 2024-03-14 15:40:25 -07:00
Ryan Barrett 9b2bb9ef37
make ATProto.load([DID]) return the profile record by default
add did_doc kwarg to make it return the DID doc instead
2024-03-13 16:08:08 -07:00
Ryan Barrett 69e4b039e9
atproto: update authed_as, actor authz checks in poll_* 2024-03-13 15:41:03 -07:00
Ryan Barrett bad7052663
atproto: add delete support 2024-03-13 14:47:48 -07:00
Ryan Barrett d667c8ece4
atproto: add update support 2024-03-13 14:40:31 -07:00
Ryan Barrett be56539eb2
ATProto.send: explicitly ignore accepts, undos 2024-03-12 20:48:23 -07:00
Ryan Barrett aea4880e6f
ATProto.convert: fill in strongRef URIs with DIDs as well as CID
also error handling in ATProto.fetch for failed getRecord requests
2024-03-12 14:45:48 -07:00
Ryan Barrett cf4d105c3e
atproto: when creating new commits, fetch remote objects' CIDs if necessary
fixes sending likes, reposts, etc to ATProto
2024-03-12 11:12:34 -07:00
Ryan Barrett 51254f67de
atproto: tweak profile label, add bridgy-fed- 2024-03-11 15:31:31 -07:00
Ryan Barrett 95e46c5ebb
Revert "cache outbound HTTP request responses, locally to each inbound request"
This reverts commit 30debfc8fa.

seemed promising, but broke in production. Saw a lot of `IncompleteRead`s on both GETs and POSTs. Rolled back for now.

```
('Connection broken: IncompleteRead(9172 bytes read, -4586 more expected)', IncompleteRead(9172 bytes read, -4586 more expected))
...
File "oauth_dropins/webutil/util.py", line 1673, in call
  resp = getattr((session or requests), fn)(url, *args, **kwargs)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "requests_cache/session.py", line 102, in get
  return self.request('GET', url, params=params, **kwargs)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "requests_cache/session.py", line 158, in request
  return super().request(method, url, *args, headers=headers, **kwargs)  # type: ignore
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "requests/sessions.py", line 589, in request
  resp = self.send(prep, **send_kwargs)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "requests_cache/session.py", line 205, in send
  response = self._send_and_cache(request, actions, cached_response, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "requests_cache/session.py", line 233, in _send_and_cache
  self.cache.save_response(response, actions.cache_key, actions.expires)
File "requests_cache/backends/base.py", line 89, in save_response
  cached_response = CachedResponse.from_response(response, expires=expires)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "requests_cache/models/response.py", line 102, in from_response
  obj.raw = CachedHTTPResponse.from_response(response)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "requests_cache/models/raw_response.py", line 69, in from_response
  _ = response.content  # This property reads, decodes, and stores response content
      ^^^^^^^^^^^^^^^^
File "requests/models.py", line 899, in content
  self._content = b"".join(self.iter_content(CONTENT_CHUNK_SIZE)) or b""
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "requests/models.py", line 818, in generate
  raise ChunkedEncodingError(e)
```
2024-03-11 15:31:30 -07:00
Ryan Barrett 30debfc8fa
cache outbound HTTP request responses, locally to each inbound request
using requests-cache. pretty straightforward! for #588
2024-03-08 12:34:49 -08:00
Ryan Barrett 0101cf04ea
atproto: fetch records from AppView (api.bsky.app) instead of PDSes
fixes #688
2024-03-04 16:35:31 -08:00
Ryan Barrett 396c3a64f3
ATProto.fetch: support bsky.app URLs 2024-03-02 16:50:01 -08:00
Ryan Barrett c2b8db8687
atproto: self label profiles with 'bridged-from-[protocol]'
fixes #827
2024-03-01 13:31:59 -08:00
Ryan Barrett e765eaa710
update tests for snarfed/arroba@375bf19 2024-02-29 15:30:04 -08:00
Ryan Barrett f647afe70f
atproto: update labels test for snarfed/granary@3057631 2024-02-29 12:52:49 -08:00
Ryan Barrett d2865fdb86
add common.ENABLED_BRIDGES, check before conversion and /bridge-user 2024-02-28 12:07:06 -08:00
Ryan Barrett 56a3c0e34b
bluesky: opt out users who have disabled logged out view on bsky.app
ie "Discourage apps from showing my account to logged-out users" on https://bsky.app/moderation

fixes #828

https://docs.bsky.app/docs/advanced-guides/resolving-identities#for-backend-services
https://github.com/bluesky-social/atproto/blob/main/packages/api/docs/labels.md#label-behaviors
2024-02-23 10:33:34 -08:00
Ryan Barrett 855efa04f3
test_atproto: update tests for snarfed/granary@ac0bc429e5 2024-02-10 22:13:40 -08:00
Ryan Barrett 0cfa9a4ef8
update tests for snarfed/granary@e7778f3 2024-02-02 07:38:07 -08:00
Ryan Barrett a832a4edf6
follow UI: error on bridged accounts
also make ActivityPub.owns_handle return False for bridged accounts

fixes https://console.cloud.google.com/errors/detail/CLSnttKfy4v90wE;time=P30D?project=bridgy-federated
2024-01-15 07:57:03 -08:00
Ryan Barrett 07177e7d93
fix tests for lexrpc v0.5 2023-12-14 15:46:54 -08:00
Ryan Barrett 520b2fd3b0
User.ap_address() => handle_as(ActivityPub) 2023-11-29 21:06:55 -08:00
Ryan Barrett bee313fb67
drop User.atproto_did, switch to using copies 2023-11-15 19:08:06 -08:00
Ryan Barrett 4d095fa3d9
misc cleanup
* remove obsolete TODOs, commented out code
* remove obsolete circular imports of per-protocol modules
* minimize Object put in Protocol.load
* remove duplicated Protocol.load tests in test_activitypub
* re-enable rest of ActivityPubUtilsTest.test_postprocess_as2_idempotent
* drop default cls=Web in TestCase.make_user
2023-11-15 14:23:08 -08:00
Ryan Barrett d237d9611c
atproto: store extra `cid` field in Object.bsky, populate in record strongRefs 2023-11-14 19:24:37 -08:00
Ryan Barrett 95631396b7
atproto: fill in createdAt
for snarfed/granary@a0795b8c34
2023-11-14 15:24:51 -08:00