@openverifiable/connector-bluesky 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAIV,eAAe,EACf,eAAe,EAChB,MAAM,sBAAsB,CAAC;AAupB9B;;GAEG;AACH,QAAA,MAAM,sBAAsB,EAAE,eAAe,CAAC,eAAe,CAW5D,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAIV,eAAe,EACf,eAAe,EAChB,MAAM,sBAAsB,CAAC;AA0pB9B;;GAEG;AACH,QAAA,MAAM,sBAAsB,EAAE,eAAe,CAAC,eAAe,CAW5D,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
package/lib/index.js CHANGED
@@ -770,8 +770,10 @@ async function exchangeCodeForTokens(code, redirectUri, tokenEndpoint, codeVerif
770
770
  };
771
771
  // For confidential clients, add client assertion JWT
772
772
  if (config.tokenEndpointAuthMethod === 'private_key_jwt') {
773
+ // Extract issuer origin from token endpoint URL
774
+ const issuer = new URL(tokenEndpoint).origin;
773
775
  try {
774
- const clientAssertion = await generateClientAssertion(effectiveClientId, tokenEndpoint, config);
776
+ const clientAssertion = await generateClientAssertion(effectiveClientId, issuer, config);
775
777
  if (clientAssertion) {
776
778
  params.append('client_assertion', clientAssertion);
777
779
  params.append('client_assertion_type', 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer');
@@ -781,7 +783,7 @@ async function exchangeCodeForTokens(code, redirectUri, tokenEndpoint, codeVerif
781
783
  const assertionEndpoint = config.assertionEndpoint;
782
784
  if (assertionEndpoint) {
783
785
  const assertionResponse = await got.post(assertionEndpoint, {
784
- json: { clientId: effectiveClientId, tokenEndpoint },
786
+ json: { clientId: effectiveClientId, issuer },
785
787
  headers: {
786
788
  'X-API-Key': config.assertionApiKey || '',
787
789
  },
@@ -963,7 +965,7 @@ const getAuthorizationUri = (getConfig) => async ({ state, redirectUri, ...rest
963
965
  // Add client assertion for confidential clients (required for PAR)
964
966
  if (validatedConfig.tokenEndpointAuthMethod === 'private_key_jwt') {
965
967
  try {
966
- const clientAssertion = await generateClientAssertion(effectiveClientId, authServerMetadata.pushed_authorization_request_endpoint, validatedConfig);
968
+ const clientAssertion = await generateClientAssertion(effectiveClientId, authServerMetadata.issuer, validatedConfig);
967
969
  if (clientAssertion) {
968
970
  parParams.append('client_assertion', clientAssertion);
969
971
  parParams.append('client_assertion_type', 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer');
@@ -975,7 +977,7 @@ const getAuthorizationUri = (getConfig) => async ({ state, redirectUri, ...rest
975
977
  const assertionResponse = await got.post(assertionEndpoint, {
976
978
  json: {
977
979
  clientId: effectiveClientId,
978
- tokenEndpoint: authServerMetadata.pushed_authorization_request_endpoint
980
+ issuer: authServerMetadata.issuer
979
981
  },
980
982
  headers: {
981
983
  'X-API-Key': config.assertionApiKey || '',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openverifiable/connector-bluesky",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Bluesky/AT Protocol OAuth connector for LogTo with PAR, PKCE, and DPoP support",
5
5
  "author": "OpenVerifiable (https://github.com/openverifiable)",
6
6
  "homepage": "https://openverifiable.org",
@@ -1,54 +0,0 @@
1
- /**
2
- * DID Document Fixtures
3
- * Valid DID documents for testing DID resolution and PDS discovery
4
- */
5
- export declare const didPlcDocument: {
6
- id: string;
7
- '@context': string[];
8
- service: {
9
- id: string;
10
- type: string;
11
- serviceEndpoint: string;
12
- }[];
13
- verificationMethod: {
14
- id: string;
15
- type: string;
16
- controller: string;
17
- publicKeyMultibase: string;
18
- }[];
19
- };
20
- export declare const didWebDocument: {
21
- id: string;
22
- '@context': string[];
23
- service: {
24
- id: string;
25
- type: string;
26
- serviceEndpoint: string;
27
- }[];
28
- verificationMethod: {
29
- id: string;
30
- type: string;
31
- controller: string;
32
- publicKeyMultibase: string;
33
- }[];
34
- };
35
- export declare const didDocumentWithHandle: {
36
- alsoKnownAs: string[];
37
- id: string;
38
- '@context': string[];
39
- service: {
40
- id: string;
41
- type: string;
42
- serviceEndpoint: string;
43
- }[];
44
- verificationMethod: {
45
- id: string;
46
- type: string;
47
- controller: string;
48
- publicKeyMultibase: string;
49
- }[];
50
- };
51
- export declare const invalidDidDocument: {
52
- id: string;
53
- };
54
- //# sourceMappingURL=did-documents.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"did-documents.d.ts","sourceRoot":"","sources":["../../src/__fixtures__/did-documents.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;CAqB1B,CAAC;AAEF,eAAO,MAAM,cAAc;;;;;;;;;;;;;;CAqB1B,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;CAGjC,CAAC;AAEF,eAAO,MAAM,kBAAkB;;CAG9B,CAAC"}
@@ -1,70 +0,0 @@
1
- /**
2
- * OAuth Metadata Fixtures
3
- * Authorization server and resource server metadata for testing
4
- */
5
- export declare const authorizationServerMetadata: {
6
- issuer: string;
7
- pushed_authorization_request_endpoint: string;
8
- authorization_endpoint: string;
9
- token_endpoint: string;
10
- scopes_supported: string;
11
- response_types_supported: string[];
12
- grant_types_supported: string[];
13
- code_challenge_methods_supported: string[];
14
- dpop_signing_alg_values_supported: string[];
15
- };
16
- export declare const authorizationServerMetadataWithoutAtproto: {
17
- scopes_supported: string;
18
- issuer: string;
19
- pushed_authorization_request_endpoint: string;
20
- authorization_endpoint: string;
21
- token_endpoint: string;
22
- response_types_supported: string[];
23
- grant_types_supported: string[];
24
- code_challenge_methods_supported: string[];
25
- dpop_signing_alg_values_supported: string[];
26
- };
27
- export declare const resourceServerMetadata: {
28
- resource: string;
29
- authorization_servers: string[];
30
- };
31
- export declare const resourceServerMetadataWithEntryway: {
32
- resource: string;
33
- authorization_servers: string[];
34
- };
35
- export declare const clientMetadata: {
36
- client_id: string;
37
- application_type: string;
38
- client_name: string;
39
- client_uri: string;
40
- dpop_bound_access_tokens: boolean;
41
- grant_types: string[];
42
- redirect_uris: string[];
43
- response_types: string[];
44
- scope: string;
45
- token_endpoint_auth_method: string;
46
- };
47
- export declare const confidentialClientMetadata: {
48
- token_endpoint_auth_method: string;
49
- token_endpoint_auth_signing_alg: string;
50
- jwks_uri: string;
51
- jwks: {
52
- keys: {
53
- kty: string;
54
- crv: string;
55
- x: string;
56
- y: string;
57
- kid: string;
58
- }[];
59
- };
60
- client_id: string;
61
- application_type: string;
62
- client_name: string;
63
- client_uri: string;
64
- dpop_bound_access_tokens: boolean;
65
- grant_types: string[];
66
- redirect_uris: string[];
67
- response_types: string[];
68
- scope: string;
69
- };
70
- //# sourceMappingURL=metadata.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../src/__fixtures__/metadata.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,2BAA2B;;;;;;;;;;CAUvC,CAAC;AAEF,eAAO,MAAM,yCAAyC;;;;;;;;;;CAGrD,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;CAGlC,CAAC;AAEF,eAAO,MAAM,kCAAkC;;;CAG9C,CAAC;AAEF,eAAO,MAAM,cAAc;;;;;;;;;;;CAW1B,CAAC;AAEF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;CAgBtC,CAAC"}
@@ -1,42 +0,0 @@
1
- /**
2
- * OAuth Error Response Fixtures
3
- * Standard OAuth error responses for testing error handling
4
- */
5
- export declare const useDpopNonceError: {
6
- error: string;
7
- error_description: string;
8
- nonce: string;
9
- };
10
- export declare const invalidRequestError: {
11
- error: string;
12
- error_description: string;
13
- };
14
- export declare const invalidClientError: {
15
- error: string;
16
- error_description: string;
17
- };
18
- export declare const invalidGrantError: {
19
- error: string;
20
- error_description: string;
21
- };
22
- export declare const invalidScopeError: {
23
- error: string;
24
- error_description: string;
25
- };
26
- export declare const unauthorizedClientError: {
27
- error: string;
28
- error_description: string;
29
- };
30
- export declare const unsupportedGrantTypeError: {
31
- error: string;
32
- error_description: string;
33
- };
34
- export declare const serverError: {
35
- error: string;
36
- error_description: string;
37
- };
38
- export declare const temporarilyUnavailableError: {
39
- error: string;
40
- error_description: string;
41
- };
42
- //# sourceMappingURL=oauth-errors.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"oauth-errors.d.ts","sourceRoot":"","sources":["../../src/__fixtures__/oauth-errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,iBAAiB;;;;CAI7B,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;CAG/B,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;CAG9B,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;CAG7B,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;CAG7B,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;CAGnC,CAAC;AAEF,eAAO,MAAM,yBAAyB;;;CAGrC,CAAC;AAEF,eAAO,MAAM,WAAW;;;CAGvB,CAAC;AAEF,eAAO,MAAM,2BAA2B;;;CAGvC,CAAC"}
@@ -1,34 +0,0 @@
1
- /**
2
- * Profile Response Fixtures
3
- * AT Protocol profile responses from PDS for testing
4
- */
5
- export declare const profileResponse: {
6
- did: string;
7
- handle: string;
8
- displayName: string;
9
- avatar: string;
10
- email: string;
11
- description: string;
12
- createdAt: string;
13
- };
14
- export declare const profileResponseMinimal: {
15
- did: string;
16
- handle: string;
17
- };
18
- export declare const profileResponseWithoutEmail: {
19
- did: string;
20
- handle: string;
21
- displayName: string;
22
- avatar: string;
23
- description: string;
24
- };
25
- export declare const profileResponseWithDifferentDID: {
26
- did: string;
27
- handle: string;
28
- displayName: string;
29
- avatar: string;
30
- email: string;
31
- description: string;
32
- createdAt: string;
33
- };
34
- //# sourceMappingURL=profile-responses.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"profile-responses.d.ts","sourceRoot":"","sources":["../../src/__fixtures__/profile-responses.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,eAAe;;;;;;;;CAQ3B,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;CAGlC,CAAC;AAEF,eAAO,MAAM,2BAA2B;;;;;;CAMvC,CAAC;AAEF,eAAO,MAAM,+BAA+B;;;;;;;;CAG3C,CAAC"}
@@ -1,38 +0,0 @@
1
- /**
2
- * Token Response Fixtures
3
- * OAuth token exchange responses for testing
4
- */
5
- export declare const tokenResponse: {
6
- access_token: string;
7
- refresh_token: string;
8
- token_type: string;
9
- expires_in: number;
10
- scope: string;
11
- sub: string;
12
- did: string;
13
- };
14
- export declare const tokenResponseWithoutRefresh: {
15
- access_token: string;
16
- token_type: string;
17
- expires_in: number;
18
- scope: string;
19
- sub: string;
20
- };
21
- export declare const tokenResponseWithDifferentDID: {
22
- sub: string;
23
- did: string;
24
- access_token: string;
25
- refresh_token: string;
26
- token_type: string;
27
- expires_in: number;
28
- scope: string;
29
- };
30
- export declare const refreshTokenResponse: {
31
- access_token: string;
32
- refresh_token: string;
33
- token_type: string;
34
- expires_in: number;
35
- scope: string;
36
- sub: string;
37
- };
38
- //# sourceMappingURL=token-responses.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"token-responses.d.ts","sourceRoot":"","sources":["../../src/__fixtures__/token-responses.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,aAAa;;;;;;;;CAQzB,CAAC;AAEF,eAAO,MAAM,2BAA2B;;;;;;CAMvC,CAAC;AAEF,eAAO,MAAM,6BAA6B;;;;;;;;CAIzC,CAAC;AAEF,eAAO,MAAM,oBAAoB;;;;;;;CAOhC,CAAC"}
@@ -1,43 +0,0 @@
1
- /**
2
- * Real Account Test Helpers
3
- * Utilities for testing with real AT Protocol accounts
4
- *
5
- * Note: For full token verification, you may need @atproto/api
6
- * Install it as a dev dependency if needed: npm install --save-dev @atproto/api
7
- */
8
- import type { BlueskyConfig } from '../../types.js';
9
- export interface TestAccount {
10
- handle: string;
11
- did: string;
12
- pdsUrl: string;
13
- }
14
- export interface TestSession {
15
- accessToken: string;
16
- refreshToken?: string;
17
- did: string;
18
- expiresAt: number;
19
- }
20
- /**
21
- * Get test account from environment variables
22
- */
23
- export declare function getTestAccount(): TestAccount;
24
- /**
25
- * Verify access token is valid by making an authenticated request
26
- *
27
- * Note: This requires @atproto/api. For a simpler check, you can verify
28
- * the token structure or make a direct HTTP request with DPoP.
29
- */
30
- export declare function verifyAccessToken(accessToken: string, did: string, pdsUrl: string): Promise<boolean>;
31
- /**
32
- * Create test config from environment variables
33
- */
34
- export declare function getTestConfig(): BlueskyConfig;
35
- /**
36
- * Check if integration tests should run
37
- */
38
- export declare function shouldRunIntegrationTests(): boolean;
39
- /**
40
- * Get test redirect URI
41
- */
42
- export declare function getTestRedirectUri(): string;
43
- //# sourceMappingURL=real-account-helpers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"real-account-helpers.d.ts","sourceRoot":"","sources":["../../../src/__tests__/integration/real-account-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,WAAW;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,WAAW,CAa5C;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,CACrC,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,OAAO,CAAC,CAmBlB;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,aAAa,CA0B7C;AAED;;GAEG;AACH,wBAAgB,yBAAyB,IAAI,OAAO,CAMnD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAM3C"}
@@ -1,12 +0,0 @@
1
- /**
2
- * Real Account Integration Tests
3
- *
4
- * These tests require:
5
- * 1. A real Bluesky test account
6
- * 2. Publicly accessible client metadata and JWKS
7
- * 3. Environment variables configured (see INTEGRATION_TESTING.md)
8
- *
9
- * These tests are skipped if TEST_BLUESKY_HANDLE is not set.
10
- */
11
- export {};
12
- //# sourceMappingURL=real-account.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"real-account.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/integration/real-account.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"}
@@ -1,6 +0,0 @@
1
- /**
2
- * Client Assertion Tests
3
- * Tests for JWT client assertion generation (RFC 7523)
4
- */
5
- export {};
6
- //# sourceMappingURL=client-assertion.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"client-assertion.test.d.ts","sourceRoot":"","sources":["../src/client-assertion.test.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
@@ -1,6 +0,0 @@
1
- /**
2
- * DPoP Tests
3
- * Tests for Demonstrating Proof of Possession (RFC 9449) implementation
4
- */
5
- export {};
6
- //# sourceMappingURL=dpop.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dpop.test.d.ts","sourceRoot":"","sources":["../src/dpop.test.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
@@ -1,7 +0,0 @@
1
- /**
2
- * Bluesky Connector Tests
3
- *
4
- * Basic unit tests for Bluesky OAuth connector with PAR, PKCE, and DPoP
5
- */
6
- export {};
7
- //# sourceMappingURL=index.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../src/index.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
@@ -1,6 +0,0 @@
1
- /**
2
- * PDS Discovery Tests
3
- * Tests for PDS resolution, DID resolution, metadata fetching, and SSRF protection
4
- */
5
- export {};
6
- //# sourceMappingURL=pds-discovery.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pds-discovery.test.d.ts","sourceRoot":"","sources":["../src/pds-discovery.test.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
@@ -1,6 +0,0 @@
1
- /**
2
- * PKCE Tests
3
- * Tests for Proof Key for Code Exchange (RFC 7636) implementation
4
- */
5
- export {};
6
- //# sourceMappingURL=pkce.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pkce.test.d.ts","sourceRoot":"","sources":["../src/pkce.test.ts"],"names":[],"mappings":"AAAA;;;GAGG"}