k9o 1.2.0-aarch64-linux → 1.5.2-aarch64-linux

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 (62) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +123 -1
  3. data/README.md +1602 -180
  4. data/k9o.gemspec +2 -2
  5. data/lib/k9o/_ffi/kibo_kms_rest_ffi.rb +928 -25
  6. data/lib/k9o/_ffi/libkibo_kms_rest_ffi.so +0 -0
  7. data/lib/k9o/ai.rb +15 -0
  8. data/lib/k9o/analytics.rb +403 -0
  9. data/lib/k9o/approvals.rb +253 -0
  10. data/lib/k9o/audit.rb +162 -14
  11. data/lib/k9o/client.rb +28 -9
  12. data/lib/k9o/compute.rb +32 -15
  13. data/lib/k9o/crypto.rb +471 -0
  14. data/lib/k9o/custody.rb +28 -0
  15. data/lib/k9o/data.rb +125 -5
  16. data/lib/k9o/ed25519.rb +182 -0
  17. data/lib/k9o/end_users.rb +93 -0
  18. data/lib/k9o/envelope.rb +20 -5
  19. data/lib/k9o/functions.rb +127 -9
  20. data/lib/k9o/gate.rb +52 -22
  21. data/lib/k9o/http_transport.rb +78 -16
  22. data/lib/k9o/jcs.rb +117 -0
  23. data/lib/k9o/kerror.rb +57 -5
  24. data/lib/k9o/keys.rb +131 -0
  25. data/lib/k9o/kibo.rb +3 -3
  26. data/lib/k9o/kibo_client_core.rb +385 -0
  27. data/lib/k9o/kibo_ffi_core.rb +178 -0
  28. data/lib/k9o/locate.rb +118 -0
  29. data/lib/k9o/me.rb +27 -87
  30. data/lib/k9o/metadata.rb +342 -0
  31. data/lib/k9o/moat.rb +443 -0
  32. data/lib/k9o/org.rb +80 -68
  33. data/lib/k9o/orgs.rb +1 -0
  34. data/lib/k9o/policies.rb +25 -6
  35. data/lib/k9o/projects.rb +43 -8
  36. data/lib/k9o/query.rb +174 -0
  37. data/lib/k9o/rampart.rb +273 -0
  38. data/lib/k9o/realtime.rb +261 -32
  39. data/lib/k9o/region.rb +20 -18
  40. data/lib/k9o/schedules.rb +109 -0
  41. data/lib/k9o/schema.rb +35 -0
  42. data/lib/k9o/streams.rb +94 -0
  43. data/lib/k9o/studio.rb +21 -11
  44. data/lib/k9o/url_grammar.rb +46 -20
  45. data/lib/k9o/vault.rb +79 -84
  46. data/lib/k9o/vectors.rb +124 -0
  47. data/lib/k9o/version.rb +1 -1
  48. data/lib/k9o.rb +17 -0
  49. data/sig/k9o/ai.rbs +4 -0
  50. data/sig/k9o/approvals.rbs +71 -0
  51. data/sig/k9o/datasets.rbs +125 -0
  52. data/sig/k9o/gate.rbs +9 -6
  53. data/sig/k9o/kerror.rbs +24 -0
  54. data/sig/k9o/kibo_client_core.rbs +25 -0
  55. data/sig/k9o/metadata.rbs +54 -0
  56. data/sig/k9o/moat.rbs +29 -0
  57. data/sig/k9o/query.rbs +26 -0
  58. data/sig/k9o/rampart.rbs +59 -0
  59. data/sig/k9o/realtime.rbs +34 -0
  60. data/sig/k9o/region.rbs +14 -3
  61. data/sig/k9o/workload.rbs +64 -0
  62. metadata +33 -4
@@ -126,6 +126,97 @@ end
126
126
  end
127
127
  end
128
128
 
129
+ # The Record type AppOpenInput.
130
+
131
+ def self.check_lower_TypeAppOpenInput(v)
132
+ RustBuffer.check_lower_TypeFfiCredential(v.kms_cred)
133
+ RustBuffer.check_lower_TypeFfiProviderConfig(v.provider_config)
134
+
135
+
136
+ RustBuffer.check_lower_Optionalstring(v.context)
137
+
138
+ RustBuffer.check_lower_Sequencestring(v.expected_key_refs)
139
+ end
140
+
141
+ def self.alloc_from_TypeAppOpenInput(v)
142
+ RustBuffer.allocWithBuilder do |builder|
143
+ builder.write_TypeAppOpenInput(v)
144
+ return builder.finalize
145
+ end
146
+ end
147
+
148
+ def consumeIntoTypeAppOpenInput
149
+ consumeWithStream do |stream|
150
+ return stream.readTypeAppOpenInput
151
+ end
152
+ end
153
+
154
+ # The Record type AppOpenOutput.
155
+
156
+ def self.check_lower_TypeAppOpenOutput(v)
157
+
158
+ end
159
+
160
+ def self.alloc_from_TypeAppOpenOutput(v)
161
+ RustBuffer.allocWithBuilder do |builder|
162
+ builder.write_TypeAppOpenOutput(v)
163
+ return builder.finalize
164
+ end
165
+ end
166
+
167
+ def consumeIntoTypeAppOpenOutput
168
+ consumeWithStream do |stream|
169
+ return stream.readTypeAppOpenOutput
170
+ end
171
+ end
172
+
173
+ # The Record type AppSealInput.
174
+
175
+ def self.check_lower_TypeAppSealInput(v)
176
+ RustBuffer.check_lower_TypeKmsProvider(v.provider)
177
+ RustBuffer.check_lower_TypeFfiPosture(v.posture)
178
+ RustBuffer.check_lower_TypeFfiCredential(v.kms_cred)
179
+ RustBuffer.check_lower_TypeFfiKeyRef(v.key_ref)
180
+ RustBuffer.check_lower_TypeFfiProviderConfig(v.provider_config)
181
+
182
+
183
+ RustBuffer.check_lower_Optionalstring(v.context)
184
+
185
+ RustBuffer.check_lower_Sequencestring(v.expected_key_refs)
186
+ end
187
+
188
+ def self.alloc_from_TypeAppSealInput(v)
189
+ RustBuffer.allocWithBuilder do |builder|
190
+ builder.write_TypeAppSealInput(v)
191
+ return builder.finalize
192
+ end
193
+ end
194
+
195
+ def consumeIntoTypeAppSealInput
196
+ consumeWithStream do |stream|
197
+ return stream.readTypeAppSealInput
198
+ end
199
+ end
200
+
201
+ # The Record type AppSealOutput.
202
+
203
+ def self.check_lower_TypeAppSealOutput(v)
204
+
205
+ end
206
+
207
+ def self.alloc_from_TypeAppSealOutput(v)
208
+ RustBuffer.allocWithBuilder do |builder|
209
+ builder.write_TypeAppSealOutput(v)
210
+ return builder.finalize
211
+ end
212
+ end
213
+
214
+ def consumeIntoTypeAppSealOutput
215
+ consumeWithStream do |stream|
216
+ return stream.readTypeAppSealOutput
217
+ end
218
+ end
219
+
129
220
  # The Record type DecryptInput.
