Skip to content

Commit

Permalink
Update atproto
Browse files Browse the repository at this point in the history
  • Loading branch information
mnogu committed Aug 12, 2024
1 parent 5b578a1 commit 219b875
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion atproto
Submodule atproto updated 71 files
+1 −1 Makefile
+1 −1 lexicons/app/bsky/feed/defs.json
+1 −1 lexicons/com/atproto/label/defs.json
+16 −1 lexicons/com/atproto/server/getServiceAuth.json
+6 −0 packages/api/CHANGELOG.md
+1 −1 packages/api/docs/moderation.md
+1 −1 packages/api/package.json
+1 −1 packages/api/src/bsky-agent.ts
+20 −2 packages/api/src/client/lexicons.ts
+1 −1 packages/api/src/client/types/app/bsky/feed/defs.ts
+1 −1 packages/api/src/client/types/com/atproto/label/defs.ts
+11 −0 packages/api/src/client/types/com/atproto/server/getServiceAuth.ts
+1 −1 packages/api/src/moderation/decision.ts
+8 −0 packages/bsky/CHANGELOG.md
+1 −1 packages/bsky/package.json
+6 −1 packages/bsky/src/auth-verifier.ts
+0 −10 packages/bsky/src/context.ts
+1 −1 packages/bsky/src/hydration/hydrator.ts
+20 −2 packages/bsky/src/lexicon/lexicons.ts
+1 −1 packages/bsky/src/lexicon/types/app/bsky/feed/defs.ts
+1 −1 packages/bsky/src/lexicon/types/com/atproto/label/defs.ts
+5 −0 packages/bsky/src/lexicon/types/com/atproto/server/getServiceAuth.ts
+5 −0 packages/bsky/tests/admin/admin-auth.test.ts
+1 −0 packages/bsky/tests/auth.test.ts
+20 −0 packages/dev-env/CHANGELOG.md
+1 −1 packages/dev-env/package.json
+1 −0 packages/dev-env/src/network.ts
+1 −0 packages/dev-env/src/ozone-service-profile.ts
+1 −0 packages/dev-env/src/ozone.ts
+6 −0 packages/lex-cli/CHANGELOG.md
+1 −1 packages/lex-cli/package.json
+1 −1 packages/oauth/oauth-client/src/session-getter.ts
+1 −1 packages/oauth/oauth-provider/src/token/token-store.ts
+8 −0 packages/ozone/CHANGELOG.md
+1 −1 packages/ozone/package.json
+6 −1 packages/ozone/src/auth-verifier.ts
+2 −0 packages/ozone/src/context.ts
+1 −0 packages/ozone/src/daemon/context.ts
+20 −2 packages/ozone/src/lexicon/lexicons.ts
+1 −1 packages/ozone/src/lexicon/types/app/bsky/feed/defs.ts
+1 −1 packages/ozone/src/lexicon/types/com/atproto/label/defs.ts
+5 −0 packages/ozone/src/lexicon/types/com/atproto/server/getServiceAuth.ts
+16 −0 packages/pds/CHANGELOG.md
+1 −1 packages/pds/package.json
+9 −2 packages/pds/src/api/app/bsky/feed/getFeed.ts
+2 −1 packages/pds/src/api/app/bsky/feed/getPostThread.ts
+6 −1 packages/pds/src/api/app/bsky/notification/registerPush.ts
+0 −90 packages/pds/src/api/chat/index.ts
+3 −1 packages/pds/src/api/com/atproto/admin/sendEmail.ts
+1 −1 packages/pds/src/api/com/atproto/repo/uploadBlob.ts
+2 −2 packages/pds/src/api/com/atproto/server/createAccount.ts
+20 −1 packages/pds/src/api/com/atproto/server/getServiceAuth.ts
+0 −2 packages/pds/src/api/index.ts
+45 −11 packages/pds/src/auth-verifier.ts
+4 −3 packages/pds/src/context.ts
+20 −2 packages/pds/src/lexicon/lexicons.ts
+1 −1 packages/pds/src/lexicon/types/app/bsky/feed/defs.ts
+1 −1 packages/pds/src/lexicon/types/com/atproto/label/defs.ts
+5 −0 packages/pds/src/lexicon/types/com/atproto/server/getServiceAuth.ts
+49 −15 packages/pds/src/pipethrough.ts
+8 −4 packages/pds/src/read-after-write/viewer.ts
+4 −0 packages/pds/tests/moderator-auth.test.ts
+1 −0 packages/pds/tests/proxied/notif.test.ts
+1 −0 packages/pds/tests/proxied/proxy-header.test.ts
+6 −0 packages/xrpc-server/CHANGELOG.md
+1 −1 packages/xrpc-server/package.json
+32 −17 packages/xrpc-server/src/auth.ts
+1 −1 packages/xrpc-server/src/index.ts
+1 −1 packages/xrpc-server/src/server.ts
+5 −0 packages/xrpc-server/src/util.ts
+87 −0 packages/xrpc-server/tests/auth.test.ts
2 changes: 1 addition & 1 deletion chitose/app/bsky/feed/defs.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class Interaction(chitose.Object):
"""
:param feed_context: Context on a feed item that was orginally supplied by the feed generator on getFeedSkeleton.
:param feed_context: Context on a feed item that was originally supplied by the feed generator on getFeedSkeleton.
"""

