@atlasauth/pca-connectors 0.1.0 → 0.3.0
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/LICENSE +21 -0
- package/README.md +74 -0
- package/package.json +28 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Atlas Authorization
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# @atlasauth/pca-connectors
|
|
2
|
+
|
|
3
|
+
The connector catalog for Proof-Carrying Authority (PCA): a declarative registry of outbound SaaS providers as data manifests, plus the authorize-URL, code-exchange and refresh helpers that feed the `@atlasauth/pca-connect` token vault. Wiring a new outbound tool is a manifest edit, and every connection minted here is bound to a PCA capability: the stored token is only released when a verified PCActn proves authority over the provider and scopes.
|
|
4
|
+
|
|
5
|
+
Built-in manifests: Airtable, Atlassian, Dropbox, GitHub, Google, HubSpot, Linear, Microsoft, Notion, Salesforce, Shopify, Slack, Snowflake, Stripe, Zoom. Each manifest declares the authorize and token URLs, default scopes, PKCE, how the access token is placed on a request, and refresh behaviour.
|
|
6
|
+
|
|
7
|
+
This package is the code layer only. It never makes the outbound API call and ships no consent UI.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
npm i @atlasauth/pca-connectors
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Depends on `@atlasauth/pca` and `@atlasauth/pca-connect` (installed automatically).
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import { TokenVault } from '@atlasauth/pca-connect';
|
|
21
|
+
import {
|
|
22
|
+
listProviders, buildAuthorizeUrl, exchangeCode, buildVaultProviders, getProvider, applyAccessToken,
|
|
23
|
+
} from '@atlasauth/pca-connectors';
|
|
24
|
+
|
|
25
|
+
listProviders().map((p) => p.id); // ['airtable', 'atlassian', 'dropbox', 'github', 'google', ...]
|
|
26
|
+
|
|
27
|
+
// 1. Send the user to the provider. Keep `state` and `pkce.verifier` for the callback.
|
|
28
|
+
const { url, state, pkce } = buildAuthorizeUrl('google', {
|
|
29
|
+
clientId: process.env.GOOGLE_CLIENT_ID!,
|
|
30
|
+
redirectUri: 'https://app.example/callback',
|
|
31
|
+
scopes: ['https://www.googleapis.com/auth/gmail.readonly'],
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
// 2. A vault whose auto-refresh config is derived from the manifests.
|
|
35
|
+
const vault = new TokenVault({
|
|
36
|
+
providers: buildVaultProviders({ google: { clientId: process.env.GOOGLE_CLIENT_ID!, clientSecret: process.env.GOOGLE_CLIENT_SECRET } }),
|
|
37
|
+
fetch, // your HTTP transport (the global fetch works)
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
// 3. On callback, exchange the code and store a capability-bound connection.
|
|
41
|
+
await exchangeCode({
|
|
42
|
+
providerId: 'google',
|
|
43
|
+
clientId: process.env.GOOGLE_CLIENT_ID!,
|
|
44
|
+
clientSecret: process.env.GOOGLE_CLIENT_SECRET,
|
|
45
|
+
code, // from the redirect
|
|
46
|
+
redirectUri: 'https://app.example/callback',
|
|
47
|
+
codeVerifier: pkce?.verifier,
|
|
48
|
+
scopes: ['https://www.googleapis.com/auth/gmail.readonly'],
|
|
49
|
+
fetch,
|
|
50
|
+
bind: { vault, agentId, authority: { principal } }, // b64u keys: the agent, and the root the capability chain must start at
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
// Later, a verified PCActn releases the token via vault.getConnectionToken(...); then:
|
|
54
|
+
const header = applyAccessToken(getProvider('google')!, accessToken); // { kind: 'header', name: 'Authorization', value: 'Bearer ...' }
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Custom providers: `registerProvider(manifest)` validates a manifest and adds it to the default registry, or create your own `ProviderRegistry`. Manifests with a `{var}` placeholder in their URLs (such as Shopify) take `vars: { shop: 'acme' }`.
|
|
58
|
+
|
|
59
|
+
## API
|
|
60
|
+
|
|
61
|
+
- Registry: `ProviderRegistry`, `defaultRegistry`, `registerProvider`, `getProvider`, `listProviders`, `validateManifest`, `assertManifest`
|
|
62
|
+
- Authorization: `buildAuthorizeUrl`, `pkceChallenge`, `applyAccessToken`, `substituteVars`
|
|
63
|
+
- Tokens: `exchangeCode`, `refresh`, `manifestToProviderConfig`, `buildVaultProviders`
|
|
64
|
+
- `providers` namespace with the built-in manifests
|
|
65
|
+
|
|
66
|
+
## Status
|
|
67
|
+
|
|
68
|
+
The manifests are data describing each provider's public OAuth endpoints; verify the scopes and endpoints for your own app registration before relying on them. Refresh behaviour and scope narrowing vary by provider and are declared per manifest. Cryptography in PCA is unaudited.
|
|
69
|
+
|
|
70
|
+
Source and issues: https://github.com/Atlas-Authorization/pca
|
|
71
|
+
|
|
72
|
+
## License
|
|
73
|
+
|
|
74
|
+
MIT - see LICENSE
|
package/package.json
CHANGED
|
@@ -1,7 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlasauth/pca-connectors",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Declarative outbound connector registry for PCA: provider manifests (auth URLs, scopes, refresh, token placement) for the top SaaS tools + an auto-refresh helper, so every vault connector call is a proof-carrying capability.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"connectors",
|
|
7
|
+
"oauth",
|
|
8
|
+
"saas",
|
|
9
|
+
"manifest",
|
|
10
|
+
"agent authorization",
|
|
11
|
+
"proof-carrying authority",
|
|
12
|
+
"pca",
|
|
13
|
+
"ai agents"
|
|
14
|
+
],
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"homepage": "https://github.com/Atlas-Authorization/pca#readme",
|
|
17
|
+
"bugs": {
|
|
18
|
+
"url": "https://github.com/Atlas-Authorization/pca/issues"
|
|
19
|
+
},
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+https://github.com/Atlas-Authorization/pca.git",
|
|
23
|
+
"directory": "packages/pca-connectors"
|
|
24
|
+
},
|
|
5
25
|
"main": "./dist/index.js",
|
|
6
26
|
"types": "./dist/index.d.ts",
|
|
7
27
|
"exports": {
|
|
@@ -12,8 +32,8 @@
|
|
|
12
32
|
"./package.json": "./package.json"
|
|
13
33
|
},
|
|
14
34
|
"dependencies": {
|
|
15
|
-
"@atlasauth/pca": "0.
|
|
16
|
-
"@atlasauth/pca-connect": "0.
|
|
35
|
+
"@atlasauth/pca": "0.3.0",
|
|
36
|
+
"@atlasauth/pca-connect": "0.3.0"
|
|
17
37
|
},
|
|
18
38
|
"devDependencies": {
|
|
19
39
|
"typescript": "^5.6.3",
|
|
@@ -21,8 +41,12 @@
|
|
|
21
41
|
},
|
|
22
42
|
"files": [
|
|
23
43
|
"dist",
|
|
24
|
-
"README.md"
|
|
44
|
+
"README.md",
|
|
45
|
+
"LICENSE"
|
|
25
46
|
],
|
|
47
|
+
"engines": {
|
|
48
|
+
"node": ">=20"
|
|
49
|
+
},
|
|
26
50
|
"publishConfig": {
|
|
27
51
|
"access": "public"
|
|
28
52
|
},
|