130
221
 
131
222
  def self.check_lower_TypeDecryptInput(v)
@@ -135,6 +226,7 @@ end
135
226
  RustBuffer.check_lower_TypeFfiStrategy(v.strategy)
136
227
  RustBuffer.check_lower_TypeFfiAttestationTier(v.attestation_tier)
137
228
  RustBuffer.check_lower_SequenceTypeFfiKvPair(v.encryption_context)
229
+ RustBuffer.check_lower_Sequencestring(v.expected_key_refs)
138
230
  end
139
231
 
140
232
  def self.alloc_from_TypeDecryptInput(v)
@@ -183,6 +275,7 @@ end
183
275
  RustBuffer.check_lower_SequenceTypeFfiKvPair(v.encryption_context)
184
276
 
185
277
  RustBuffer.check_lower_OptionalTypeFfiPosturePolicy(v.posture_policy)
278
+ RustBuffer.check_lower_Sequencestring(v.expected_key_refs)
186
279
  end
187
280
 
188
281
  def self.alloc_from_TypeEncryptInput(v)
@@ -257,6 +350,27 @@ end
257
350
  end
258
351
  end
259
352
 
353
+ # The Record type FfiFederationInput.
354
+
355
+ def self.check_lower_TypeFfiFederationInput(v)
356
+ RustBuffer.check_lower_TypeFfiFederationSpec(v.spec)
357
+
358
+
359
+ end
360
+
361
+ def self.alloc_from_TypeFfiFederationInput(v)
362
+ RustBuffer.allocWithBuilder do |builder|
363
+ builder.write_TypeFfiFederationInput(v)
364
+ return builder.finalize
365
+ end
366
+ end
367
+
368
+ def consumeIntoTypeFfiFederationInput
369
+ consumeWithStream do |stream|
370
+ return stream.readTypeFfiFederationInput
371
+ end
372
+ end
373
+
260
374
  # The Record type FfiKeyRef.
261
375
 
262
376
  def self.check_lower_TypeFfiKeyRef(v)
@@ -356,6 +470,49 @@ end
356
470
  end
357
471
 
358
472
 
473
+ # The Enum type FfiFederationSpec.
474
+
475
+ def self.check_lower_TypeFfiFederationSpec(v)
476
+ if v.aws?
477
+
478
+
479
+
480
+
481
+
482
+ return
483
+ end
484
+ if v.gcp?
485
+
486
+ return
487
+ end
488
+ if v.azure?
489
+
490
+
491
+
492
+ return
493
+ end
494
+ if v.vault?
495
+
496
+
497
+
498
+ return
499
+ end
500
+ end
501
+
502
+ def self.alloc_from_TypeFfiFederationSpec(v)
503
+ RustBuffer.allocWithBuilder do |builder|
504
+ builder.write_TypeFfiFederationSpec(v)
505
+ return builder.finalize
506
+ end
507
+ end
508
+
509
+ def consumeIntoTypeFfiFederationSpec
510
+ consumeWithStream do |stream|
511
+ return stream.readTypeFfiFederationSpec
512
+ end
513
+ end
514
+
515
+
359
516
  # The Enum type FfiMinPosture.
360
517
 
361
518
  def self.check_lower_TypeFfiMinPosture(v)
@@ -579,6 +736,27 @@ end
579
736
  end
580
737
  end
581
738
 
739
+ # The Sequence<T> type for string.
740
+
741
+ def self.check_lower_Sequencestring(v)
742
+ v.each do |item|
743
+
744
+ end
745
+ end
746
+
747
+ def self.alloc_from_Sequencestring(v)
748
+ RustBuffer.allocWithBuilder do |builder|
749
+ builder.write_Sequencestring(v)
750
+ return builder.finalize()
751
+ end
752
+ end
753
+
754
+ def consumeIntoSequencestring
755
+ consumeWithStream do |stream|
756
+ return stream.readSequencestring
757
+ end
758
+ end
759
+
582
760
  # The Sequence<T> type for TypeFfiKvPair.
583
761
 
584
762
  def self.check_lower_SequenceTypeFfiKvPair(v)
@@ -646,6 +824,10 @@ class RustBufferStream
646
824
  data
647
825
  end
648
826
 
827
+ def readU32
828
+ unpack_from 4, 'L>'
829
+ end
830
+
649
831
  def readU64
650
832
  unpack_from 8, 'Q>'
651
833
  end
@@ -675,6 +857,53 @@ class RustBufferStream
675
857
  read(size).force_encoding(Encoding::BINARY)
676
858
  end
677
859
 
