@opensoha/contracts 0.1.5 → 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.
@@ -57,6 +57,16 @@
57
57
  }
58
58
  },
59
59
  "parameters": {
60
+ "AccessRoleID": {
61
+ "in": "path",
62
+ "name": "accessRoleID",
63
+ "required": true,
64
+ "schema": {
65
+ "maxLength": 128,
66
+ "minLength": 1,
67
+ "type": "string"
68
+ }
69
+ },
60
70
  "AgentProviderRolloutAction": {
61
71
  "in": "path",
62
72
  "name": "rolloutAction",
@@ -871,6 +881,135 @@
871
881
  }
872
882
  },
873
883
  "schemas": {
884
+ "AccessRole": {
885
+ "additionalProperties": false,
886
+ "properties": {
887
+ "capabilities": {
888
+ "deprecated": true,
889
+ "description": "Legacy role-global action aliases retained only for migration.",
890
+ "items": {
891
+ "minLength": 1,
892
+ "type": "string"
893
+ },
894
+ "type": "array",
895
+ "uniqueItems": true
896
+ },
897
+ "id": {
898
+ "minLength": 1,
899
+ "type": "string"
900
+ },
901
+ "name": {
902
+ "minLength": 1,
903
+ "type": "string"
904
+ },
905
+ "permissionKeys": {
906
+ "items": {
907
+ "minLength": 1,
908
+ "type": "string"
909
+ },
910
+ "type": "array",
911
+ "uniqueItems": true
912
+ },
913
+ "scope": {
914
+ "minLength": 1,
915
+ "type": "string"
916
+ },
917
+ "userCount": {
918
+ "minimum": 0,
919
+ "type": "integer"
920
+ }
921
+ },
922
+ "required": [
923
+ "id",
924
+ "name",
925
+ "scope",
926
+ "capabilities",
927
+ "permissionKeys",
928
+ "userCount"
929
+ ],
930
+ "type": "object"
931
+ },
932
+ "AccessRoleDeleteResult": {
933
+ "additionalProperties": false,
934
+ "properties": {
935
+ "status": {
936
+ "const": "ok",
937
+ "type": "string"
938
+ }
939
+ },
940
+ "required": [
941
+ "status"
942
+ ],
943
+ "type": "object"
944
+ },
945
+ "AccessRoleEnvelope": {
946
+ "additionalProperties": false,
947
+ "properties": {
948
+ "data": {
949
+ "$ref": "#/components/schemas/AccessRole"
950
+ }
951
+ },
952
+ "required": [
953
+ "data"
954
+ ],
955
+ "type": "object"
956
+ },
957
+ "AccessRoleInput": {
958
+ "additionalProperties": false,
959
+ "properties": {
960
+ "capabilities": {
961
+ "deprecated": true,
962
+ "description": "Legacy role-global action aliases; new role editors must send an empty array.",
963
+ "items": {
964
+ "minLength": 1,
965
+ "type": "string"
966
+ },
967
+ "type": "array",
968
+ "uniqueItems": true
969
+ },
970
+ "id": {
971
+ "minLength": 1,
972
+ "type": "string"
973
+ },
974
+ "name": {
975
+ "minLength": 1,
976
+ "type": "string"
977
+ },
978
+ "permissionKeys": {
979
+ "items": {
980
+ "minLength": 1,
981
+ "type": "string"
982
+ },
983
+ "type": "array",
984
+ "uniqueItems": true
985
+ },
986
+ "scope": {
987
+ "minLength": 1,
988
+ "type": "string"
989
+ }
990
+ },
991
+ "required": [
992
+ "name",
993
+ "scope",
994
+ "permissionKeys"
995
+ ],
996
+ "type": "object"
997
+ },
998
+ "AccessRoleListEnvelope": {
999
+ "additionalProperties": false,
1000
+ "properties": {
1001
+ "items": {
1002
+ "items": {
1003
+ "$ref": "#/components/schemas/AccessRole"
1004
+ },
1005
+ "type": "array"
1006
+ }
1007
+ },
1008
+ "required": [
1009
+ "items"
1010
+ ],
1011
+ "type": "object"
1012
+ },
874
1013
  "AgentProviderCatalog": {
875
1014
  "additionalProperties": false,
876
1015
  "properties": {
@@ -5179,6 +5318,157 @@
5179
5318
  ],
5180
5319
  "type": "object"
5181
5320
  },
5321
+ "AuthorizationDecision": {
5322
+ "additionalProperties": false,
5323
+ "properties": {
5324
+ "action": {
5325
+ "minLength": 1,
5326
+ "type": "string"
5327
+ },
5328
+ "allowedActions": {
5329
+ "items": {
5330
+ "minLength": 1,
5331
+ "type": "string"
5332
+ },
5333
+ "type": "array",
5334
+ "uniqueItems": true
5335
+ },
5336
+ "effectiveScope": {
5337
+ "$ref": "#/components/schemas/AuthorizationEffectiveScope"
5338
+ },
5339
+ "permissionKey": {
5340
+ "minLength": 1,
5341
+ "type": "string"
5342
+ },
5343
+ "policyVersion": {
5344
+ "minLength": 1,
5345
+ "type": "string"
5346
+ },
5347
+ "reasonCode": {
5348
+ "minLength": 1,
5349
+ "type": "string"
5350
+ },
5351
+ "resource": {
5352
+ "$ref": "#/components/schemas/AuthorizationResource"
5353
+ },
5354
+ "status": {
5355
+ "$ref": "#/components/schemas/AuthorizationDecisionStatus"
5356
+ }
5357
+ },
5358
+ "required": [
5359
+ "status",
5360
+ "permissionKey",
5361
+ "action",
5362
+ "resource",
5363
+ "reasonCode",
5364
+ "policyVersion"
5365
+ ],
5366
+ "type": "object"
5367
+ },
5368
+ "AuthorizationDecisionStatus": {
5369
+ "enum": [
5370
+ "allow",
5371
+ "deny",
5372
+ "approval_required"
5373
+ ],
5374
+ "type": "string",
5375
+ "x-enum-varnames": [
5376
+ "AuthorizationDecisionStatusAllow",
5377
+ "AuthorizationDecisionStatusDeny",
5378
+ "AuthorizationDecisionStatusApprovalRequired"
5379
+ ]
5380
+ },
5381
+ "AuthorizationEffectiveScope": {
5382
+ "additionalProperties": false,
5383
+ "properties": {
5384
+ "clusterIds": {
5385
+ "items": {
5386
+ "type": "string"
5387
+ },
5388
+ "type": "array",
5389
+ "uniqueItems": true
5390
+ },
5391
+ "labelSelector": {
5392
+ "type": "string"
5393
+ },
5394
+ "namespaces": {
5395
+ "items": {
5396
+ "type": "string"
5397
+ },
5398
+ "type": "array",
5399
+ "uniqueItems": true
5400
+ },
5401
+ "projectIds": {
5402
+ "items": {
5403
+ "type": "string"
5404
+ },
5405
+ "type": "array",
5406
+ "uniqueItems": true
5407
+ },
5408
+ "resourceKinds": {
5409
+ "items": {
5410
+ "type": "string"
5411
+ },
5412
+ "type": "array",
5413
+ "uniqueItems": true
5414
+ },
5415
+ "tenantIds": {
5416
+ "items": {
5417
+ "type": "string"
5418
+ },
5419
+ "type": "array",
5420
+ "uniqueItems": true
5421
+ },
5422
+ "workspaceIds": {
5423
+ "items": {
5424
+ "type": "string"
5425
+ },
5426
+ "type": "array",
5427
+ "uniqueItems": true
5428
+ }
5429
+ },
5430
+ "type": "object"
5431
+ },
5432
+ "AuthorizationResource": {
5433
+ "additionalProperties": false,
5434
+ "properties": {
5435
+ "clusterId": {
5436
+ "type": "string"
5437
+ },
5438
+ "id": {
5439
+ "type": "string"
5440
+ },
5441
+ "labels": {
5442
+ "additionalProperties": {
5443
+ "type": "string"
5444
+ },
5445
+ "type": "object"
5446
+ },
5447
+ "namespace": {
5448
+ "type": "string"
5449
+ },
5450
+ "owner": {
5451
+ "type": "string"
5452
+ },
5453
+ "projectId": {
5454
+ "type": "string"
5455
+ },
5456
+ "tenantId": {
5457
+ "type": "string"
5458
+ },
5459
+ "type": {
5460
+ "minLength": 1,
5461
+ "type": "string"
5462
+ },
5463
+ "workspaceId": {
5464
+ "type": "string"
5465
+ }
5466
+ },
5467
+ "required": [
5468
+ "type"
5469
+ ],
5470
+ "type": "object"
5471
+ },
5182
5472
  "AuthProvider": {
5183
5473
  "additionalProperties": false,
5184
5474
  "properties": {
@@ -20936,6 +21226,192 @@
20936
21226
  ],
20937
21227
  "type": "object"
20938
21228
  },
21229
+ "PermissionApprovalPolicy": {
21230
+ "enum": [
21231
+ "never",
21232
+ "eligible",
21233
+ "required"
21234
+ ],
21235
+ "type": "string",
21236
+ "x-enum-varnames": [
21237
+ "PermissionApprovalPolicyNever",
21238
+ "PermissionApprovalPolicyEligible",
21239
+ "PermissionApprovalPolicyRequired"
21240
+ ]
21241
+ },
21242
+ "PermissionCatalog": {
21243
+ "additionalProperties": false,
21244
+ "properties": {
21245
+ "catalogVersion": {
21246
+ "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$",
21247
+ "type": "string"
21248
+ },
21249
+ "contentHash": {
21250
+ "pattern": "^sha256:[a-f0-9]{64}$",
21251
+ "type": "string"
21252
+ },
21253
+ "permissions": {
21254
+ "items": {
21255
+ "$ref": "#/components/schemas/PermissionDefinition"
21256
+ },
21257
+ "minItems": 1,
21258
+ "type": "array"
21259
+ },
21260
+ "schemaVersion": {
21261
+ "const": "authorization.opensoha.io/v1",
21262
+ "type": "string"
21263
+ }
21264
+ },
21265
+ "required": [
21266
+ "schemaVersion",
21267
+ "catalogVersion",
21268
+ "contentHash",
21269
+ "permissions"
21270
+ ],
21271
+ "type": "object"
21272
+ },
21273
+ "PermissionCatalogEnvelope": {
21274
+ "additionalProperties": false,
21275
+ "properties": {
21276
+ "data": {
21277
+ "$ref": "#/components/schemas/PermissionCatalog"
21278
+ }
21279
+ },
21280
+ "required": [
21281
+ "data"
21282
+ ],
21283
+ "type": "object"
21284
+ },
21285
+ "PermissionDefinition": {
21286
+ "additionalProperties": false,
21287
+ "properties": {
21288
+ "action": {
21289
+ "pattern": "^[a-z][a-z0-9_-]*$",
21290
+ "type": "string"
21291
+ },
21292
+ "approvalPolicy": {
21293
+ "$ref": "#/components/schemas/PermissionApprovalPolicy"
21294
+ },
21295
+ "assignable": {
21296
+ "type": "boolean"
21297
+ },
21298
+ "displayName": {
21299
+ "minLength": 1,
21300
+ "type": "string"
21301
+ },
21302
+ "domain": {
21303
+ "pattern": "^[a-z][a-z0-9_-]*$",
21304
+ "type": "string"
21305
+ },
21306
+ "key": {
21307
+ "pattern": "^[a-z][a-z0-9_-]*(?:\\.[a-z][a-z0-9_-]*)+$",
21308
+ "type": "string"
21309
+ },
21310
+ "legacyAliases": {
21311
+ "items": {
21312
+ "minLength": 1,
21313
+ "type": "string"
21314
+ },
21315
+ "type": "array",
21316
+ "uniqueItems": true
21317
+ },
21318
+ "legacyCapabilities": {
21319
+ "description": "Migration-only role-global action aliases accepted by this exact permission.",
21320
+ "items": {
21321
+ "pattern": "^[a-z][a-z0-9_-]*$",
21322
+ "type": "string"
21323
+ },
21324
+ "type": "array",
21325
+ "uniqueItems": true
21326
+ },
21327
+ "replacedBy": {
21328
+ "items": {
21329
+ "minLength": 1,
21330
+ "type": "string"
21331
+ },
21332
+ "type": "array",
21333
+ "uniqueItems": true
21334
+ },
21335
+ "resource": {
21336
+ "pattern": "^[a-z][a-z0-9_.-]*$",
21337
+ "type": "string"
21338
+ },
21339
+ "riskLevel": {
21340
+ "$ref": "#/components/schemas/PermissionRiskLevel"
21341
+ },
21342
+ "scopeKinds": {
21343
+ "items": {
21344
+ "$ref": "#/components/schemas/PermissionScopeKind"
21345
+ },
21346
+ "minItems": 1,
21347
+ "type": "array",
21348
+ "uniqueItems": true
21349
+ },
21350
+ "status": {
21351
+ "$ref": "#/components/schemas/PermissionStatus"
21352
+ }
21353
+ },
21354
+ "required": [
21355
+ "key",
21356
+ "domain",
21357
+ "resource",
21358
+ "action",
21359
+ "displayName",
21360
+ "riskLevel",
21361
+ "scopeKinds",
21362
+ "approvalPolicy",
21363
+ "status",
21364
+ "assignable"
21365
+ ],
21366
+ "type": "object"
21367
+ },
21368
+ "PermissionRiskLevel": {
21369
+ "enum": [
21370
+ "read",
21371
+ "mutate",
21372
+ "execute",
21373
+ "high"
21374
+ ],
21375
+ "type": "string",
21376
+ "x-enum-varnames": [
21377
+ "PermissionRiskLevelRead",
21378
+ "PermissionRiskLevelMutate",
21379
+ "PermissionRiskLevelExecute",
21380
+ "PermissionRiskLevelHigh"
21381
+ ]
21382
+ },
21383
+ "PermissionScopeKind": {
21384
+ "enum": [
21385
+ "tenant",
21386
+ "workspace",
21387
+ "cluster",
21388
+ "namespace",
21389
+ "project",
21390
+ "resource",
21391
+ "owner"
21392
+ ],
21393
+ "type": "string",
21394
+ "x-enum-varnames": [
21395
+ "PermissionScopeKindTenant",
21396
+ "PermissionScopeKindWorkspace",
21397
+ "PermissionScopeKindCluster",
21398
+ "PermissionScopeKindNamespace",
21399
+ "PermissionScopeKindProject",
21400
+ "PermissionScopeKindResource",
21401
+ "PermissionScopeKindOwner"
21402
+ ]
21403
+ },
21404
+ "PermissionStatus": {
21405
+ "enum": [
21406
+ "active",
21407
+ "legacy"
21408
+ ],
21409
+ "type": "string",
21410
+ "x-enum-varnames": [
21411
+ "PermissionStatusActive",
21412
+ "PermissionStatusLegacy"
21413
+ ]
21414
+ },
20939
21415
  "PersonalAccessToken": {
20940
21416
  "additionalProperties": false,
20941
21417
  "properties": {
@@ -27056,7 +27532,7 @@
27056
27532
  "info": {
27057
27533
  "description": "Public OpenSoha core API contract. This first contract focuses on stable cross-repository boundaries: auth, health, runner-facing control-plane callbacks, AI Gateway, and MCP capability discovery.\n",
27058
27534
  "title": "Soha API",
27059
- "version": "0.1.5"
27535
+ "version": "0.1.6"
27060
27536
  },
27061
27537
  "openapi": "3.1.0",
27062
27538
  "paths": {
@@ -27190,6 +27666,196 @@
27190
27666
  ]
27191
27667
  }
27192
27668
  },
27669
+ "/access/permissions": {
27670
+ "get": {
27671
+ "operationId": "getPermissionCatalog",
27672
+ "responses": {
27673
+ "200": {
27674
+ "content": {
27675
+ "application/json": {
27676
+ "schema": {
27677
+ "$ref": "#/components/schemas/PermissionCatalogEnvelope"
27678
+ }
27679
+ }
27680
+ },
27681
+ "description": "Canonical permission definitions and compatibility metadata."
27682
+ },
27683
+ "401": {
27684
+ "$ref": "#/components/responses/Error"
27685
+ },
27686
+ "403": {
27687
+ "$ref": "#/components/responses/Error"
27688
+ }
27689
+ },
27690
+ "tags": [
27691
+ "Access"
27692
+ ]
27693
+ }
27694
+ },
27695
+ "/access/roles": {
27696
+ "get": {
27697
+ "operationId": "listAccessRoles",
27698
+ "responses": {
27699
+ "200": {
27700
+ "content": {
27701
+ "application/json": {
27702
+ "schema": {
27703
+ "$ref": "#/components/schemas/AccessRoleListEnvelope"
27704
+ }
27705
+ }
27706
+ },
27707
+ "description": "Access roles."
27708
+ },
27709
+ "401": {
27710
+ "$ref": "#/components/responses/Error"
27711
+ },
27712
+ "403": {
27713
+ "$ref": "#/components/responses/Error"
27714
+ }
27715
+ },
27716
+ "tags": [
27717
+ "Access"
27718
+ ]
27719
+ },
27720
+ "post": {
27721
+ "operationId": "createAccessRole",
27722
+ "requestBody": {
27723
+ "content": {
27724
+ "application/json": {
27725
+ "schema": {
27726
+ "$ref": "#/components/schemas/AccessRoleInput"
27727
+ }
27728
+ }
27729
+ },
27730
+ "required": true
27731
+ },
27732
+ "responses": {
27733
+ "201": {
27734
+ "content": {
27735
+ "application/json": {
27736
+ "schema": {
27737
+ "$ref": "#/components/schemas/AccessRoleEnvelope"
27738
+ }
27739
+ }
27740
+ },
27741
+ "description": "Created access role."
27742
+ },
27743
+ "400": {
27744
+ "$ref": "#/components/responses/Error"
27745
+ },
27746
+ "401": {
27747
+ "$ref": "#/components/responses/Error"
27748
+ },
27749
+ "403": {
27750
+ "$ref": "#/components/responses/Error"
27751
+ }
27752
+ },
27753
+ "tags": [
27754
+ "Access"
27755
+ ]
27756
+ }
27757
+ },
27758
+ "/access/roles/{accessRoleID}": {
27759
+ "delete": {
27760
+ "operationId": "deleteAccessRole",
27761
+ "responses": {
27762
+ "200": {
27763
+ "content": {
27764
+ "application/json": {
27765
+ "schema": {
27766
+ "$ref": "#/components/schemas/AccessRoleDeleteResult"
27767
+ }
27768
+ }
27769
+ },
27770
+ "description": "Access role deleted."
27771
+ },
27772
+ "401": {
27773
+ "$ref": "#/components/responses/Error"
27774
+ },
27775
+ "403": {
27776
+ "$ref": "#/components/responses/Error"
27777
+ },
27778
+ "404": {
27779
+ "$ref": "#/components/responses/Error"
27780
+ }
27781
+ },
27782
+ "tags": [
27783
+ "Access"
27784
+ ]
27785
+ },
27786
+ "get": {
27787
+ "operationId": "getAccessRole",
27788
+ "responses": {
27789
+ "200": {
27790
+ "content": {
27791
+ "application/json": {
27792
+ "schema": {
27793
+ "$ref": "#/components/schemas/AccessRoleEnvelope"
27794
+ }
27795
+ }
27796
+ },
27797
+ "description": "Access role detail."
27798
+ },
27799
+ "401": {
27800
+ "$ref": "#/components/responses/Error"
27801
+ },
27802
+ "403": {
27803
+ "$ref": "#/components/responses/Error"
27804
+ },
27805
+ "404": {
27806
+ "$ref": "#/components/responses/Error"
27807
+ }
27808
+ },
27809
+ "tags": [
27810
+ "Access"
27811
+ ]
27812
+ },
27813
+ "parameters": [
27814
+ {
27815
+ "$ref": "#/components/parameters/AccessRoleID"
27816
+ }
27817
+ ],
27818
+ "put": {
27819
+ "operationId": "updateAccessRole",
27820
+ "requestBody": {
27821
+ "content": {
27822
+ "application/json": {
27823
+ "schema": {
27824
+ "$ref": "#/components/schemas/AccessRoleInput"
27825
+ }
27826
+ }
27827
+ },
27828
+ "required": true
27829
+ },
27830
+ "responses": {
27831
+ "200": {
27832
+ "content": {
27833
+ "application/json": {
27834
+ "schema": {
27835
+ "$ref": "#/components/schemas/AccessRoleEnvelope"
27836
+ }
27837
+ }
27838
+ },
27839
+ "description": "Updated access role."
27840
+ },
27841
+ "400": {
27842
+ "$ref": "#/components/responses/Error"
27843
+ },
27844
+ "401": {
27845
+ "$ref": "#/components/responses/Error"
27846
+ },
27847
+ "403": {
27848
+ "$ref": "#/components/responses/Error"
27849
+ },
27850
+ "404": {
27851
+ "$ref": "#/components/responses/Error"
27852
+ }
27853
+ },
27854
+ "tags": [
27855
+ "Access"
27856
+ ]
27857
+ }
27858
+ },
27193
27859
  "/ai-gateway/approval-requests": {
27194
27860
  "get": {
27195
27861
  "operationId": "listAIGatewayApprovalRequests",
@@ -42344,6 +43010,9 @@
42344
43010
  {
42345
43011
  "name": "Plugins"
42346
43012
  },
43013
+ {
43014
+ "name": "Access"
43015
+ },
42347
43016
  {
42348
43017
  "name": "Identity"
42349
43018
  },