@openverifiable/connector-bluesky 1.0.1 → 1.0.3
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.
- package/lib/client-assertion.d.ts +8 -2
- package/lib/client-assertion.d.ts.map +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +58 -3
- package/package.json +1 -1
- package/lib/__fixtures__/did-documents.d.ts +0 -54
- package/lib/__fixtures__/did-documents.d.ts.map +0 -1
- package/lib/__fixtures__/metadata.d.ts +0 -70
- package/lib/__fixtures__/metadata.d.ts.map +0 -1
- package/lib/__fixtures__/oauth-errors.d.ts +0 -42
- package/lib/__fixtures__/oauth-errors.d.ts.map +0 -1
- package/lib/__fixtures__/profile-responses.d.ts +0 -34
- package/lib/__fixtures__/profile-responses.d.ts.map +0 -1
- package/lib/__fixtures__/token-responses.d.ts +0 -38
- package/lib/__fixtures__/token-responses.d.ts.map +0 -1
- package/lib/__tests__/integration/real-account-helpers.d.ts +0 -43
- package/lib/__tests__/integration/real-account-helpers.d.ts.map +0 -1
- package/lib/__tests__/integration/real-account.test.d.ts +0 -12
- package/lib/__tests__/integration/real-account.test.d.ts.map +0 -1
- package/lib/client-assertion.test.d.ts +0 -6
- package/lib/client-assertion.test.d.ts.map +0 -1
- package/lib/dpop.test.d.ts +0 -6
- package/lib/dpop.test.d.ts.map +0 -1
- package/lib/index.test.d.ts +0 -7
- package/lib/index.test.d.ts.map +0 -1
- package/lib/pds-discovery.test.d.ts +0 -6
- package/lib/pds-discovery.test.d.ts.map +0 -1
- package/lib/pkce.test.d.ts +0 -6
- package/lib/pkce.test.d.ts.map +0 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Client Assertion Generation for private_key_jwt
|
|
3
3
|
*
|
|
4
|
-
* Generates JWT client assertion for OAuth
|
|
4
|
+
* Generates JWT client assertion for OAuth authentication
|
|
5
|
+
* Used for both PAR (Pushed Authorization Request) and token endpoint requests
|
|
5
6
|
* RFC 7523: https://datatracker.ietf.org/doc/html/rfc7523
|
|
6
7
|
*/
|
|
7
8
|
import type { BlueskyConfig } from './types.js';
|
|
@@ -14,6 +15,11 @@ import type { BlueskyConfig } from './types.js';
|
|
|
14
15
|
*
|
|
15
16
|
* For now, we'll support both approaches - if privateKeyJwk is in config, use it.
|
|
16
17
|
* Otherwise, the server should provide an endpoint to generate assertions.
|
|
18
|
+
*
|
|
19
|
+
* @param clientId - The OAuth client identifier
|
|
20
|
+
* @param audience - The audience URL (PAR endpoint or token endpoint)
|
|
21
|
+
* @param config - Bluesky connector configuration
|
|
22
|
+
* @returns JWT client assertion string, or null if private key is not available
|
|
17
23
|
*/
|
|
18
|
-
export declare function generateClientAssertion(clientId: string,
|
|
24
|
+
export declare function generateClientAssertion(clientId: string, audience: string, config: BlueskyConfig): Promise<string | null>;
|
|
19
25
|
//# sourceMappingURL=client-assertion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-assertion.d.ts","sourceRoot":"","sources":["../src/client-assertion.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"client-assertion.d.ts","sourceRoot":"","sources":["../src/client-assertion.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,uBAAuB,CAC3C,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAmCxB"}
|
package/lib/index.d.ts.map
CHANGED
|
@@ -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;
|
|
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"}
|
package/lib/index.js
CHANGED
|
@@ -619,7 +619,8 @@ async function fetchAuthorizationServerMetadataFromUrl(authServerUrl) {
|
|
|
619
619
|
/**
|
|
620
620
|
* Client Assertion Generation for private_key_jwt
|
|
621
621
|
*
|
|
622
|
-
* Generates JWT client assertion for OAuth
|
|
622
|
+
* Generates JWT client assertion for OAuth authentication
|
|
623
|
+
* Used for both PAR (Pushed Authorization Request) and token endpoint requests
|
|
623
624
|
* RFC 7523: https://datatracker.ietf.org/doc/html/rfc7523
|
|
624
625
|
*/
|
|
625
626
|
/**
|
|
@@ -631,8 +632,13 @@ async function fetchAuthorizationServerMetadataFromUrl(authServerUrl) {
|
|
|
631
632
|
*
|
|
632
633
|
* For now, we'll support both approaches - if privateKeyJwk is in config, use it.
|
|
633
634
|
* Otherwise, the server should provide an endpoint to generate assertions.
|
|
635
|
+
*
|
|
636
|
+
* @param clientId - The OAuth client identifier
|
|
637
|
+
* @param audience - The audience URL (PAR endpoint or token endpoint)
|
|
638
|
+
* @param config - Bluesky connector configuration
|
|
639
|
+
* @returns JWT client assertion string, or null if private key is not available
|
|
634
640
|
*/
|
|
635
|
-
async function generateClientAssertion(clientId,
|
|
641
|
+
async function generateClientAssertion(clientId, audience, config) {
|
|
636
642
|
// Check if private key is available in config (for server-side connectors)
|
|
637
643
|
// In production, this would come from Vault via a server endpoint
|
|
638
644
|
const privateKeyJwkStr = config.privateKeyJwk;
|
|
@@ -649,7 +655,7 @@ async function generateClientAssertion(clientId, tokenEndpoint, config) {
|
|
|
649
655
|
const jwt = new SignJWT({
|
|
650
656
|
iss: clientId,
|
|
651
657
|
sub: clientId,
|
|
652
|
-
aud:
|
|
658
|
+
aud: audience,
|
|
653
659
|
jti,
|
|
654
660
|
exp: now + 600,
|
|
655
661
|
iat: now,
|
|
@@ -954,6 +960,55 @@ const getAuthorizationUri = (getConfig) => async ({ state, redirectUri, ...rest
|
|
|
954
960
|
code_challenge_method: pkce.codeChallengeMethod,
|
|
955
961
|
...('login_hint' in rest && rest.login_hint ? { login_hint: String(rest.login_hint) } : {}),
|
|
956
962
|
});
|
|
963
|
+
// Add client assertion for confidential clients (required for PAR)
|
|
964
|
+
if (validatedConfig.tokenEndpointAuthMethod === 'private_key_jwt') {
|
|
965
|
+
try {
|
|
966
|
+
const clientAssertion = await generateClientAssertion(effectiveClientId, authServerMetadata.pushed_authorization_request_endpoint, validatedConfig);
|
|
967
|
+
if (clientAssertion) {
|
|
968
|
+
parParams.append('client_assertion', clientAssertion);
|
|
969
|
+
parParams.append('client_assertion_type', 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer');
|
|
970
|
+
}
|
|
971
|
+
else {
|
|
972
|
+
// Fallback to assertion endpoint
|
|
973
|
+
const assertionEndpoint = config.assertionEndpoint;
|
|
974
|
+
if (assertionEndpoint) {
|
|
975
|
+
const assertionResponse = await got.post(assertionEndpoint, {
|
|
976
|
+
json: {
|
|
977
|
+
clientId: effectiveClientId,
|
|
978
|
+
tokenEndpoint: authServerMetadata.pushed_authorization_request_endpoint
|
|
979
|
+
},
|
|
980
|
+
headers: {
|
|
981
|
+
'X-API-Key': config.assertionApiKey || '',
|
|
982
|
+
},
|
|
983
|
+
timeout: { request: defaultTimeout },
|
|
984
|
+
});
|
|
985
|
+
const assertionData = parseJson(assertionResponse.body);
|
|
986
|
+
if (assertionData?.client_assertion) {
|
|
987
|
+
parParams.append('client_assertion', assertionData.client_assertion);
|
|
988
|
+
parParams.append('client_assertion_type', 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer');
|
|
989
|
+
}
|
|
990
|
+
else {
|
|
991
|
+
throw new ConnectorError(ConnectorErrorCodes.InvalidConfig, {
|
|
992
|
+
error: 'Client assertion required for PAR but could not be generated',
|
|
993
|
+
});
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
else {
|
|
997
|
+
throw new ConnectorError(ConnectorErrorCodes.InvalidConfig, {
|
|
998
|
+
error: 'Client assertion required for PAR. Provide privateKeyJwk or assertionEndpoint.',
|
|
999
|
+
});
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
catch (error) {
|
|
1004
|
+
if (error instanceof ConnectorError) {
|
|
1005
|
+
throw error;
|
|
1006
|
+
}
|
|
1007
|
+
throw new ConnectorError(ConnectorErrorCodes.General, {
|
|
1008
|
+
error: `Failed to generate client assertion for PAR: ${error instanceof Error ? error.message : 'Unknown error'}`,
|
|
1009
|
+
});
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
957
1012
|
const { requestUri, nonce } = await makePARRequest(authServerMetadata.pushed_authorization_request_endpoint, parParams, dpopKeyPair);
|
|
958
1013
|
// Store PKCE verifier and DPoP key pair in state store
|
|
959
1014
|
// Export DPoP keypair as JWK for storage
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openverifiable/connector-bluesky",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client-assertion.test.d.ts","sourceRoot":"","sources":["../src/client-assertion.test.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
package/lib/dpop.test.d.ts
DELETED
package/lib/dpop.test.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dpop.test.d.ts","sourceRoot":"","sources":["../src/dpop.test.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
package/lib/index.test.d.ts
DELETED
package/lib/index.test.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../src/index.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pds-discovery.test.d.ts","sourceRoot":"","sources":["../src/pds-discovery.test.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
package/lib/pkce.test.d.ts
DELETED
package/lib/pkce.test.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pkce.test.d.ts","sourceRoot":"","sources":["../src/pkce.test.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|