860
+ # The Record type AppOpenInput.
861
+
862
+ def readTypeAppOpenInput
863
+ AppOpenInput.new(
864
+ kms_cred: readTypeFfiCredential,
865
+ provider_config: readTypeFfiProviderConfig,
866
+ project_id: readString,
867
+ crypt: readString,
868
+ context: readOptionalstring,
869
+ container: readBytes,
870
+ expected_key_refs: readSequencestring
871
+ )
872
+ end
873
+
874
+ # The Record type AppOpenOutput.
875
+
876
+ def readTypeAppOpenOutput
877
+ AppOpenOutput.new(
878
+ plaintext: readBytes
879
+ )
880
+ end
881
+
882
+ # The Record type AppSealInput.
883
+
884
+ def readTypeAppSealInput
885
+ AppSealInput.new(
886
+ provider: readTypeKmsProvider,
887
+ posture: readTypeFfiPosture,
888
+ kms_cred: readTypeFfiCredential,
889
+ key_ref: readTypeFfiKeyRef,
890
+ provider_config: readTypeFfiProviderConfig,
891
+ project_id: readString,
892
+ crypt: readString,
893
+ context: readOptionalstring,
894
+ plaintext: readBytes,
895
+ expected_key_refs: readSequencestring
896
+ )
897
+ end
898
+
899
+ # The Record type AppSealOutput.
900
+
901
+ def readTypeAppSealOutput
902
+ AppSealOutput.new(
903
+ container: readBytes
904
+ )
905
+ end
906
+
678
907
  # The Record type DecryptInput.
679
908
 
680
909
  def readTypeDecryptInput
@@ -684,7 +913,8 @@ class RustBufferStream
684
913
  envelope: readBytes,
685
914
  strategy: readTypeFfiStrategy,
686
915
  attestation_tier: readTypeFfiAttestationTier,
687
- encryption_context: readSequenceTypeFfiKvPair
916
+ encryption_context: readSequenceTypeFfiKvPair,
917
+ expected_key_refs: readSequencestring
688
918
  )
689
919
  end
690
920
 
@@ -710,7 +940,8 @@ class RustBufferStream
710
940
  attestation_tier: readTypeFfiAttestationTier,
711
941
  encryption_context: readSequenceTypeFfiKvPair,
712
942
  plaintext: readBytes,
713
- posture_policy: readOptionalTypeFfiPosturePolicy
943
+ posture_policy: readOptionalTypeFfiPosturePolicy,
944
+ expected_key_refs: readSequencestring
714
945
  )
715
946
  end
716
947
 
@@ -740,6 +971,16 @@ class RustBufferStream
740
971
  )
741
972
  end
742
973
 
974
+ # The Record type FfiFederationInput.
975
+
976
+ def readTypeFfiFederationInput
977
+ FfiFederationInput.new(
978
+ spec: readTypeFfiFederationSpec,
979
+ identity_token: readString,
980
+ now_unix_secs: readU64
981
+ )
982
+ end
983
+
743
984
  # The Record type FfiKeyRef.
744
985
 
745
986
  def readTypeFfiKeyRef
@@ -800,6 +1041,46 @@ class RustBufferStream
800
1041
 
801
1042
 
802
1043
 
1044
+ # The Enum type FfiFederationSpec.
1045
+
1046
+ def readTypeFfiFederationSpec
1047
+ variant = unpack_from 4, 'l>'
1048
+
1049
+ if variant == 1
1050
+ return FfiFederationSpec::AWS.new(
1051
+ self.readString(),
1052
+ self.readString(),
1053
+ self.readString(),
1054
+ self.readString(),
1055
+ self.readU32()
1056
+ )
1057
+ end
1058
+ if variant == 2
1059
+ return FfiFederationSpec::GCP.new(
1060
+ self.readString()
1061
+ )
1062
+ end
1063
+ if variant == 3
1064
+ return FfiFederationSpec::AZURE.new(
1065
+ self.readString(),
1066
+ self.readString(),
1067
+ self.readString()
1068
+ )
1069
+ end
1070
+ if variant == 4
1071
+ return FfiFederationSpec::VAULT.new(
1072
+ self.readString(),
1073
+ self.readString(),
1074
+ self.readString()
1075
+ )
1076
+ end
1077
+ raise InternalError, 'Unexpected variant tag for TypeFfiFederationSpec'
1078
+ end
1079
+
1080
+
1081
+
1082
+
1083
+
803
1084
  # The Enum type FfiMinPosture.
804
1085
 
805
1086
  def readTypeFfiMinPosture
@@ -1020,6 +1301,22 @@ class RustBufferStream
1020
1301
  end
1021
1302
  end
1022
1303
 
1304
+ # The Sequence<T> type for string.
1305
+
1306
+ def readSequencestring
1307
+ count = unpack_from 4, 'l>'
1308
+
1309
+ raise InternalError, 'Unexpected negative sequence length' if count.negative?
1310
+
1311
+ items = []
1312
+
1313
+ count.times do
1314
+ items.append readString
1315
+ end
1316
+
1317
+ items
1318
+ end
1319
+
1023
1320
  # The Sequence<T> type for TypeFfiKvPair.
1024
1321
 
1025
1322
  def readSequenceTypeFfiKvPair
@@ -1082,6 +1379,11 @@ class RustBufferBuilder
1082
1379
  end
1083
1380
  end
1084
1381
 
1382
+ def write_U32(v)
1383
+ v = KiboKmsRestFfi::uniffi_in_range(v, "u32", 0, 2**32)
1384
+ pack_into(4, 'L>', v)
1385
+ end
1386
+
1085
1387
  def write_U64(v)
1086
1388
  v = KiboKmsRestFfi::uniffi_in_range(v, "u64", 0, 2**64)
1087
1389
  pack_into(8, 'Q>', v)
@@ -1103,6 +1405,45 @@ class RustBufferBuilder
1103
1405
  write v
1104
1406
  end
1105
1407
 
