Commit Graph

1347 Commits

Author SHA1 Message Date
Matthieu Sieben 349b59175e Properly validate auth during refresh (#3847)
* Ensure that the credentials used during a refresh correspond to those used to create the OAuth tokens.

* tidy

* Bind the OAuth session to the kid that was used to authenticate the client (private_key_jwt)

* Store the whole authentication method in the client session store rather than the kid only

* tidy

* Improve error reporting in case an invalid `token_endpoint_auth_method` is used in the client metadata document.

* tidy

* tidy

* Improve JAR checks

* tidy

* changeset

* tidy

* Remove schema's `.optional()` modifier when a `.default()` is defined

* tidy

* verify client auth during code exchange

* tidy

* Minor naming improvement

* tidy

* Update .changeset/quiet-pans-fix.md

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

* Update packages/oauth/oauth-client/src/oauth-client-auth.ts

* Use `private_key_jwt` instead of incorrect `client_secret_jwt` as authentication method for confidential clients

* style

* code split

* dead code removal

* Represent missing client auth with a `null` instead of "none" when storing request data.

* Allow storing `null` in authorization_request's `clientAuth` json column

* document

* tidy

* Remove non-standard behavior that allowed client to authenticate through JAR

* Improved error messages

* Parse JSON encoded Authorization Request Parameters

* Use `application/x-www-form-urlencoded` content instead of JSON for OAuth requests

Fixes: #3723

* tidy

* tidy

* tidy

* tidy

* code style

* remove un-necessary checks

* tidy

* Pre-process number too

* improved type checking

* add missing exports

* fix merge conflict

* tidy

* Remove invalid default for `code_challenge_method` authorization request parameter

* tidy

* Delete inaccurate changeset

* PR comment

* tidy

* Update OAuth client credentials factory to return headers and payload separately.

* tidy

* Renamed `clientAuthCheck` to `validateClientAuth`

* Validate presence of DPoP proofs sooner when processing token requests.

Fixes: #3859

* Protect against concurrent use of request code

* tidy

* tidy

* Update packages/oauth/oauth-provider/src/client/client.ts

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

* Review comments

* Add missing `exp` claim in client attestation JWT

* fixup! Review comments

* Review comments

* Refactor: explicit optionality of unsigned JAR issuer & audience

* Use client attestation's `exp` claim to determine the life time of JWT's `jti` nonce.

* Fix PDS: consumeRequestCode should delete request data

* tidy

* tidy

* Unused code removal

* Restore "Native clients must authenticate using "none" method" check

* tidy

* tidy

* cleanup

* comment

* Allow missing DPoP header during PAR request if `dpop_jkt` is provided

* tidy

---------

Co-authored-by: devin ivy <devinivy@gmail.com>
2025-06-12 15:10:17 +02:00
github-actions[bot] c2b57e3f65 Version packages (#3944)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-06-11 16:49:12 -05:00
Matthieu Sieben 0286f7ee3d Refactor route rate limiter builder (#3886)
* Refactor route rate limiter builder

* Refactor RouteRateLimiter handle method to improve bypass logic and return type

* Use `redis` as rate limit db when available
2025-06-10 20:53:56 +02:00
github-actions[bot] 93bf69df96 Version packages (#3936)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-06-06 20:20:02 -03:00
Samuel Newman a48671e730 Notification preferences V2 endpoints (#3901)
Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com>
Co-authored-by: rafael <rafael@blueskyweb.xyz>
2025-06-06 18:29:05 -03:00
github-actions[bot] bd77a88d05 Version packages (#3931)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-06-06 11:49:33 -05:00
Eric Bailey c6eb8a12e2 Update V2 additional replies naming convention (#3929)
* Rename

* Import sorting
2025-06-06 10:54:36 -05:00
Matthieu Sieben 598fcb693d Log invalid use of "htu" DPoP proof claim (#3930) 2025-06-06 14:50:43 +02:00
github-actions[bot] 623c95d01e Version packages (#3924)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-06-05 14:59:03 +02:00
Matthieu Sieben 3fa2ee3b6a Deprecate query & fragment in DPoP proof htu claim (#3879)
* Properly validate JWK `htu` claim by enforcing URL without query or fragment

* type fix

* Return DPoP validation result from `authenticateRequest`

* Log clients using invalid "htu" claim in DPoP proof

* review comments

* fix lint

* tidy

* rename dpop result to dpop proof
2025-06-05 14:46:51 +02:00
github-actions[bot] 1919d10a22 Version packages (#3920)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-06-04 13:35:53 +02:00
github-actions[bot] 45e8717e19 Version packages (#3914)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-05-31 16:37:17 -03:00
Eric Bailey a5cd018bd5 Unify getPostThreadV2 and getPostThreadHiddenV2 responses (#3912)
Co-authored-by: rafael <rafael@blueskyweb.xyz>
2025-05-31 16:25:25 -03:00
github-actions[bot] e05b38a727 Version packages (#3907)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-05-29 15:27:40 -03:00
rafael f6d5a467e7 Fix handling following users in threads v2 (#3909) 2025-05-29 13:01:11 -03:00
Matthieu Sieben 06bf684a4a Add max length limit to passwords (#3900)
* Add max length limit to passwords

* review changes
2025-05-29 14:15:45 +02:00
Foysal Ahamed 498f3c0738 🐛 Fetch record from pds if appview fails to find it for ozone (#3892)
* 🐛 Fetch record from pds if appview fails to find it for ozone

*  Resolve and etch from pds without auth

* ♻️ Refactor and cleanup

*  Fix tests

*  Fix tests

* 🚨 Fix linter issue

* 🧹 Cleanup
2025-05-28 21:39:28 +02:00
Foysal Ahamed 37b5a4ef29 🐛 Add missing union ref to ozone mod subject (#3605) 2025-05-28 10:30:54 +02:00
Foysal Ahamed fe2a1d12bb 🐛 Add datetime format in lexicon def for createdAt field on grantVerification input (#3829) 2025-05-28 10:30:43 +02:00
github-actions[bot] bae3ef91fc Version packages (#3897)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-05-27 21:31:22 -05:00
rafael 1dae6c59ab Add app.bsky.unspecced.getPostThreadV2 (#3825)
Co-authored-by: Eric Bailey <git@esb.lol>
2025-05-27 22:12:12 -03:00
github-actions[bot] d6c40d6559 Version packages (#3878) 2025-05-26 22:04:18 +03:00
Samuel Newman 79a75bb1ed Referred likes lexicon changes (#3882) 2025-05-26 19:28:59 +03:00
bnewbold 24e20b96c6 lexicons: update searchPosts to indicate it isn't always available publicly (#3844)
* update searchPost description to clarify it may or may not be public

* codegen
2025-05-20 21:04:40 -07:00
github-actions[bot] 0a2c30dd97 Version packages (#3872)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-05-20 15:15:10 -07:00
hailey 80f402f366 add reqId to interactions (#3869) 2025-05-20 14:45:19 -07:00
Matthieu Sieben 8318c57187 Allow proxying of getSession using OAuth session (#3820)
* Allow proxying of dpop bound requests by using service auth instead, for the `getSession` endpoint.

* Show `getSession` data in example app

* Add  scope

* strings

* cleanup

* tidy

* tidy

* Add transition:email scope to example app

* strings

* changeset

* pr comments
2025-05-20 14:37:02 +02:00
Matthieu Sieben eab7c9fb8a Use the PDS's hostname as fallback PDS "name" in the auth screen (#3868) 2025-05-20 13:32:48 +02:00
github-actions[bot] f476003709 Version packages (#3854)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-05-16 17:20:57 -03:00
rafael 86b3153884 Add liveNow to app.bsky.unspecced.getConfig (#3860) 2025-05-16 17:01:37 -03:00
devin ivy efc64ba925 pds: client ip relative to trusted ips (#3850)
* pds: client ip relative to trusted ips

* changeset
2025-05-13 12:29:13 -07:00
github-actions[bot] 251f661c00 Version packages (#3841)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-05-08 21:51:09 -04:00
devin ivy 088d06204f pds: fix account management migration, partial failure in some cases (#3840)
* pds: fix account management migration which had a partial failure in some cases

* changeset
2025-05-08 21:45:45 -04:00
github-actions[bot] b36014dac5 Version packages (#3803)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-05-05 17:44:12 -03:00
rafael 3a65b68f7d Actor status lexicon and views (#3824) 2025-05-05 17:35:10 -03:00
rafael ab4e72084d Handle resolution improvements (#3816)
* Handle resolution improvements

On PDS, only perform resolution if appview is not configured.
On appview, never perform resolution, only rely on dataplane.

* changeset

* appview: add lookup_unidirectional to GetDidsByHandles

* appview: plumb lookup_unidirectional for handle lookup

* note

---------

Co-authored-by: Devin Ivy <devinivy@gmail.com>
2025-04-29 08:58:55 -04:00
Matthieu Sieben eccbce278d Small memory leak fix when reading CAR file with multiple roots (#3814) 2025-04-28 20:28:13 +02:00
Matthieu Sieben b5afb723be Consistenlty log errors with pino (#3700) 2025-04-25 17:02:51 +02:00
github-actions[bot] 284b9e90ac Version packages (#3801)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-04-24 15:52:39 +02:00
Foysal Ahamed 45354c84f8 ❇️ Verifications manager in ozone (#3765)
* First vouch implementation

* Remove unneeded endpoints

* wip

*  wip

*  Process jetstream events through p-queue and add tests

*  Add test for cursor update

* 🐛 Use utc time to update updatedAt

* 🧹 Cleanup

* 🔨 Fix pnpm versioning issues

*  Replace jetstream lib with manual implementation

*  Remove unnecessary 3p dep

*  Add e2e test for jetstream

* 🚨 Fix import

* 🧹 Remove unnecessary property

*  Fix dev-env and add profile to verification view in ozone

*  Add profile type

*  Add backpressure handling to jetstream listener

*  Use WebSocketKeepAlive from xrpc-server and replace partysocket

*  Add a new verifier role to ozone team meber roles

* 📝 Run codegen

* 🐛 Fix auth check

* 🐛 Fix test failure check

* 🚨 Fix json formatting

* 🐛 Fix team role check

* 🚧 Checking failing test

*  Fix tests

*  Address review comments

*  Add xrpc-server to version

* 🚨 Fix linter issue

* 🚨 Fix linter issue

*  Resolve race condition in cursor update

*  Add verification check on profile

* 🐛 Fix missing cid in test and firehose cursor

*  Fix test

*  Add record validation for verification and separate xrpc-server version

*  Return error object for failed revocations

*  Add re-login on expired session case

* 📝 Fix typo

---------

Co-authored-by: rafael <rafael@blueskyweb.xyz>
2025-04-24 10:49:45 +02:00
github-actions[bot] bd54773dc2 Version packages (#3800)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-04-23 21:21:40 -04:00
devin ivy 7af77f3edf Ozone: support for tools.ozone.hosting.getAccountHistory (#3768)
* update ozone lexicons w/ tools.ozone.hosting

* ozone: tidy deprecated usage

* ozone: proxy tools.ozone.hosting.getAccountHistory

* changeset

* ozone: consistency in account history lexicon
2025-04-23 18:06:36 -04:00
rafael d65ceaeeef lex codegen for #3769 (#3787) 2025-04-21 11:38:14 -03:00
github-actions[bot] 2b0c0159a9 Version packages (#3784)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-04-18 17:31:23 -04:00
github-actions[bot] f1a2b44550 Version packages (#3782)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-04-18 14:59:07 -05:00
rafael 0087dc1c0b Verification notifications (#3773)
Co-authored-by: Eric Bailey <git@esb.lol>
2025-04-18 16:46:42 -03:00
github-actions[bot] 8e696dbcbf Version packages (#3779)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-04-18 15:37:26 -04:00
github-actions[bot] 90e9a20d31 Version packages (#3777)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-04-18 11:11:53 +02:00
Matthieu Sieben 30f9b6690e OAuth Provider account page fixes (#3764)
* Allow `:` chars in url path parts

* Allow customizing contrast and hue colors

* Allow customizing contrast and hue colors

* Use white as primary contrast color

* Fix buttons alignment and labels in "My Devices" section

* Add a `<title>` tag to all pages

* Properly display the "lastSeenAt" date

* Improve display of clients & devices

* tidy

* code split

* Add definition for `ConventionalOAuthClientId`

* Remove hard coded `client_name` from loopback client metadata

* Code factorization

* Fix `<title>` of branding page
2025-04-18 11:04:34 +02:00
Matthieu Sieben 6db9faa4a1 Remove unused image-url.ts file (#3775) 2025-04-18 11:00:43 +02:00