@opensoha/contracts 0.1.4 → 0.1.6

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.
Files changed (31) hide show
  1. package/COMPATIBILITY.md +13 -0
  2. package/README.md +6 -0
  3. package/auth/catalog_generated.go +17 -0
  4. package/auth/catalog_test.go +53 -0
  5. package/auth/permission-catalog.json +10991 -0
  6. package/auth/permission-catalog.schema.json +74 -0
  7. package/compat/json-schema-ecosystem-0.1.0.json +1 -1
  8. package/compat/openapi-loose-boundaries-0.1.0.json +1 -1
  9. package/fixtures/json-schema/permission-catalog/invalid/missing-action.json +18 -0
  10. package/fixtures/json-schema/permission-catalog/valid/minimal.json +19 -0
  11. package/fixtures/openapi/AccessRoleInput/invalid/missing-permissions.json +4 -0
  12. package/fixtures/openapi/AccessRoleInput/valid/granular-vm-operator.json +10 -0
  13. package/fixtures/openapi/AuthorizationDecision/invalid/missing-reason.json +7 -0
  14. package/fixtures/openapi/AuthorizationDecision/valid/deny-vm-delete.json +16 -0
  15. package/fixtures/openapi/PermissionCatalogEnvelope/invalid/invalid-hash.json +8 -0
  16. package/fixtures/openapi/PermissionCatalogEnvelope/valid/minimal.json +22 -0
  17. package/fixtures/openapi/SecretCreateRequest/invalid/both-sources.json +12 -0
  18. package/fixtures/openapi/SecretCreateRequest/invalid/missing-vault-version.json +10 -0
  19. package/fixtures/openapi/SecretCreateRequest/invalid/vault-key-newline.json +11 -0
  20. package/fixtures/openapi/SecretCreateRequest/invalid/vault-key-whitespace.json +11 -0
  21. package/fixtures/openapi/SecretCreateRequest/valid/vault-kv2.json +11 -0
  22. package/fixtures/openapi/SecretRotateRequest/invalid/both-sources.json +9 -0
  23. package/fixtures/openapi/SecretRotateRequest/invalid/missing-source.json +1 -0
  24. package/fixtures/openapi/SecretRotateRequest/valid/vault-kv2.json +8 -0
  25. package/gen/go/sohaapi/client.go +1 -1
  26. package/gen/go/sohaapi/types.go +206 -9
  27. package/gen/ts/sohaapi/index.ts +333 -2
  28. package/openapi/soha-api.json +746 -5
  29. package/openapi/soha-api.yaml +297 -3
  30. package/openapi/spec_generated.go +3 -3
  31. package/package.json +7 -3
@@ -4273,6 +4273,56 @@ export interface paths {
4273
4273
  patch?: never;
4274
4274
  trace?: never;
4275
4275
  };