1408
+ # The Record type AppOpenInput.
1409
+
1410
+ def write_TypeAppOpenInput(v)
1411
+ self.write_TypeFfiCredential(v.kms_cred)
1412
+ self.write_TypeFfiProviderConfig(v.provider_config)
1413
+ self.write_String(v.project_id)
1414
+ self.write_String(v.crypt)
1415
+ self.write_Optionalstring(v.context)
1416
+ self.write_Bytes(v.container)
1417
+ self.write_Sequencestring(v.expected_key_refs)
1418
+ end
1419
+
1420
+ # The Record type AppOpenOutput.
1421
+
1422
+ def write_TypeAppOpenOutput(v)
1423
+ self.write_Bytes(v.plaintext)
1424
+ end
1425
+
1426
+ # The Record type AppSealInput.
1427
+
1428
+ def write_TypeAppSealInput(v)
1429
+ self.write_TypeKmsProvider(v.provider)
1430
+ self.write_TypeFfiPosture(v.posture)
1431
+ self.write_TypeFfiCredential(v.kms_cred)
1432
+ self.write_TypeFfiKeyRef(v.key_ref)
1433
+ self.write_TypeFfiProviderConfig(v.provider_config)
1434
+ self.write_String(v.project_id)
1435
+ self.write_String(v.crypt)
1436
+ self.write_Optionalstring(v.context)
1437
+ self.write_Bytes(v.plaintext)
1438
+ self.write_Sequencestring(v.expected_key_refs)
1439
+ end
1440
+
1441
+ # The Record type AppSealOutput.
1442
+
1443
+ def write_TypeAppSealOutput(v)
1444
+ self.write_Bytes(v.container)
1445
+ end
1446
+
1106
1447
  # The Record type DecryptInput.
1107
1448
 
1108
1449
  def write_TypeDecryptInput(v)
@@ -1112,6 +1453,7 @@ class RustBufferBuilder
1112
1453
  self.write_TypeFfiStrategy(v.strategy)
1113
1454
  self.write_TypeFfiAttestationTier(v.attestation_tier)
1114
1455
  self.write_SequenceTypeFfiKvPair(v.encryption_context)
1456
+ self.write_Sequencestring(v.expected_key_refs)
1115
1457
  end
1116
1458
 
1117
1459
  # The Record type DecryptOutput.
@@ -1134,6 +1476,7 @@ class RustBufferBuilder
1134
1476
  self.write_SequenceTypeFfiKvPair(v.encryption_context)
1135
1477
  self.write_Bytes(v.plaintext)
1136
1478
  self.write_OptionalTypeFfiPosturePolicy(v.posture_policy)
1479
+ self.write_Sequencestring(v.expected_key_refs)
1137
1480
  end
1138
1481
 
1139
1482
  # The Record type EncryptOutput.
@@ -1156,6 +1499,14 @@ class RustBufferBuilder
1156
1499
  self.write_U64(v.expires_at_unix_secs)
1157
1500
  end
1158
1501
 
1502
+ # The Record type FfiFederationInput.
1503
+
1504
+ def write_TypeFfiFederationInput(v)
1505
+ self.write_TypeFfiFederationSpec(v.spec)
1506
+ self.write_String(v.identity_token)
1507
+ self.write_U64(v.now_unix_secs)
1508
+ end
1509
+
1159
1510
  # The Record type FfiKeyRef.
1160
1511
 
1161
1512
  def write_TypeFfiKeyRef(v)
@@ -1191,6 +1542,36 @@ class RustBufferBuilder
1191
1542
  end
1192
1543
 
1193
1544
 
1545
+ # The Enum type FfiFederationSpec.
1546
+
1547
+ def write_TypeFfiFederationSpec(v)
1548
+ if v.aws?
1549
+ pack_into(4, 'l>', 1)
1550
+ self.write_String(v.role_arn)
1551
+ self.write_String(v.session_name)
1552
+ self.write_String(v.region)
1553
+ self.write_String(v.key_arn)
1554
+ self.write_U32(v.duration_secs)
1555
+ end
1556
+ if v.gcp?
1557
+ pack_into(4, 'l>', 2)
1558
+ self.write_String(v.audience)
1559
+ end
1560
+ if v.azure?
1561
+ pack_into(4, 'l>', 3)
1562
+ self.write_String(v.tenant_id)
1563
+ self.write_String(v.client_id)
1564
+ self.write_String(v.scope)
1565
+ end
1566
+ if v.vault?
1567
+ pack_into(4, 'l>', 4)
1568
+ self.write_String(v.vault_addr)
1569
+ self.write_String(v.mount)
1570
+ self.write_String(v.role)
1571
+ end
1572
+ end
1573
+
1574
+
1194
1575
  # The Enum type FfiMinPosture.
1195
1576
 
1196
1577
  def write_TypeFfiMinPosture(v)
@@ -1294,6 +1675,16 @@ class RustBufferBuilder
1294
1675
  end
1295
1676
  end
1296
1677
 
1678
+ # The Sequence<T> type for string.
1679
+
1680
+ def write_Sequencestring(items)
1681
+ pack_into(4, 'l>', items.size)
1682
+
1683
+ items.each do |item|
1684
+ self.write_String(item)
1685
+ end
1686
+ end
1687
+
1297
1688
  # The Sequence<T> type for TypeFfiKvPair.
1298
1689
 
1299
1690
  def write_SequenceTypeFfiKvPair(items)
@@ -1357,49 +1748,50 @@ CALL_PANIC = 2
1357
1748
 
1358
1749
 
1359
1750
 
1751
+
1360
1752
  module ZkFfiUniffiError
1361
1753
  class Platform < StandardError
1362
- def initialize(code, message)
1754
+ def initialize(code, detail)
1363
1755
  @code = code
1364
- @message = message
1756
+ @detail = detail
1365
1757
  super()
1366
1758
  end
1367
1759
 
1368
- attr_reader :code, :message
1760
+ attr_reader :code, :detail
1369
1761
 
1370
1762
 
1371
1763
  def to_s
1372
- "#{self.class.name}(code=#{@code.inspect}, message=#{@message.inspect})"
1764
+ "#{self.class.name}(code=#{@code.inspect}, detail=#{@detail.inspect})"
1373
1765
  end
1374
1766
  end
1375
1767
  class UpstreamKms < StandardError
1376
- def initialize(message)
1377
- @message = message
1768
+ def initialize(detail)
1769
+ @detail = detail
1378
1770
  super()
1379
1771
  end
1380
1772
 
1381
- attr_reader :message
1773
+ attr_reader :detail
1382
1774
 
1383
1775
 
1384
1776
  def to_s
1385
- "#{self.class.name}(message=#{@message.inspect})"
1777
+ "#{self.class.name}(detail=#{@detail.inspect})"
1386
1778
  end
1387
1779
  end
1388
1780
  class PostureViolation < StandardError
