@opensoha/contracts 0.1.5 → 0.1.7
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/COMPATIBILITY.md +13 -0
- package/README.md +6 -0
- package/auth/catalog_generated.go +17 -0
- package/auth/catalog_test.go +53 -0
- package/auth/permission-catalog.json +11097 -0
- package/auth/permission-catalog.schema.json +74 -0
- package/capabilities/cluster-capability-matrix.schema.json +30 -1
- package/compat/json-schema-ecosystem-0.1.0.json +1 -1
- package/compat/openapi-loose-boundaries-0.1.0.json +1 -1
- package/examples/gateway-manifest/minimal.json +6 -6
- package/examples/openapi/agent-run-tool-call-request.json +1 -1
- package/examples/openapi/agent-tool-call-result-envelope.json +1 -1
- package/examples/openapi/gateway-manifest-envelope.json +4 -4
- package/examples/openapi/tool-invocation-request.json +1 -1
- package/examples/openapi/tool-invocation-result-envelope.json +1 -1
- package/examples/plugin-manifest/skill-pack.json +2 -2
- package/examples/skill-manifest/k8s-sre.json +2 -2
- package/examples/token-claims/service-account.json +1 -1
- package/fixtures/json-schema/cluster-capability-matrix/valid/runtime-parity.json +3 -0
- package/fixtures/json-schema/gateway-manifest/valid/minimal.json +4 -4
- package/fixtures/json-schema/permission-catalog/invalid/missing-action.json +18 -0
- package/fixtures/json-schema/permission-catalog/valid/minimal.json +19 -0
- package/fixtures/json-schema/skill-manifest/valid/minimal.json +2 -2
- package/fixtures/json-schema/token-claims/valid/service-account.json +1 -1
- package/fixtures/openapi/AIGatewayManifestEnvelope/valid/minimal.json +1 -1
- package/fixtures/openapi/AccessRoleInput/invalid/missing-permissions.json +4 -0
- package/fixtures/openapi/AccessRoleInput/valid/granular-vm-operator.json +10 -0
- package/fixtures/openapi/AgentInstallationEnvelope/invalid/missing-command.json +7 -0
- package/fixtures/openapi/AgentInstallationEnvelope/valid/minimal.json +8 -0
- package/fixtures/openapi/ApplicationInput/invalid/missing-key.json +4 -0
- package/fixtures/openapi/ApplicationInput/valid/minimal.json +5 -0
- package/fixtures/openapi/AuthorizationDecision/invalid/missing-reason.json +7 -0
- package/fixtures/openapi/AuthorizationDecision/valid/deny-vm-delete.json +16 -0
- package/fixtures/openapi/HelmReleaseImportRequest/invalid/empty-releases.json +10 -0
- package/fixtures/openapi/HelmReleaseImportRequest/valid/managed.json +14 -0
- package/fixtures/openapi/HelmReleaseImportResultEnvelope/invalid/missing-mode.json +20 -0
- package/fixtures/openapi/HelmReleaseImportResultEnvelope/valid/created.json +35 -0
- package/fixtures/openapi/KubernetesImportCandidateListEnvelope/invalid/unknown-kind.json +14 -0
- package/fixtures/openapi/KubernetesImportCandidateListEnvelope/valid/grouped.json +31 -0
- package/fixtures/openapi/KubernetesServiceImportRequest/invalid/unsupported-mode.json +15 -0
- package/fixtures/openapi/KubernetesServiceImportRequest/valid/managed.json +15 -0
- package/fixtures/openapi/KubernetesServiceImportRequest/valid/observe-only.json +15 -0
- package/fixtures/openapi/KubernetesServiceImportResultEnvelope/invalid/missing-mode.json +20 -0
- package/fixtures/openapi/KubernetesServiceImportResultEnvelope/valid/created.json +37 -0
- package/fixtures/openapi/MCPCapabilityListEnvelope/invalid/missing-scopes.json +1 -1
- package/fixtures/openapi/MCPCapabilityListEnvelope/valid/minimal.json +1 -1
- package/fixtures/openapi/ObservabilityDashboardImportResultEnvelope/invalid/missing-dashboard.json +7 -0
- package/fixtures/openapi/ObservabilityDashboardImportResultEnvelope/valid/imported.json +36 -0
- package/fixtures/openapi/ObservabilityGrafanaDashboardImportInput/invalid/missing-data-source.json +3 -0
- package/fixtures/openapi/ObservabilityGrafanaDashboardImportInput/invalid/missing-json.json +3 -0
- package/fixtures/openapi/ObservabilityGrafanaDashboardImportInput/valid/classic.json +4 -0
- package/fixtures/openapi/ObservabilityMetricDataSourceListEnvelope/invalid/missing-name.json +7 -0
- package/fixtures/openapi/ObservabilityMetricDataSourceListEnvelope/valid/list.json +8 -0
- package/fixtures/openapi/PermissionCatalogEnvelope/invalid/invalid-hash.json +8 -0
- package/fixtures/openapi/PermissionCatalogEnvelope/valid/minimal.json +22 -0
- package/fixtures/openapi/PersonalAccessTokenInput/invalid/extra-field.json +1 -1
- package/fixtures/openapi/PersonalAccessTokenInput/valid/create.json +1 -1
- package/fixtures/openapi/RegistryConnectionInput/invalid/missing-type.json +4 -0
- package/fixtures/openapi/RegistryConnectionInput/valid/harbor.json +9 -0
- package/fixtures/openapi/RegistryConnectionListEnvelope/invalid/exposed-secret.json +18 -0
- package/fixtures/openapi/RegistryConnectionListEnvelope/valid/configured.json +19 -0
- package/fixtures/openapi/SoftwarePackage/invalid/unsafe-software-package.json +15 -0
- package/fixtures/openapi/SoftwarePackage/valid/software-package.json +17 -0
- package/fixtures/openapi/SoftwarePackageURLImportRequest/invalid/software-package-url-import-request.json +9 -0
- package/fixtures/openapi/SoftwarePackageURLImportRequest/valid/software-package-url-import-request.json +12 -0
- package/fixtures/openapi/SoftwareStorage/invalid/software-storage.json +6 -0
- package/fixtures/openapi/SoftwareStorage/valid/software-storage.json +22 -0
- package/gen/go/sohaapi/client.go +1 -1
- package/gen/go/sohaapi/types.go +906 -3
- package/gen/ts/sohaapi/index.ts +1603 -71
- package/openapi/soha-api.json +2910 -3
- package/openapi/soha-api.yaml +1759 -165
- package/openapi/spec_generated.go +3 -3
- package/package.json +7 -3
package/COMPATIBILITY.md
CHANGED
|
@@ -281,6 +281,19 @@ rename `operationId`, `operationKind`, `runnerId`, `state`, `occurredAt`,
|
|
|
281
281
|
`evidence`, `finalState`, or `callback`; must not add new required fields; and
|
|
282
282
|
must not narrow existing lifecycle state names or final status values.
|
|
283
283
|
|
|
284
|
+
## Permission Catalog
|
|
285
|
+
|
|
286
|
+
`auth/permission-catalog.json` owns grantable OpenSoha resource/action keys,
|
|
287
|
+
risk and scope metadata, approval posture, and temporary legacy aliases. Its
|
|
288
|
+
`contentHash` covers the ordered permission definitions; the Go `auth` package
|
|
289
|
+
also publishes the full artifact hash.
|
|
290
|
+
|
|
291
|
+
For `0.1.x`, patch releases may add active permission definitions and legacy
|
|
292
|
+
aliases. They must not remove active definitions, change an active key's
|
|
293
|
+
resource/action meaning, or make a legacy alias authorize a broader action.
|
|
294
|
+
Coarse keys become non-assignable before removal, and are removed only after
|
|
295
|
+
role migration and consumer conformance prove no active dependency.
|
|
296
|
+
|
|
284
297
|
## Consumer Adoption
|
|
285
298
|
|
|
286
299
|
Recommended adoption flow:
|
package/README.md
CHANGED
|
@@ -29,6 +29,8 @@ skills/skill-manifest.schema.json Official skill front matter contract
|
|
|
29
29
|
plugins/plugin-manifest.schema.json Plugin and marketplace package manifest
|
|
30
30
|
events/event-envelope.schema.json Shared event envelope contract
|
|
31
31
|
auth/token-claims.schema.json Token/JWT claims contract
|
|
32
|
+
auth/permission-catalog.json Canonical resource/action permission catalog
|
|
33
|
+
auth/permission-catalog.schema.json Permission definition and migration metadata
|
|
32
34
|
connectors/connector-event-envelope.schema.json Connector runtime event batch envelope
|
|
33
35
|
gen/go/sohaapi Go SDK types for stable cross-repo contracts
|
|
34
36
|
gen/ts/sohaapi TypeScript SDK types for stable Web contracts
|
|
@@ -78,6 +80,10 @@ npm run check:generated
|
|
|
78
80
|
temporary directory and compares it to committed files. It must not rewrite
|
|
79
81
|
generated files during a freshness check. The Go `openapi` package exposes
|
|
80
82
|
copies of both formats plus `Version`, `YAMLSHA256`, and `JSONSHA256`.
|
|
83
|
+
The Go `auth` package embeds the canonical permission catalog and exposes its
|
|
84
|
+
catalog version, definition hash, and artifact hash. Refresh it with
|
|
85
|
+
`npm run generate:permissions`; consumers conformance-check their local keys
|
|
86
|
+
against this artifact instead of maintaining a second catalog.
|
|
81
87
|
|
|
82
88
|
The Go client in `gen/go/sohaapi/client.go` intentionally keeps a stable
|
|
83
89
|
hand-written method surface while DTOs are generated from OpenAPI. For
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Code generated from OpenSoha permission contracts. DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
package auth
|
|
4
|
+
|
|
5
|
+
import _ "embed"
|
|
6
|
+
|
|
7
|
+
const (
|
|
8
|
+
PermissionCatalogVersion = "1.3.0"
|
|
9
|
+
PermissionCatalogContentSHA256 = "182dbfb4b9962dc4a0c344c2ce7622ec4424cf5ff0892a73b0b6806eddf6f2c7"
|
|
10
|
+
PermissionCatalogSHA256 = "f9956b1ee4e3d981a4e93e7078006aa915a5eb18fb2347fa0d81bc8346b8958b"
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
//go:embed permission-catalog.json
|
|
14
|
+
var permissionCatalogJSON []byte
|
|
15
|
+
|
|
16
|
+
// PermissionCatalogJSON returns a copy of the canonical permission catalog.
|
|
17
|
+
func PermissionCatalogJSON() []byte { return append([]byte(nil), permissionCatalogJSON...) }
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
package auth
|
|
2
|
+
|
|
3
|
+
import (
|
|
4
|
+
"crypto/sha256"
|
|
5
|
+
"encoding/hex"
|
|
6
|
+
"encoding/json"
|
|
7
|
+
"testing"
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
func TestPermissionCatalogMetadataMatchesEmbeddedArtifact(t *testing.T) {
|
|
11
|
+
raw := PermissionCatalogJSON()
|
|
12
|
+
var catalog struct {
|
|
13
|
+
CatalogVersion string `json:"catalogVersion"`
|
|
14
|
+
ContentHash string `json:"contentHash"`
|
|
15
|
+
}
|
|
16
|
+
if err := json.Unmarshal(raw, &catalog); err != nil {
|
|
17
|
+
t.Fatalf("decode permission catalog: %v", err)
|
|
18
|
+
}
|
|
19
|
+
if catalog.CatalogVersion != PermissionCatalogVersion {
|
|
20
|
+
t.Fatalf("catalog version = %q, want %q", catalog.CatalogVersion, PermissionCatalogVersion)
|
|
21
|
+
}
|
|
22
|
+
if catalog.ContentHash != "sha256:"+PermissionCatalogContentSHA256 {
|
|
23
|
+
t.Fatalf("content hash = %q", catalog.ContentHash)
|
|
24
|
+
}
|
|
25
|
+
sum := sha256.Sum256(raw)
|
|
26
|
+
if got := hex.EncodeToString(sum[:]); got != PermissionCatalogSHA256 {
|
|
27
|
+
t.Fatalf("artifact hash = %q, want %q", got, PermissionCatalogSHA256)
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
func TestPermissionCatalogIncludesVirtualizationStorageView(t *testing.T) {
|
|
32
|
+
var catalog struct {
|
|
33
|
+
Permissions []struct {
|
|
34
|
+
Key string `json:"key"`
|
|
35
|
+
Action string `json:"action"`
|
|
36
|
+
RiskLevel string `json:"riskLevel"`
|
|
37
|
+
Status string `json:"status"`
|
|
38
|
+
Assignable bool `json:"assignable"`
|
|
39
|
+
} `json:"permissions"`
|
|
40
|
+
}
|
|
41
|
+
if err := json.Unmarshal(PermissionCatalogJSON(), &catalog); err != nil {
|
|
42
|
+
t.Fatalf("decode permission catalog: %v", err)
|
|
43
|
+
}
|
|
44
|
+
for _, permission := range catalog.Permissions {
|
|
45
|
+
if permission.Key == "virtualization.storage.view" {
|
|
46
|
+
if permission.Action != "view" || permission.RiskLevel != "read" || permission.Status != "active" || !permission.Assignable {
|
|
47
|
+
t.Fatalf("unexpected storage permission: %#v", permission)
|
|
48
|
+
}
|
|
49
|
+
return
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
t.Fatal("virtualization.storage.view is missing")
|
|
53
|
+
}
|