a collection of lightweight TypeScript packages for AT Protocol, the protocol powering Bluesky
atproto bluesky typescript npm
101
fork

Configure Feed

Select the types of activity you want to include in your feed.

docs: update readme for oauth-keyset and oauth-types

Mary 57d7a62c a2e12fc1

+8 -68
-6
packages/oauth/keyset/README.md
··· 2 2 3 3 keyset management for AT Protocol OAuth. 4 4 5 - ## installation 6 - 7 5 ```sh 8 6 npm install @atcute/oauth-keyset 9 7 ``` ··· 69 67 // find a key for signing with server negotiation 70 68 const { key, alg } = keyset.findForSigning(['ES256', 'ES384']); 71 69 ``` 72 - 73 - ## license 74 - 75 - 0BSD
+8 -62
packages/oauth/types/README.md
··· 2 2 3 3 OAuth types and schemas for AT Protocol. 4 4 5 - ## installation 6 - 7 5 ```sh 8 6 npm install @atcute/oauth-types 9 7 ``` ··· 27 25 ); 28 26 ``` 29 27 30 - ### using schemas 28 + ### validating data 31 29 32 30 ```ts 33 31 import { 34 32 confidentialClientMetadataSchema, 35 - oauthClientMetadataSchema, 36 33 oauthTokenResponseSchema, 37 - oauthAuthorizationServerMetadataSchema, 34 + atprotoAuthorizationServerMetadataSchema, 38 35 } from '@atcute/oauth-types'; 39 36 40 - // validate input 37 + // validate client metadata 41 38 const result = confidentialClientMetadataSchema.try(input); 42 39 if (result.ok) { 43 40 console.log(result.value); 44 41 } 45 - ``` 46 - 47 - ## exports 48 - 49 - - `buildClientMetadata` - builds atproto client metadata from configuration 50 - - `FALLBACK_ALG` - default algorithm per atproto spec ('ES256') 51 - - `CLIENT_ASSERTION_TYPE_JWT_BEARER` - JWT bearer assertion type 52 - 53 - ### schemas 54 - 55 - **client metadata:** 56 - 57 - - `confidentialClientMetadataSchema` - user-facing metadata input 58 - - `oauthClientMetadataSchema` - full OAuth client metadata 59 - 60 - **tokens:** 61 - 62 - - `oauthTokenResponseSchema` - OAuth token response 63 - - `oauthTokenTypeSchema` - token type (Bearer, DPoP) 64 - - `atprotoOAuthTokenResponseSchema` - AT Protocol token response 65 - 66 - **authorization server:** 67 - 68 - - `oauthAuthorizationServerMetadataSchema` - OAuth AS metadata 69 - - `atprotoAuthorizationServerMetadataSchema` - AT Protocol AS metadata 70 - - `oauthIssuerIdentifierSchema` - issuer identifier 71 42 72 - **protected resource:** 73 - 74 - - `oauthProtectedResourceMetadataSchema` - OAuth PRM 75 - - `atprotoProtectedResourceMetadataSchema` - AT Protocol PRM 76 - 77 - **PAR:** 78 - 79 - - `oauthParResponseSchema` - PAR response 80 - - `oauthCodeChallengeMethodSchema` - code challenge method (S256, plain) 81 - - `oauthResponseModeSchema` - response mode 43 + // validate token response 44 + const tokenResult = oauthTokenResponseSchema.try(response); 82 45 83 - **authorization:** 84 - 85 - - `oauthAuthorizationDetailsSchema` - authorization details 86 - 87 - **keys:** 88 - 89 - - `jwkSchema`, `jwkPubSchema` - JWK schemas 90 - - `jwksSchema`, `jwksPubSchema` - JWKS schemas 91 - 92 - **URIs:** 93 - 94 - - `urlSchema`, `httpsUriSchema`, `webUriSchema`, etc. 95 - 96 - **other:** 97 - 98 - - `oauthScopeSchema`, `oauthGrantTypeSchema`, etc. 99 - 100 - ## license 101 - 102 - 0BSD 46 + // validate authorization server metadata 47 + const asResult = atprotoAuthorizationServerMetadataSchema.try(metadata); 48 + ```