1389
- def initialize(code, message, dimension, requested, declared)
1781
+ def initialize(code, detail, dimension, requested, declared)
1390
1782
  @code = code
1391
- @message = message
1783
+ @detail = detail
1392
1784
  @dimension = dimension
1393
1785
  @requested = requested
1394
1786
  @declared = declared
1395
1787
  super()
1396
1788
  end
1397
1789
 
1398
- attr_reader :code, :message, :dimension, :requested, :declared
1790
+ attr_reader :code, :detail, :dimension, :requested, :declared
1399
1791
 
1400
1792
 
1401
1793
  def to_s
1402
- "#{self.class.name}(code=#{@code.inspect}, message=#{@message.inspect}, dimension=#{@dimension.inspect}, requested=#{@requested.inspect}, declared=#{@declared.inspect})"
1794
+ "#{self.class.name}(code=#{@code.inspect}, detail=#{@detail.inspect}, dimension=#{@dimension.inspect}, requested=#{@requested.inspect}, declared=#{@declared.inspect})"
1403
1795
  end
1404
1796
  end
1405
1797
 
@@ -1415,6 +1807,7 @@ ERROR_MODULE_TO_READER_METHOD = {
1415
1807
 
1416
1808
 
1417
1809
 
1810
+
1418
1811
  ZkFfiUniffiError => :readTypeZkFfiUniffiError,
1419
1812
 
1420
1813
  }
@@ -1486,6 +1879,27 @@ module UniFFILib
1486
1879
  ffi_lib File.expand_path(FFI::Platform::LIBPREFIX + 'kibo_kms_rest_ffi.' + FFI::Platform::LIBSUFFIX, __dir__)
1487
1880
 
1488
1881
 
1882
+ attach_function :uniffi_kibo_kms_rest_ffi_fn_func_acquire_kms_credential,
1883
+ [RustBuffer.by_value, RustCallStatus.by_ref],
1884
+ :uint64
1885
+ attach_function :uniffi_kibo_kms_rest_ffi_fn_func_acquire_kms_credential_blocking,
1886
+ [RustBuffer.by_value, RustCallStatus.by_ref],
1887
+ RustBuffer.by_value
1888
+ attach_function :uniffi_kibo_kms_rest_ffi_fn_func_app_crypto_open,
1889
+ [RustBuffer.by_value, RustCallStatus.by_ref],
1890
+ :uint64
1891
+ attach_function :uniffi_kibo_kms_rest_ffi_fn_func_app_crypto_open_blocking,
1892
+ [RustBuffer.by_value, RustCallStatus.by_ref],
1893
+ RustBuffer.by_value
1894
+ attach_function :uniffi_kibo_kms_rest_ffi_fn_func_app_crypto_seal,
1895
+ [RustBuffer.by_value, RustCallStatus.by_ref],
1896
+ :uint64
1897
+ attach_function :uniffi_kibo_kms_rest_ffi_fn_func_app_crypto_seal_blocking,
1898
+ [RustBuffer.by_value, RustCallStatus.by_ref],
1899
+ RustBuffer.by_value
1900
+ attach_function :uniffi_kibo_kms_rest_ffi_fn_func_core_capabilities,
1901
+ [RustCallStatus.by_ref],
1902
+ RustBuffer.by_value
1489
1903
  attach_function :uniffi_kibo_kms_rest_ffi_fn_func_zk_decrypt,
1490
1904
  [RustBuffer.by_value, RustCallStatus.by_ref],
1491
1905
  :uint64
@@ -1510,6 +1924,27 @@ module UniFFILib
1510
1924
  attach_function :ffi_kibo_kms_rest_ffi_rustbuffer_reserve,
1511
1925
  [RustBuffer.by_value, :uint64, RustCallStatus.by_ref],
1512
1926
  RustBuffer.by_value
1927
+ attach_function :uniffi_kibo_kms_rest_ffi_checksum_func_acquire_kms_credential,
1928
+ [RustCallStatus.by_ref],
1929
+ :uint16
1930
+ attach_function :uniffi_kibo_kms_rest_ffi_checksum_func_acquire_kms_credential_blocking,
1931
+ [RustCallStatus.by_ref],
1932
+ :uint16
1933
+ attach_function :uniffi_kibo_kms_rest_ffi_checksum_func_app_crypto_open,
1934
+ [RustCallStatus.by_ref],
1935
+ :uint16
1936
+ attach_function :uniffi_kibo_kms_rest_ffi_checksum_func_app_crypto_open_blocking,
1937
+ [RustCallStatus.by_ref],
1938
+ :uint16
1939
+ attach_function :uniffi_kibo_kms_rest_ffi_checksum_func_app_crypto_seal,
1940
+ [RustCallStatus.by_ref],
1941
+ :uint16
1942
+ attach_function :uniffi_kibo_kms_rest_ffi_checksum_func_app_crypto_seal_blocking,
1943
+ [RustCallStatus.by_ref],
1944
+ :uint16
1945
+ attach_function :uniffi_kibo_kms_rest_ffi_checksum_func_core_capabilities,
1946
+ [RustCallStatus.by_ref],
1947
+ :uint16
1513
1948
  attach_function :uniffi_kibo_kms_rest_ffi_checksum_func_zk_decrypt,
1514
1949
  [RustCallStatus.by_ref],
1515
1950
  :uint16
@@ -1546,15 +1981,241 @@ end
1546
1981
 
1547
1982
 
1548
1983
 
1549
- class FfiMinPosture
1550
- PLATFORM_MANAGED = 1
1551
- BYOK = 2
1552
- HYOK = 3
1553
-
1554
- end
1984
+ class FfiFederationSpec
1985
+ def initialize
1986
+ raise RuntimeError, 'FfiFederationSpec cannot be instantiated directly'
1987
+ end
1555
1988
 
1989
+ # Each enum variant is a nested class of the enum itself.
1990
+ class AWS
1991
+
1992
+ attr_reader :role_arn, :session_name, :region, :key_arn, :duration_secs
1993
+
1994
+ def initialize(role_arn, session_name, region, key_arn, duration_secs)
1995
+
1996
+ @role_arn = role_arn
1997
+ @session_name = session_name
1998
+ @region = region
1999
+ @key_arn = key_arn
2000
+ @duration_secs = duration_secs
2001
+
2002
+ end
1556
2003
 
