@productcraft/platform-auth 0.0.10 → 0.0.11
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/README.md +5 -5
- package/package.json +3 -4
package/README.md
CHANGED
|
@@ -12,10 +12,10 @@ Server-side only. The SDK ships a Platform API Key in the `Authorization` header
|
|
|
12
12
|
|
|
13
13
|
| If your goal is to … | Reach for |
|
|
14
14
|
|---|---|
|
|
15
|
-
| Authenticate **your own end-users** in a product you're building (
|
|
15
|
+
| Authenticate **your own end-users** in a product you're building (Auth apps) | [`@productcraft/auth`](https://www.npmjs.com/package/@productcraft/auth) |
|
|
16
16
|
| Authenticate **your team** into the ProductCraft console + manage workspaces | **this package** |
|
|
17
17
|
|
|
18
|
-
The two are easy to confuse because both have "auth" in the name. Platform-Auth owns *the ProductCraft account you use to log into productcraft.co*.
|
|
18
|
+
The two are easy to confuse because both have "auth" in the name. Platform-Auth owns *the ProductCraft account you use to log into productcraft.co*. Auth owns *the end-users of products you build on the platform*. Distinct databases, distinct signing keys.
|
|
19
19
|
|
|
20
20
|
## Quick start
|
|
21
21
|
|
|
@@ -33,7 +33,7 @@ const { data } = await platformAuth.client.GET(
|
|
|
33
33
|
);
|
|
34
34
|
|
|
35
35
|
// data.policy — flat array of IAM-style { effect, actions, resources } statements
|
|
36
|
-
// data.services — string[] of enabled services (
|
|
36
|
+
// data.services — string[] of enabled services (mail / waitlist / social / auth / …)
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
The `client` is an [`openapi-fetch`](https://openapi-ts.dev/openapi-fetch/) instance bound to `https://api.auth.productcraft.co` and your auth credential.
|
|
@@ -198,7 +198,7 @@ const { data: policy } = await platformAuth.client.POST(
|
|
|
198
198
|
policy: [
|
|
199
199
|
// Permission action prefixes rebranded (heimdall.* → auth.*, envoi.* → mail.*),
|
|
200
200
|
// but resource-URN namespaces intentionally stay pcft:heimdall: / pcft:envoi: —
|
|
201
|
-
// the services still emit
|
|
201
|
+
// the services still emit the old resource prefixes.
|
|
202
202
|
{ effect: "allow", actions: ["auth.create", "auth.read", "auth.update"], resources: ["pcft:heimdall:app/*"] },
|
|
203
203
|
{ effect: "allow", actions: ["mail.read", "mail.send"], resources: ["*"] },
|
|
204
204
|
],
|
|
@@ -232,7 +232,7 @@ await platformAuth.client.PATCH(
|
|
|
232
232
|
### Service activation
|
|
233
233
|
|
|
234
234
|
```ts
|
|
235
|
-
// Enable / disable a service for the workspace (
|
|
235
|
+
// Enable / disable a service for the workspace (mail, waitlist, social, auth, …)
|
|
236
236
|
await platformAuth.client.PUT(
|
|
237
237
|
"/v1/workspaces/{workspace_slug}/services/{service}",
|
|
238
238
|
{ params: { ... }, body: { enabled: true } },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@productcraft/platform-auth",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
4
|
"description": "PlatformUser auth, workspaces, members, invites, roles + IAM policies, API keys, service activation, and the introspect endpoint every ProductCraft backend uses to resolve permissions. Generated from the production OpenAPI spec.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -35,12 +35,11 @@
|
|
|
35
35
|
},
|
|
36
36
|
"homepage": "https://github.com/clauderanelagh/productcraft-node/tree/main/packages/platform-auth",
|
|
37
37
|
"publishConfig": {
|
|
38
|
-
"access": "public"
|
|
39
|
-
"provenance": true
|
|
38
|
+
"access": "public"
|
|
40
39
|
},
|
|
41
40
|
"dependencies": {
|
|
42
41
|
"openapi-fetch": "^0.13.0",
|
|
43
|
-
"@productcraft/core": "^0.0
|
|
42
|
+
"@productcraft/core": "^0.1.0"
|
|
44
43
|
},
|
|
45
44
|
"scripts": {
|
|
46
45
|
"build": "tsup"
|