def __init__(self, item: typing.Optional[str]=None, event: typing.Optional[typing.Literal['app.bsky.feed.defs#requestLess', 'app.bsky.feed.defs#requestMore', 'app.bsky.feed.defs#clickthroughItem', 'app.bsky.feed.defs#clickthroughAuthor', 'app.bsky.feed.defs#clickthroughReposter', 'app.bsky.feed.defs#clickthroughEmbed', 'app.bsky.feed.defs#interactionSeen', 'app.bsky.feed.defs#interactionLike', 'app.bsky.feed.defs#interactionRepost', 'app.bsky.feed.defs#interactionReply', 'app.bsky.feed.defs#interactionQuote', 'app.bsky.feed.defs#interactionShare']]=None, feed_context: typing.Optional[str]=None) -> None:
Expand Down
2 changes: 1 addition & 1 deletion chitose/com/atproto/label/defs.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def to_dict(self) -> dict[str, typing.Any]:
return {'val': self.val, '$type': 'com.atproto.label.defs#selfLabel'}

class LabelValueDefinition(chitose.Object):
"""Declares a label value and its expected interpertations and behaviors.
"""Declares a label value and its expected interpretations and behaviors.
:param identifier: The value of the label being defined. Must only include lowercase ascii and the '-' character ([a-z-]+).
Expand Down
8 changes: 6 additions & 2 deletions chitose/com/atproto/server/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,17 @@ def reserve_signing_key(self, did: typing.Optional[str]=None) -> bytes:
"""
return _reserve_signing_key(self.call, did)

def get_service_auth(self, aud: str) -> bytes:
def get_service_auth(self, aud: str, exp: typing.Optional[int]=None, lxm: typing.Optional[str]=None) -> bytes:
"""Get a signed token on behalf of the requesting DID for the requested service.
:param aud: The DID of the service that the token will be used to authenticate with
:param exp: The time in Unix Epoch seconds that the JWT expires. Defaults to 60 seconds in the future. The service may enforce certain time bounds on tokens depending on the requested scope.
:param lxm: Lexicon (XRPC) method to bind the requested token to
"""
return _get_service_auth(self.call, aud)
return _get_service_auth(self.call, aud, exp, lxm)

def get_account_invite_codes(self, include_used: typing.Optional[bool]=None, create_available: typing.Optional[bool]=None) -> bytes:
"""Get all invite codes for the current account. Requires auth.
Expand Down
9 changes: 7 additions & 2 deletions chitose/com/atproto/server/get_service_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@
""""""
from __future__ import annotations
import chitose
import typing

def _get_service_auth(call: chitose.xrpc.XrpcCall, aud: str) -> bytes:
def _get_service_auth(call: chitose.xrpc.XrpcCall, aud: str, exp: typing.Optional[int]=None, lxm: typing.Optional[str]=None) -> bytes:
"""Get a signed token on behalf of the requesting DID for the requested service.
:param aud: The DID of the service that the token will be used to authenticate with
:param exp: The time in Unix Epoch seconds that the JWT expires. Defaults to 60 seconds in the future. The service may enforce certain time bounds on tokens depending on the requested scope.
:param lxm: Lexicon (XRPC) method to bind the requested token to
"""
return call('com.atproto.server.getServiceAuth', [('aud', aud)], None, {})
return call('com.atproto.server.getServiceAuth', [('aud', aud), ('exp', exp), ('lxm', lxm)], None, {})

0 comments on commit 219b875

Please sign in to comment.