1557
-
2004
+ def to_s
2005
+ "FfiFederationSpec::AWS(role_arn=#{@role_arn}, session_name=#{@session_name}, region=#{@region}, key_arn=#{@key_arn}, duration_secs=#{@duration_secs})"
2006
+ end
2007
+
2008
+ def ==(other)
2009
+ if !other.aws?
2010
+ return false
2011
+ end
2012
+ if @role_arn != other.role_arn
2013
+ return false
2014
+ end
2015
+ if @session_name != other.session_name
2016
+ return false
2017
+ end
2018
+ if @region != other.region
2019
+ return false
2020
+ end
2021
+ if @key_arn != other.key_arn
2022
+ return false
2023
+ end
2024
+ if @duration_secs != other.duration_secs
2025
+ return false
2026
+ end
2027
+
2028
+ true
2029
+ end
2030
+
2031
+ # For each variant, we have an `NAME?` method for easily checking
2032
+ # whether an instance is that variant.
2033
+
2034
+ def aws?
2035
+ instance_of? FfiFederationSpec::AWS
2036
+ end
2037
+
2038
+ def gcp?
2039
+ instance_of? FfiFederationSpec::GCP
2040
+ end
2041
+
2042
+ def azure?
2043
+ instance_of? FfiFederationSpec::AZURE
2044
+ end
2045
+
2046
+ def vault?
2047
+ instance_of? FfiFederationSpec::VAULT
2048
+ end
2049
+
2050
+ end
2051
+ class GCP
2052
+
2053
+ attr_reader :audience
2054
+
2055
+ def initialize(audience)
2056
+
2057
+ @audience = audience
2058
+
2059
+ end
2060
+
2061
+ def to_s
2062
+ "FfiFederationSpec::GCP(audience=#{@audience})"
2063
+ end
2064
+
2065
+ def ==(other)
2066
+ if !other.gcp?
2067
+ return false
2068
+ end
2069
+ if @audience != other.audience
2070
+ return false
2071
+ end
2072
+
2073
+ true
2074
+ end
2075
+
2076
+ # For each variant, we have an `NAME?` method for easily checking
2077
+ # whether an instance is that variant.
2078
+
2079
+ def aws?
2080
+ instance_of? FfiFederationSpec::AWS
2081
+ end
2082
+
2083
+ def gcp?
2084
+ instance_of? FfiFederationSpec::GCP
2085
+ end
2086
+
2087
+ def azure?
2088
+ instance_of? FfiFederationSpec::AZURE
2089
+ end
2090
+
2091
+ def vault?
2092
+ instance_of? FfiFederationSpec::VAULT
2093
+ end
2094
+
2095
+ end
2096
+ class AZURE
2097
+
2098
+ attr_reader :tenant_id, :client_id, :scope
2099
+
2100
+ def initialize(tenant_id, client_id, scope)
2101
+
2102
+ @tenant_id = tenant_id
2103
+ @client_id = client_id
2104
+ @scope = scope
2105
+
2106
+ end
2107
+
2108
+ def to_s
2109
+ "FfiFederationSpec::AZURE(tenant_id=#{@tenant_id}, client_id=#{@client_id}, scope=#{@scope})"
2110
+ end
2111
+
2112
+ def ==(other)
2113
+ if !other.azure?
2114
+ return false
2115
+ end
2116
+ if @tenant_id != other.tenant_id
2117
+ return false
2118
+ end
2119
+ if @client_id != other.client_id
2120
+ return false
2121
+ end
2122
+ if @scope != other.scope
2123
+ return false
2124
+ end
2125
+
2126
+ true
2127
+ end
2128
+
2129
+ # For each variant, we have an `NAME?` method for easily checking
2130
+ # whether an instance is that variant.
2131
+
2132
+ def aws?
2133
+ instance_of? FfiFederationSpec::AWS
2134
+ end
2135
+
2136
+ def gcp?
2137
+ instance_of? FfiFederationSpec::GCP
2138
+ end
2139
+
2140
+ def azure?
2141
+ instance_of? FfiFederationSpec::AZURE
2142
+ end
2143
+
2144
+ def vault?
2145
+ instance_of? FfiFederationSpec::VAULT
2146
+ end
2147
+
2148
+ end
2149
+ class VAULT
2150
+
2151
+ attr_reader :vault_addr, :mount, :role
2152
+
2153
+ def initialize(vault_addr, mount, role)
2154
+
2155
+ @vault_addr = vault_addr
2156
+ @mount = mount
2157
+ @role = role
2158
+
2159
+ end
2160
+
2161
+ def to_s
2162
+ "FfiFederationSpec::VAULT(vault_addr=#{@vault_addr}, mount=#{@mount}, role=#{@role})"
2163
+ end
2164
+
2165
+ def ==(other)
2166
+ if !other.vault?
2167
+ return false
2168
+ end
2169
+ if @vault_addr != other.vault_addr
2170
+ return false
2171
+ end
2172
+ if @mount != other.mount
2173
+ return false
2174
+ end
2175
+ if @role != other.role
2176
+ return false
2177
+ end
2178
+
2179
+ true
2180
+ end
2181
+
2182
+ # For each variant, we have an `NAME?` method for easily checking
2183
+ # whether an instance is that variant.
2184
+
2185
+ def aws?
2186
+ instance_of? FfiFederationSpec::AWS
2187
+ end
2188
+
2189
+ def gcp?
2190
+ instance_of? FfiFederationSpec::GCP
2191
+ end
2192
+
2193
+ def azure?
2194
+ instance_of? FfiFederationSpec::AZURE
2195
+ end
2196
+
2197
+ def vault?
2198
+ instance_of? FfiFederationSpec::VAULT
2199
+ end
2200
+
2201
+ end
2202
+
2203
+ end
2204
+
2205
+
2206
+
2207
+
2208
+
2209
+
2210
+ class FfiMinPosture
2211
+ PLATFORM_MANAGED = 1
2212
+ BYOK = 2
2213
+ HYOK = 3
2214
+
2215
+ end
2216
+
2217
+
2218
+
1558
2219
 
