@vantageos/cloud-identity 0.2.0 → 0.4.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/CHANGELOG.md +77 -1
- package/LICENSE +105 -16
- package/README.md +279 -155
- package/dist/bearer-validation.d.ts +2 -3
- package/dist/bearer-validation.d.ts.map +1 -1
- package/dist/bearer-validation.js +2 -3
- package/dist/bearer-validation.js.map +1 -1
- package/dist/crypto.d.ts +3 -5
- package/dist/crypto.d.ts.map +1 -1
- package/dist/crypto.js +3 -5
- package/dist/crypto.js.map +1 -1
- package/dist/human-path.d.ts +95 -0
- package/dist/human-path.d.ts.map +1 -0
- package/dist/human-path.js +117 -0
- package/dist/human-path.js.map +1 -0
- package/dist/index.d.ts +8 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -4
- package/dist/index.js.map +1 -1
- package/dist/org-guard.d.ts +95 -0
- package/dist/org-guard.d.ts.map +1 -0
- package/dist/org-guard.js +77 -0
- package/dist/org-guard.js.map +1 -0
- package/dist/scope-filter.d.ts +33 -18
- package/dist/scope-filter.d.ts.map +1 -1
- package/dist/scope-filter.js +44 -19
- package/dist/scope-filter.js.map +1 -1
- package/dist/tenancy-domain.d.ts +4 -8
- package/dist/tenancy-domain.d.ts.map +1 -1
- package/dist/tenancy-domain.js +4 -8
- package/dist/tenancy-domain.js.map +1 -1
- package/package.json +6 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,82 @@
|
|
|
3
3
|
All notable changes to `@vantageos/cloud-identity` are documented here.
|
|
4
4
|
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
5
5
|
|
|
6
|
+
## [0.4.0]
|
|
7
|
+
|
|
8
|
+
**Additive.** Two new primitives so one identity layer covers both deployment
|
|
9
|
+
shapes and the human sign-in path — no separate self-host layer, no change to
|
|
10
|
+
the Cloud/machine path. Serves Tau's `vantage-starter` self-host install and
|
|
11
|
+
the Hephaistos human-path onboarding, both stalled on this surface.
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- **Named deployment mode** — `DeploymentMode` (`"cloud" | "self-host"`) and a
|
|
16
|
+
`{ kind: "self-host"; tenantId }` branch on `TenantSource` / `requireTenantId`
|
|
17
|
+
(`src/org-guard.ts`). `cloud` keeps the existing fail-closed behaviour
|
|
18
|
+
unchanged (org/workspace required on every request — invariant #1123 holds,
|
|
19
|
+
0.4.0 reopens nothing). `self-host` is single-tenant: `requireTenantId`
|
|
20
|
+
returns the configured `tenantId` only when it is a non-empty string, and
|
|
21
|
+
**throws** otherwise — the tenant is presented explicitly by configuration,
|
|
22
|
+
never inferred from the absence of an organization.
|
|
23
|
+
- **Human-path resolver** — `normalizeVerifiedHumanSession()` (`src/human-path.ts`,
|
|
24
|
+
new `./human-path` subpath export) maps an already-*verified*, framework-agnostic
|
|
25
|
+
Clerk-shaped session (`{ orgId, userId, orgRole }`) to
|
|
26
|
+
`{ tenant, subject, role }`. `role` is a new union `HumanAccountRole`
|
|
27
|
+
(`owner | admin | member | client`), distinct from `workspaceRoleSchema`
|
|
28
|
+
(`Admin | Editor | Viewer`) and never conflated. No Clerk SDK is imported.
|
|
29
|
+
Refuses (throws) on no session, no org, no user id, or an unrecognized/absent
|
|
30
|
+
org role — presented, never inferred. **Naming fix, still pre-publish:** this
|
|
31
|
+
function was originally named `resolveHumanIdentity`, which invited passing
|
|
32
|
+
in an unverified, client-supplied object (e.g. `req.body`) and would make
|
|
33
|
+
that object the trusted source of tenant/subject/role — a
|
|
34
|
+
privilege-escalation risk. Renamed to `normalizeVerifiedHumanSession` before
|
|
35
|
+
0.4.0 reaches npm (current published latest is 0.3.0) to make the
|
|
36
|
+
already-verified precondition explicit at the call-site, mirroring
|
|
37
|
+
`decodeUnverifiedBearer`'s rename from `resolveBearer` in 0.2.0. Not a
|
|
38
|
+
breaking change — 0.4.0 has no npm consumer yet.
|
|
39
|
+
|
|
40
|
+
### Notes
|
|
41
|
+
|
|
42
|
+
- Purely additive: every 0.3.0 export (`passesScopeFilter`, `scopeFilterList`,
|
|
43
|
+
`scopeFilterGet`, `validateMasterBearer`, `getEffectiveTenantId`,
|
|
44
|
+
`decodeUnverifiedBearer`, `requireTenantId`'s `session`/`bearer` branches, …)
|
|
45
|
+
is behaviorally unchanged. Full suite 87/87, `tsc --noEmit` 0.
|
|
46
|
+
|
|
47
|
+
## [Unreleased] - 0.3.0
|
|
48
|
+
|
|
49
|
+
**BREAKING.** Closes two measured 0.2.0 defects — a right must never be
|
|
50
|
+
granted by absence.
|
|
51
|
+
|
|
52
|
+
### Changed (breaking)
|
|
53
|
+
|
|
54
|
+
- `passesScopeFilter`, `scopeFilterList`, `scopeFilterGet`, `isMasterScope`,
|
|
55
|
+
`isWildcardScope`: `oauthCtx` is now **mandatory** (`OAuthCtx`, no longer
|
|
56
|
+
`OAuthCtx | undefined`). The 0.2.0 behaviour of an omitted `oauthCtx`
|
|
57
|
+
silently passing every row (wildcard, as if master-scoped) is removed.
|
|
58
|
+
Omitting the argument now breaks the caller's build; at runtime (for
|
|
59
|
+
callers that bypass TypeScript) it throws instead of granting access.
|
|
60
|
+
Callers that deliberately want the old legacy-bearer wildcard behaviour
|
|
61
|
+
must import and pass the new `LEGACY_WILDCARD_CTX` sentinel explicitly.
|
|
62
|
+
|
|
63
|
+
### Added
|
|
64
|
+
|
|
65
|
+
- `LEGACY_WILDCARD_CTX` — explicit, by-name opt-in for the pre-0.3.0
|
|
66
|
+
legacy-bearer wildcard behaviour (`src/scope-filter.ts`).
|
|
67
|
+
- `requireTenantId(source: TenantSource): string` — organization/workspace
|
|
68
|
+
membership guard, unifying the human (session) and machine (bearer) entry
|
|
69
|
+
paths behind one contract. Refuses on missing session, missing/empty `orgId`, and
|
|
70
|
+
missing/empty bearer-resolved `workspaceId` (`src/org-guard.ts`).
|
|
71
|
+
- `SessionIdentity`, `TenantSource` types.
|
|
72
|
+
|
|
73
|
+
### Scope note
|
|
74
|
+
|
|
75
|
+
The package now exposes, behind one contract, all four primitives an
|
|
76
|
+
application needs and should never reimplement: tenant resolution
|
|
77
|
+
(`getEffectiveTenantId`), membership requirement (`requireTenantId`), row
|
|
78
|
+
filtering (`passesScopeFilter` / `scopeFilterList` / `scopeFilterGet`), and
|
|
79
|
+
identifier validation (`validateMasterBearer`). Framework adapters (Convex,
|
|
80
|
+
Hono, etc.) wrap these; they must not reimplement the checks.
|
|
81
|
+
|
|
6
82
|
## [0.2.0] - 2026-06-13
|
|
7
83
|
|
|
8
84
|
Additive release — domain-tenancy layer. No breaking changes. All 0.1.0 exports unchanged.
|
|
@@ -38,5 +114,5 @@ Initial release.
|
|
|
38
114
|
- Public type surface: `OAuthCtx`, `ScopeProfile`, `NamespacePrefix`, `FromAllowListEntry`, `ValidateMasterBearerResult`.
|
|
39
115
|
|
|
40
116
|
### Notes
|
|
41
|
-
- `getEffectiveWorkspaceId` deferred to 0.2.0
|
|
117
|
+
- `getEffectiveWorkspaceId` deferred to 0.2.0.
|
|
42
118
|
- No `provenance: true` in `publishConfig` — provenance only from CI per fleet friction lesson `npm-publish-provenance-only-from-ci-not-local-host`.
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,110 @@
|
|
|
1
|
-
|
|
1
|
+
Functional Source License, Version 1.1, Apache 2.0 Future License
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Abbreviation
|
|
4
4
|
|
|
5
|
-
|
|
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:
|
|
5
|
+
FSL-1.1-Apache-2.0
|
|
11
6
|
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
Notice
|
|
8
|
+
|
|
9
|
+
Copyright 2026 VantageOS (ElPi Corp)
|
|
10
|
+
|
|
11
|
+
Terms and Conditions
|
|
12
|
+
|
|
13
|
+
Licensor: VantageOS (ElPi Corp)
|
|
14
|
+
|
|
15
|
+
Licensed Work: VantagePeers
|
|
16
|
+
The Licensed Work is (c) 2026 VantageOS (ElPi Corp)
|
|
17
|
+
|
|
18
|
+
Additional Use Grant: You may make production use of the Licensed Work,
|
|
19
|
+
provided Your use does not include offering the Licensed
|
|
20
|
+
Work to third parties as a hosted or managed service
|
|
21
|
+
where the service provides users with access to any
|
|
22
|
+
substantial set of the features or functionality of the
|
|
23
|
+
Licensed Work.
|
|
24
|
+
|
|
25
|
+
Change Date: 2028-04-03 (two years from publication)
|
|
26
|
+
|
|
27
|
+
Change License: Apache License, Version 2.0
|
|
28
|
+
|
|
29
|
+
For information about alternative licensing arrangements for the Licensed Work,
|
|
30
|
+
please contact: contact@vantageos.com
|
|
31
|
+
|
|
32
|
+
License text below is provided for informational purposes only.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
Functional Source License, Version 1.1, Apache 2.0 Future License
|
|
37
|
+
|
|
38
|
+
1. Purpose
|
|
39
|
+
|
|
40
|
+
This license gives you broad permission to use, modify, and share this
|
|
41
|
+
software, with one important condition: you may not use it to compete with us.
|
|
42
|
+
|
|
43
|
+
2. Acceptance
|
|
44
|
+
|
|
45
|
+
To use the software, you must agree to these terms. If you do not agree, you
|
|
46
|
+
may not use the software.
|
|
47
|
+
|
|
48
|
+
3. Copyright License
|
|
49
|
+
|
|
50
|
+
The licensor grants you a non-exclusive, royalty-free, worldwide, non-
|
|
51
|
+
sublicensable, non-transferable license to use, copy, distribute, make
|
|
52
|
+
available, and prepare derivative works of the software, in each case subject
|
|
53
|
+
to the limitations below.
|
|
54
|
+
|
|
55
|
+
4. Limitations
|
|
56
|
+
|
|
57
|
+
You may not make the functionality of the software available to third parties
|
|
58
|
+
as a service, or otherwise use the software to provide a service to third
|
|
59
|
+
parties that competes with the licensor.
|
|
60
|
+
|
|
61
|
+
5. Patents
|
|
62
|
+
|
|
63
|
+
The licensor grants you a license, under any patent claims the licensor can
|
|
64
|
+
license or becomes able to license, to make, have made, use, sell, offer for
|
|
65
|
+
sale, import, and have imported the software, in each case subject to the
|
|
66
|
+
limitations and conditions in this license.
|
|
67
|
+
|
|
68
|
+
6. Fair Use
|
|
69
|
+
|
|
70
|
+
This license is not intended to limit any rights you may have under applicable
|
|
71
|
+
fair use or other laws.
|
|
72
|
+
|
|
73
|
+
7. No Other Rights
|
|
74
|
+
|
|
75
|
+
These terms do not grant any other rights. The licensor reserves all rights not
|
|
76
|
+
expressly granted.
|
|
77
|
+
|
|
78
|
+
8. Termination
|
|
79
|
+
|
|
80
|
+
Your license is automatically terminated if you violate the terms. However, if
|
|
81
|
+
you cure the violation within 30 days of discovering it, your license is
|
|
82
|
+
reinstated retroactively.
|
|
83
|
+
|
|
84
|
+
9. Disclaimer
|
|
14
85
|
|
|
15
86
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
SOFTWARE.
|
|
87
|
+
IMPLIED.
|
|
88
|
+
|
|
89
|
+
10. Limitation of Liability
|
|
90
|
+
|
|
91
|
+
TO THE EXTENT PERMITTED BY LAW, THE LICENSOR IS NOT LIABLE FOR ANY DAMAGES
|
|
92
|
+
ARISING FROM THE USE OF THE SOFTWARE.
|
|
93
|
+
|
|
94
|
+
11. Change Date and License
|
|
95
|
+
|
|
96
|
+
After the Change Date, the licensor grants you the rights under the Change
|
|
97
|
+
License.
|
|
98
|
+
|
|
99
|
+
12. Definitions
|
|
100
|
+
|
|
101
|
+
"Compete" means providing a product or service that is substantially similar
|
|
102
|
+
to, or a replacement for, all or a significant portion of the Licensed Work.
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
Apache License, Version 2.0
|
|
107
|
+
|
|
108
|
+
After the Change Date (2028-04-03), this software will be available under the
|
|
109
|
+
Apache License, Version 2.0. See https://www.apache.org/licenses/LICENSE-2.0
|
|
110
|
+
for full text.
|