4276
+ "/access/permissions": {
4277
+ parameters: {
4278
+ query?: never;
4279
+ header?: never;
4280
+ path?: never;
4281
+ cookie?: never;
4282
+ };
4283
+ get: operations["getPermissionCatalog"];
4284
+ put?: never;
4285
+ post?: never;
4286
+ delete?: never;
4287
+ options?: never;
4288
+ head?: never;
4289
+ patch?: never;
4290
+ trace?: never;
4291
+ };
4292
+ "/access/roles": {
4293
+ parameters: {
4294
+ query?: never;
4295
+ header?: never;
4296
+ path?: never;
4297
+ cookie?: never;
4298
+ };
4299
+ get: operations["listAccessRoles"];
4300
+ put?: never;
4301
+ post: operations["createAccessRole"];
4302
+ delete?: never;
4303
+ options?: never;
4304
+ head?: never;
4305
+ patch?: never;
4306
+ trace?: never;
4307
+ };
4308
+ "/access/roles/{accessRoleID}": {
4309
+ parameters: {
4310
+ query?: never;
4311
+ header?: never;
4312
+ path: {
4313
+ accessRoleID: components["parameters"]["AccessRoleID"];
4314
+ };
4315
+ cookie?: never;
4316
+ };
4317
+ get: operations["getAccessRole"];
4318
+ put: operations["updateAccessRole"];
4319
+ post?: never;
4320
+ delete: operations["deleteAccessRole"];
4321
+ options?: never;
4322
+ head?: never;
4323
+ patch?: never;
4324
+ trace?: never;
4325
+ };
4276
4326
  "/identity/capabilities": {
4277
4327
  parameters: {
4278
4328
  query?: never;
@@ -5786,6 +5836,107 @@ export interface components {
5786
5836
  items: components["schemas"]["AnyValue"][];
5787
5837
  };
5788
5838
  /** @enum {string} */
5839
+ PermissionRiskLevel: "read" | "mutate" | "execute" | "high";
5840
+ /** @enum {string} */
5841
+ PermissionApprovalPolicy: "never" | "eligible" | "required";
5842
+ /** @enum {string} */
5843
+ PermissionStatus: "active" | "legacy";
5844
+ /** @enum {string} */
5845
+ PermissionScopeKind: "tenant" | "workspace" | "cluster" | "namespace" | "project" | "resource" | "owner";
5846
+ PermissionDefinition: {
5847
+ key: string;
5848
+ domain: string;
5849
+ resource: string;
5850
+ action: string;
5851
+ displayName: string;
5852
+ riskLevel: components["schemas"]["PermissionRiskLevel"];
5853
+ scopeKinds: components["schemas"]["PermissionScopeKind"][];
5854
+ approvalPolicy: components["schemas"]["PermissionApprovalPolicy"];
5855
+ status: components["schemas"]["PermissionStatus"];
5856
+ assignable: boolean;
5857
+ legacyAliases?: string[];
5858
+ /** @description Migration-only role-global action aliases accepted by this exact permission. */
5859
+ legacyCapabilities?: string[];
5860
+ replacedBy?: string[];
5861
+ };
5862
+ PermissionCatalog: {
5863
+ /** @constant */
5864
+ schemaVersion: "authorization.opensoha.io/v1";
5865
+ catalogVersion: string;
5866
+ contentHash: string;
5867
+ permissions: components["schemas"]["PermissionDefinition"][];
5868
+ };
5869
+ PermissionCatalogEnvelope: {
5870
+ data: components["schemas"]["PermissionCatalog"];
5871
+ };
5872
+ AccessRole: {
5873
+ id: string;
5874
+ name: string;
5875
+ scope: string;
5876
+ /**
5877
+ * @deprecated
5878
+ * @description Legacy role-global action aliases retained only for migration.
5879
+ */
5880
+ capabilities: string[];
5881
+ permissionKeys: string[];
5882
+ userCount: number;
5883
+ };
5884
+ AccessRoleInput: {
5885
+ id?: string;
5886
+ name: string;
5887
+ scope: string;
5888
+ /**
5889
+ * @deprecated
5890
+ * @description Legacy role-global action aliases; new role editors must send an empty array.
5891
+ */
5892
+ capabilities?: string[];
5893
+ permissionKeys: string[];
5894
+ };
5895
+ AccessRoleEnvelope: {
5896
+ data: components["schemas"]["AccessRole"];
5897
+ };
5898
+ AccessRoleListEnvelope: {
5899
+ items: components["schemas"]["AccessRole"][];
5900
+ };
5901
+ AccessRoleDeleteResult: {
5902
+ /** @constant */
5903
+ status: "ok";
5904
+ };
5905
+ /** @enum {string} */
5906
+ AuthorizationDecisionStatus: "allow" | "deny" | "approval_required";
5907
+ AuthorizationResource: {
5908
+ type: string;
5909
+ id?: string;
5910
+ tenantId?: string;
5911
+ workspaceId?: string;
5912
+ clusterId?: string;
5913
+ namespace?: string;
5914
+ projectId?: string;
5915
+ owner?: string;
5916
+ labels?: {
5917
+ [key: string]: string;
5918
+ };
5919
+ };
5920
+ AuthorizationEffectiveScope: {
5921
+ tenantIds?: string[];
5922
+ workspaceIds?: string[];
5923
+ clusterIds?: string[];
5924
+ namespaces?: string[];
5925
+ projectIds?: string[];
5926
+ resourceKinds?: string[];
5927
+ labelSelector?: string;
5928
+ };
5929
+ AuthorizationDecision: {
5930
+ status: components["schemas"]["AuthorizationDecisionStatus"];
5931
+ permissionKey: string;
5932
+ action: string;
5933
+ resource: components["schemas"]["AuthorizationResource"];
5934
+ effectiveScope?: components["schemas"]["AuthorizationEffectiveScope"];
5935
+ reasonCode: string;
5936
+ policyVersion: string;
5937
+ allowedActions?: string[];
5938
+ };
5939
+ /** @enum {string} */
5789
5940
  ComputeDomain: "virtualization" | "container_runtime" | "agent";
5790
5941
  /** @enum {string} */
5791
5942
  ComputeProviderDomain: "virtualization" | "container_runtime";
@@ -10071,6 +10222,12 @@ export interface components {
10071
10222
  SecretReferenceMap: {
10072
10223
  [key: string]: string;
10073
10224
  };
10225
+ SecretVaultKV2Reference: {
10226
+ mount: string;
10227
+ path: string;
10228
+ key: string;
10229
+ version: number;
10230
+ };
10074
10231
  SecretMetadata: {
10075
10232
  id: string;
10076
10233
  name: string;
@@ -10086,9 +10243,11 @@ export interface components {
10086
10243
  /** Format: date-time */
10087
10244
  updatedAt: string;
10088
10245
  };
10246
+ /** @description Exactly one of value or vaultKv2 must be provided. */
10089
10247
  SecretCreateRequest: {
10090
10248
  name: string;
10091
- value: string;
10249
+ value?: string;
10250
+ vaultKv2?: components["schemas"]["SecretVaultKV2Reference"];
10092
10251
  description?: string;
10093
10252
  scopeType: components["schemas"]["SecretScopeType"];
10094
10253
  scopeId: string;
@@ -10100,8 +10259,10 @@ export interface components {
10100
10259
  status?: components["schemas"]["SecretStatus"];
10101
10260
  bindings?: components["schemas"]["SecretBinding"][];
10102
10261
  };
10262
+ /** @description Exactly one of value or vaultKv2 must be provided. */
10103
10263
  SecretRotateRequest: {
10104
- value: string;
10264
+ value?: string;
10265
+ vaultKv2?: components["schemas"]["SecretVaultKV2Reference"];
10105
10266
  };
10106
10267
  SecretVersionMetadata: {
10107
10268
  secretId: string;
@@ -11727,6 +11888,7 @@ export interface components {
11727
11888
  };
11728
11889
  };
11729
11890
  parameters: {
11891
+ AccessRoleID: string;
11730
11892
  IdentityApplicationID: string;
11731
11893
  IdentityProviderID: string;
11732
11894
  IdentityPolicyID: string;
@@ -11990,6 +12152,22 @@ export type RuntimeConfigRollbackRequest = components['schemas']['RuntimeConfigR
11990
12152
  export type GenericObject = components['schemas']['GenericObject'];
11991
12153
  export type GenericDataEnvelope = components['schemas']['GenericDataEnvelope'];
11992
12154
  export type GenericItemsEnvelope = components['schemas']['GenericItemsEnvelope'];
12155
+ export type PermissionRiskLevel = components['schemas']['PermissionRiskLevel'];
12156
+ export type PermissionApprovalPolicy = components['schemas']['PermissionApprovalPolicy'];
12157
+ export type PermissionStatus = components['schemas']['PermissionStatus'];
12158
+ export type PermissionScopeKind = components['schemas']['PermissionScopeKind'];
12159
+ export type PermissionDefinition = components['schemas']['PermissionDefinition'];
12160
+ export type PermissionCatalog = components['schemas']['PermissionCatalog'];
12161
+ export type PermissionCatalogEnvelope = components['schemas']['PermissionCatalogEnvelope'];
12162
+ export type AccessRole = components['schemas']['AccessRole'];
12163
+ export type AccessRoleInput = components['schemas']['AccessRoleInput'];
12164
+ export type AccessRoleEnvelope = components['schemas']['AccessRoleEnvelope'];
12165
+ export type AccessRoleListEnvelope = components['schemas']['AccessRoleListEnvelope'];
12166
+ export type AccessRoleDeleteResult = components['schemas']['AccessRoleDeleteResult'];
12167
+ export type AuthorizationDecisionStatus = components['schemas']['AuthorizationDecisionStatus'];
12168
+ export type AuthorizationResource = components['schemas']['AuthorizationResource'];
12169
+ export type AuthorizationEffectiveScope = components['schemas']['AuthorizationEffectiveScope'];
12170
+ export type AuthorizationDecision = components['schemas']['AuthorizationDecision'];
11993
12171
  export type ComputeDomain = components['schemas']['ComputeDomain'];
11994
12172
  export type ComputeProviderDomain = components['schemas']['ComputeProviderDomain'];
11995
12173
  export type ComputeTaskDomain = components['schemas']['ComputeTaskDomain'];
@@ -12537,6 +12715,7 @@ export type SecretStatus = components['schemas']['SecretStatus'];
12537
12715
  export type SecretVersionStatus = components['schemas']['SecretVersionStatus'];
12538
12716
  export type SecretBinding = components['schemas']['SecretBinding'];
12539
12717
  export type SecretReferenceMap = components['schemas']['SecretReferenceMap'];
12718
+ export type SecretVaultKV2Reference = components['schemas']['SecretVaultKV2Reference'];
12540
12719
  export type SecretMetadata = components['schemas']['SecretMetadata'];
12541
12720
  export type SecretCreateRequest = components['schemas']['SecretCreateRequest'];
12542
12721
  export type SecretUpdateRequest = components['schemas']['SecretUpdateRequest'];
@@ -12709,6 +12888,7 @@ export type DirectoryEmploymentStatus = components['schemas']['DirectoryEmployme
12709
12888
  export type ResponseIdentityError = components['responses']['IdentityError'];
12710
12889
  export type ResponseError = components['responses']['Error'];
12711
12890
  export type ResponseComputeError = components['responses']['ComputeError'];
12891
+ export type ParameterAccessRoleId = components['parameters']['AccessRoleID'];
12712
12892
  export type ParameterIdentityApplicationId = components['parameters']['IdentityApplicationID'];
12713
12893
  export type ParameterIdentityProviderId = components['parameters']['IdentityProviderID'];
12714
12894
  export type ParameterIdentityPolicyId = components['parameters']['IdentityPolicyID'];
@@ -21493,6 +21673,157 @@ export interface operations {
21493
21673
  403: components["responses"]["Error"];
21494
21674
  };
21495
21675
  };
21676
+ getPermissionCatalog: {
21677
+ parameters: {
21678
+ query?: never;
21679
+ header?: never;
21680
+ path?: never;
21681
+ cookie?: never;
21682
+ };
21683
+ requestBody?: never;
21684
+ responses: {
21685
+ /** @description Canonical permission definitions and compatibility metadata. */
21686
+ 200: {
21687
+ headers: {
21688
+ [name: string]: unknown;
21689
+ };
21690
+ content: {
21691
+ "application/json": components["schemas"]["PermissionCatalogEnvelope"];
21692
+ };
21693
+ };
21694
+ 401: components["responses"]["Error"];
21695
+ 403: components["responses"]["Error"];
21696
+ };
21697
+ };
21698
+ listAccessRoles: {
21699
+ parameters: {
21700
+ query?: never;
21701
+ header?: never;
21702
+ path?: never;
21703
+ cookie?: never;
21704
+ };
21705
+ requestBody?: never;
21706
+ responses: {
21707
+ /** @description Access roles. */
21708
+ 200: {
21709
+ headers: {
21710
+ [name: string]: unknown;
21711
+ };
21712
+ content: {
21713
+ "application/json": components["schemas"]["AccessRoleListEnvelope"];
21714
+ };
21715
+ };
21716
+ 401: components["responses"]["Error"];
21717
+ 403: components["responses"]["Error"];
21718
+ };
21719
+ };
21720
+ createAccessRole: {
21721
+ parameters: {
21722
+ query?: never;
21723
+ header?: never;
21724
+ path?: never;
21725
+ cookie?: never;
21726
+ };
21727
+ requestBody: {
21728
+ content: {
21729
+ "application/json": components["schemas"]["AccessRoleInput"];
21730
+ };
21731
+ };
21732
+ responses: {
21733
+ /** @description Created access role. */
21734
+ 201: {
21735
+ headers: {
21736
+ [name: string]: unknown;
21737
+ };
21738
+ content: {
21739
+ "application/json": components["schemas"]["AccessRoleEnvelope"];
21740
+ };
21741
+ };
21742
+ 400: components["responses"]["Error"];
21743
+ 401: components["responses"]["Error"];
21744
+ 403: components["responses"]["Error"];
21745
+ };
21746
+ };
21747
+ getAccessRole: {
21748
+ parameters: {
21749
+ query?: never;
21750
+ header?: never;
21751
+ path: {
21752
+ accessRoleID: components["parameters"]["AccessRoleID"];
21753
+ };
21754
+ cookie?: never;
21755
+ };
21756
+ requestBody?: never;
21757
+ responses: {
21758
+ /** @description Access role detail. */
21759
+ 200: {
21760
+ headers: {
21761
+ [name: string]: unknown;
21762
+ };
21763
+ content: {
21764
+ "application/json": components["schemas"]["AccessRoleEnvelope"];
21765
+ };
21766
+ };
21767
+ 401: components["responses"]["Error"];
21768
+ 403: components["responses"]["Error"];
21769
+ 404: components["responses"]["Error"];
21770
+ };
21771
+ };
21772
+ updateAccessRole: {
21773
+ parameters: {
21774
+ query?: never;
21775
+ header?: never;
21776
+ path: {
21777
+ accessRoleID: components["parameters"]["AccessRoleID"];
21778
+ };
21779
+ cookie?: never;
21780
+ };
21781
+ requestBody: {
21782
+ content: {
21783
+ "application/json": components["schemas"]["AccessRoleInput"];
21784
+ };
21785
+ };
21786
+ responses: {
21787
+ /** @description Updated access role. */
21788
+ 200: {
21789
+ headers: {
21790
+ [name: string]: unknown;
21791
+ };
21792
+ content: {
21793
+ "application/json": components["schemas"]["AccessRoleEnvelope"];
21794
+ };
21795
+ };
21796
+ 400: components["responses"]["Error"];
21797
+ 401: components["responses"]["Error"];
21798
+ 403: components["responses"]["Error"];
21799
+ 404: components["responses"]["Error"];
21800
+ };
21801
+ };
21802
+ deleteAccessRole: {
21803
+ parameters: {
21804
+ query?: never;
21805
+ header?: never;
21806
+ path: {
21807
+ accessRoleID: components["parameters"]["AccessRoleID"];
21808
+ };
21809
+ cookie?: never;
21810
+ };
21811
+ requestBody?: never;
21812
+ responses: {
21813
+ /** @description Access role deleted. */
21814
+ 200: {
21815
+ headers: {
21816
+ [name: string]: unknown;
21817
+ };
21818
+ content: {
21819
+ "application/json": components["schemas"]["AccessRoleDeleteResult"];
21820
+ };
21821
+ };
21822
+ 401: components["responses"]["Error"];
21823
+ 403: components["responses"]["Error"];
21824
+ 404: components["responses"]["Error"];
21825
+ };
21826
+ };
21496
21827
  getIdentityRuntimeCapabilities: {
21497
21828
  parameters: {
21498
21829
  query?: never;