1559
2220
 
1560
2221
 
@@ -1602,17 +2263,146 @@ end
1602
2263
 
1603
2264
 
1604
2265
 
2266
+ # Record type AppOpenInput
2267
+ class AppOpenInput
2268
+ attr_reader :kms_cred, :provider_config, :project_id, :crypt, :context, :container, :expected_key_refs
2269
+
2270
+ def initialize(kms_cred:, provider_config:, project_id:, crypt:, context:, container:, expected_key_refs:)
2271
+ @kms_cred = kms_cred
2272
+ @provider_config = provider_config
2273
+ @project_id = project_id
2274
+ @crypt = crypt
2275
+ @context = context
2276
+ @container = container
2277
+ @expected_key_refs = expected_key_refs
2278
+ end
2279
+
2280
+ def ==(other)
2281
+ if @kms_cred != other.kms_cred
2282
+ return false
2283
+ end
2284
+ if @provider_config != other.provider_config
2285
+ return false
2286
+ end
2287
+ if @project_id != other.project_id
2288
+ return false
2289
+ end
2290
+ if @crypt != other.crypt
2291
+ return false
2292
+ end
2293
+ if @context != other.context
2294
+ return false
2295
+ end
2296
+ if @container != other.container
2297
+ return false
2298
+ end
2299
+ if @expected_key_refs != other.expected_key_refs
2300
+ return false
2301
+ end
2302
+
2303
+ true
2304
+ end
2305
+ end
2306
+
2307
+ # Record type AppOpenOutput
2308
+ class AppOpenOutput
2309
+ attr_reader :plaintext
2310
+
2311
+ def initialize(plaintext:)
2312
+ @plaintext = plaintext
2313
+ end
2314
+
2315
+ def ==(other)
2316
+ if @plaintext != other.plaintext
2317
+ return false
2318
+ end
2319
+
2320
+ true
2321
+ end
2322
+ end
2323
+
2324
+ # Record type AppSealInput
2325
+ class AppSealInput
2326
+ attr_reader :provider, :posture, :kms_cred, :key_ref, :provider_config, :project_id, :crypt, :context, :plaintext, :expected_key_refs
2327
+
2328
+ def initialize(provider:, posture:, kms_cred:, key_ref:, provider_config:, project_id:, crypt:, context:, plaintext:, expected_key_refs:)
2329
+ @provider = provider
2330
+ @posture = posture
2331
+ @kms_cred = kms_cred
2332
+ @key_ref = key_ref
2333
+ @provider_config = provider_config
2334
+ @project_id = project_id
2335
+ @crypt = crypt
2336
+ @context = context
2337
+ @plaintext = plaintext
2338
+ @expected_key_refs = expected_key_refs
2339
+ end
2340
+
2341
+ def ==(other)
2342
+ if @provider != other.provider
2343
+ return false
2344
+ end
2345
+ if @posture != other.posture
2346
+ return false
2347
+ end
2348
+ if @kms_cred != other.kms_cred
2349
+ return false
2350
+ end
2351
+ if @key_ref != other.key_ref
2352
+ return false
2353
+ end
2354
+ if @provider_config != other.provider_config
2355
+ return false
2356
+ end
2357
+ if @project_id != other.project_id
2358
+ return false
2359
+ end
2360
+ if @crypt != other.crypt
2361
+ return false
2362
+ end
2363
+ if @context != other.context
2364
+ return false
2365
+ end
2366
+ if @plaintext != other.plaintext
2367
+ return false
2368
+ end
2369
+ if @expected_key_refs != other.expected_key_refs
2370
+ return false
2371
+ end
2372
+
2373
+ true
2374
+ end
2375
+ end
2376
+
2377
+ # Record type AppSealOutput
2378
+ class AppSealOutput
2379
+ attr_reader :container
2380
+
2381
+ def initialize(container:)
2382
+ @container = container
2383
+ end
2384
+
2385
+ def ==(other)
2386
+ if @container != other.container
2387
+ return false
2388
+ end
2389
+
2390
+ true
2391
+ end
2392
+ end
2393
+
1605
2394
  # Record type DecryptInput
1606
2395
  class DecryptInput
1607
- attr_reader :kms_cred, :provider_config, :envelope, :strategy, :attestation_tier, :encryption_context
2396
+ attr_reader :kms_cred, :provider_config, :envelope, :strategy, :attestation_tier, :encryption_context, :expected_key_refs
1608
2397
 
1609
- def initialize(kms_cred:, provider_config:, envelope:, strategy:, attestation_tier:, encryption_context:)
2398
+ def initialize(kms_cred:, provider_config:, envelope:, strategy:, attestation_tier:, encryption_context:, expected_key_refs:)
1610
2399
  @kms_cred = kms_cred
1611
2400
  @provider_config = provider_config
1612
2401
  @envelope = envelope
1613
2402
  @strategy = strategy
1614
2403
  @attestation_tier = attestation_tier
1615
2404
  @encryption_context = encryption_context
2405
+ @expected_key_refs = expected_key_refs
1616
2406
  end
1617
2407
 
1618
2408
  def ==(other)
@@ -1634,6 +2424,9 @@ class DecryptInput
1634
2424
  if @encryption_context != other.encryption_context
1635
2425
  return false
1636
2426
  end
2427
+ if @expected_key_refs != other.expected_key_refs
2428
+ return false
2429
+ end
1637
2430
 
1638
2431
  true
1639
2432
  end
@@ -1658,9 +2451,9 @@ end
1658
2451
 
1659
2452
  # Record type EncryptInput
1660
2453
  class EncryptInput
1661
- attr_reader :provider, :posture, :strategy, :oracle_mode, :kms_cred, :key_ref, :provider_config, :attestation_tier, :encryption_context, :plaintext, :posture_policy
2454
+ attr_reader :provider, :posture, :strategy, :oracle_mode, :kms_cred, :key_ref, :provider_config, :attestation_tier, :encryption_context, :plaintext, :posture_policy, :expected_key_refs
1662
2455
 
1663
- def initialize(provider:, posture:, strategy:, oracle_mode:, kms_cred:, key_ref:, provider_config:, attestation_tier:, encryption_context:, plaintext:, posture_policy:)
2456
+ def initialize(provider:, posture:, strategy:, oracle_mode:, kms_cred:, key_ref:, provider_config:, attestation_tier:, encryption_context:, plaintext:, posture_policy:, expected_key_refs:)
1664
2457
  @provider = provider
1665
2458
  @posture = posture
1666
2459
  @strategy = strategy
@@ -1672,6 +2465,7 @@ class EncryptInput
1672
2465
  @encryption_context = encryption_context
1673
2466
  @plaintext = plaintext
1674
2467
  @posture_policy = posture_policy
2468
+ @expected_key_refs = expected_key_refs
1675
2469
  end
1676
2470
 
1677
2471
  def ==(other)
@@ -1708,6 +2502,9 @@ class EncryptInput
1708
2502
  if @posture_policy != other.posture_policy
1709
2503
  return false
1710
2504
  end
2505
+ if @expected_key_refs != other.expected_key_refs
2506
+ return false
2507
+ end
1711
2508
 
1712
2509
  true
1713
2510
  end
@@ -1772,6 +2569,31 @@ class FfiCredential
1772
2569
  end
1773
2570
  end
1774
2571
 
2572
+ # Record type FfiFederationInput
2573
+ class FfiFederationInput
2574
+ attr_reader :spec, :identity_token, :now_unix_secs
2575
+
2576
+ def initialize(spec:, identity_token:, now_unix_secs:)
2577
+ @spec = spec
2578
+ @identity_token = identity_token
2579
+ @now_unix_secs = now_unix_secs
2580
+ end
2581
+
2582
+ def ==(other)
2583
+ if @spec != other.spec
2584
+ return false
2585
+ end
2586
+ if @identity_token != other.identity_token
2587
+ return false
2588
+ end
2589
+ if @now_unix_secs != other.now_unix_secs
2590
+ return false
2591
+ end
2592
+
2593
+ true
2594
+ end
2595
+ end
2596
+
1775
2597
  # Record type FfiKeyRef
1776
2598
  class FfiKeyRef
1777
2599
  attr_reader :version, :external_ref
@@ -1860,6 +2682,87 @@ end
1860
2682
 
1861
2683
 
1862
2684
 
2685
+ def self.acquire_kms_credential(input)
2686
+ input = input
2687
+ RustBuffer.check_lower_TypeFfiFederationInput(input)
2688
+
2689
+ result = KiboKmsRestFfi.rust_call_with_error(ZkFfiUniffiError,:uniffi_kibo_kms_rest_ffi_fn_func_acquire_kms_credential,RustBuffer.alloc_from_TypeFfiFederationInput(input))
2690
+ return result.consumeIntoTypeFfiCredential
2691
+ end
2692
+
2693
+
2694
+
2695
+
2696
+
2697
+ def self.acquire_kms_credential_blocking(input)
2698
+ input = input
2699
+ RustBuffer.check_lower_TypeFfiFederationInput(input)
2700
+
2701
+ result = KiboKmsRestFfi.rust_call_with_error(ZkFfiUniffiError,:uniffi_kibo_kms_rest_ffi_fn_func_acquire_kms_credential_blocking,RustBuffer.alloc_from_TypeFfiFederationInput(input))
2702
+ return result.consumeIntoTypeFfiCredential
2703
+ end
2704
+
2705
+
2706
+
2707
+
2708
+
2709
+ def self.app_crypto_open(input)
2710
+ input = input
2711
+ RustBuffer.check_lower_TypeAppOpenInput(input)
2712
+
2713
+ result = KiboKmsRestFfi.rust_call_with_error(ZkFfiUniffiError,:uniffi_kibo_kms_rest_ffi_fn_func_app_crypto_open,RustBuffer.alloc_from_TypeAppOpenInput(input))
2714
+ return result.consumeIntoTypeAppOpenOutput
2715
+ end
2716
+
2717
+
2718
+
2719
+
2720
+
2721
+ def self.app_crypto_open_blocking(input)
2722
+ input = input
2723
+ RustBuffer.check_lower_TypeAppOpenInput(input)
2724
+
2725
+ result = KiboKmsRestFfi.rust_call_with_error(ZkFfiUniffiError,:uniffi_kibo_kms_rest_ffi_fn_func_app_crypto_open_blocking,RustBuffer.alloc_from_TypeAppOpenInput(input))
2726
+ return result.consumeIntoTypeAppOpenOutput
2727
+ end
2728
+
2729
+
2730
+
2731
+
2732
+
2733
+ def self.app_crypto_seal(input)
2734
+ input = input
2735
+ RustBuffer.check_lower_TypeAppSealInput(input)
2736
+
2737
+ result = KiboKmsRestFfi.rust_call_with_error(ZkFfiUniffiError,:uniffi_kibo_kms_rest_ffi_fn_func_app_crypto_seal,RustBuffer.alloc_from_TypeAppSealInput(input))
2738
+ return result.consumeIntoTypeAppSealOutput
2739
+ end
2740
+
2741
+
2742
+
2743
+
2744
+
2745
+ def self.app_crypto_seal_blocking(input)
2746
+ input = input
2747
+ RustBuffer.check_lower_TypeAppSealInput(input)
2748
+
2749
+ result = KiboKmsRestFfi.rust_call_with_error(ZkFfiUniffiError,:uniffi_kibo_kms_rest_ffi_fn_func_app_crypto_seal_blocking,RustBuffer.alloc_from_TypeAppSealInput(input))
2750
+ return result.consumeIntoTypeAppSealOutput
2751
+ end
2752
+
2753
+
2754
+
2755
+
2756
+
2757
+ def self.core_capabilities()
2758
+ result = KiboKmsRestFfi.rust_call(:uniffi_kibo_kms_rest_ffi_fn_func_core_capabilities,)
2759
+ return result.consumeIntoSequencestring
2760
+ end
2761
+
2762
+
2763
+
2764
+
2765
+
1863
2766
  def self.zk_decrypt(input)
1864
2767
  input = input
1865
2768
  RustBuffer.check_lower_TypeDecryptInput(input)