@openllmsh/sdk 2.10.19-alpha.5 → 2.10.22-alpha.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.
|
@@ -26824,6 +26824,9 @@
|
|
|
26824
26824
|
}
|
|
26825
26825
|
]
|
|
26826
26826
|
},
|
|
26827
|
+
"set_up": {
|
|
26828
|
+
"type": "boolean"
|
|
26829
|
+
},
|
|
26827
26830
|
"reset_epoch": {
|
|
26828
26831
|
"anyOf": [
|
|
26829
26832
|
{
|
|
@@ -26849,6 +26852,9 @@
|
|
|
26849
26852
|
}
|
|
26850
26853
|
]
|
|
26851
26854
|
},
|
|
26855
|
+
"home_sent": {
|
|
26856
|
+
"type": "boolean"
|
|
26857
|
+
},
|
|
26852
26858
|
"unlock_sent": {
|
|
26853
26859
|
"type": "boolean"
|
|
26854
26860
|
},
|
|
@@ -26880,12 +26886,54 @@
|
|
|
26880
26886
|
},
|
|
26881
26887
|
"challenge": {
|
|
26882
26888
|
"type": "string"
|
|
26889
|
+
},
|
|
26890
|
+
"proof": {
|
|
26891
|
+
"anyOf": [
|
|
26892
|
+
{
|
|
26893
|
+
"type": "object",
|
|
26894
|
+
"properties": {
|
|
26895
|
+
"kind": {
|
|
26896
|
+
"type": "string",
|
|
26897
|
+
"enum": [
|
|
26898
|
+
"signed"
|
|
26899
|
+
]
|
|
26900
|
+
},
|
|
26901
|
+
"signature": {
|
|
26902
|
+
"type": "string"
|
|
26903
|
+
}
|
|
26904
|
+
},
|
|
26905
|
+
"required": [
|
|
26906
|
+
"kind",
|
|
26907
|
+
"signature"
|
|
26908
|
+
],
|
|
26909
|
+
"additionalProperties": false
|
|
26910
|
+
},
|
|
26911
|
+
{
|
|
26912
|
+
"type": "object",
|
|
26913
|
+
"properties": {
|
|
26914
|
+
"kind": {
|
|
26915
|
+
"type": "string",
|
|
26916
|
+
"enum": [
|
|
26917
|
+
"fresh"
|
|
26918
|
+
]
|
|
26919
|
+
}
|
|
26920
|
+
},
|
|
26921
|
+
"required": [
|
|
26922
|
+
"kind"
|
|
26923
|
+
],
|
|
26924
|
+
"additionalProperties": false
|
|
26925
|
+
},
|
|
26926
|
+
{
|
|
26927
|
+
"type": "null"
|
|
26928
|
+
}
|
|
26929
|
+
]
|
|
26883
26930
|
}
|
|
26884
26931
|
},
|
|
26885
26932
|
"required": [
|
|
26886
26933
|
"generation",
|
|
26887
26934
|
"pubkey",
|
|
26888
|
-
"challenge"
|
|
26935
|
+
"challenge",
|
|
26936
|
+
"proof"
|
|
26889
26937
|
],
|
|
26890
26938
|
"additionalProperties": false
|
|
26891
26939
|
},
|
|
@@ -26904,8 +26952,10 @@
|
|
|
26904
26952
|
"public_ipv4",
|
|
26905
26953
|
"failure_code",
|
|
26906
26954
|
"key_id",
|
|
26955
|
+
"set_up",
|
|
26907
26956
|
"reset_epoch",
|
|
26908
26957
|
"subject_id",
|
|
26958
|
+
"home_sent",
|
|
26909
26959
|
"unlock_sent",
|
|
26910
26960
|
"has_machine",
|
|
26911
26961
|
"boot",
|
|
@@ -27399,6 +27449,9 @@
|
|
|
27399
27449
|
}
|
|
27400
27450
|
]
|
|
27401
27451
|
},
|
|
27452
|
+
"set_up": {
|
|
27453
|
+
"type": "boolean"
|
|
27454
|
+
},
|
|
27402
27455
|
"reset_epoch": {
|
|
27403
27456
|
"anyOf": [
|
|
27404
27457
|
{
|
|
@@ -27424,6 +27477,9 @@
|
|
|
27424
27477
|
}
|
|
27425
27478
|
]
|
|
27426
27479
|
},
|
|
27480
|
+
"home_sent": {
|
|
27481
|
+
"type": "boolean"
|
|
27482
|
+
},
|
|
27427
27483
|
"unlock_sent": {
|
|
27428
27484
|
"type": "boolean"
|
|
27429
27485
|
},
|
|
@@ -27455,12 +27511,54 @@
|
|
|
27455
27511
|
},
|
|
27456
27512
|
"challenge": {
|
|
27457
27513
|
"type": "string"
|
|
27514
|
+
},
|
|
27515
|
+
"proof": {
|
|
27516
|
+
"anyOf": [
|
|
27517
|
+
{
|
|
27518
|
+
"type": "object",
|
|
27519
|
+
"properties": {
|
|
27520
|
+
"kind": {
|
|
27521
|
+
"type": "string",
|
|
27522
|
+
"enum": [
|
|
27523
|
+
"signed"
|
|
27524
|
+
]
|
|
27525
|
+
},
|
|
27526
|
+
"signature": {
|
|
27527
|
+
"type": "string"
|
|
27528
|
+
}
|
|
27529
|
+
},
|
|
27530
|
+
"required": [
|
|
27531
|
+
"kind",
|
|
27532
|
+
"signature"
|
|
27533
|
+
],
|
|
27534
|
+
"additionalProperties": false
|
|
27535
|
+
},
|
|
27536
|
+
{
|
|
27537
|
+
"type": "object",
|
|
27538
|
+
"properties": {
|
|
27539
|
+
"kind": {
|
|
27540
|
+
"type": "string",
|
|
27541
|
+
"enum": [
|
|
27542
|
+
"fresh"
|
|
27543
|
+
]
|
|
27544
|
+
}
|
|
27545
|
+
},
|
|
27546
|
+
"required": [
|
|
27547
|
+
"kind"
|
|
27548
|
+
],
|
|
27549
|
+
"additionalProperties": false
|
|
27550
|
+
},
|
|
27551
|
+
{
|
|
27552
|
+
"type": "null"
|
|
27553
|
+
}
|
|
27554
|
+
]
|
|
27458
27555
|
}
|
|
27459
27556
|
},
|
|
27460
27557
|
"required": [
|
|
27461
27558
|
"generation",
|
|
27462
27559
|
"pubkey",
|
|
27463
|
-
"challenge"
|
|
27560
|
+
"challenge",
|
|
27561
|
+
"proof"
|
|
27464
27562
|
],
|
|
27465
27563
|
"additionalProperties": false
|
|
27466
27564
|
},
|
|
@@ -27479,8 +27577,10 @@
|
|
|
27479
27577
|
"public_ipv4",
|
|
27480
27578
|
"failure_code",
|
|
27481
27579
|
"key_id",
|
|
27580
|
+
"set_up",
|
|
27482
27581
|
"reset_epoch",
|
|
27483
27582
|
"subject_id",
|
|
27583
|
+
"home_sent",
|
|
27484
27584
|
"unlock_sent",
|
|
27485
27585
|
"has_machine",
|
|
27486
27586
|
"boot",
|
|
@@ -27580,6 +27680,9 @@
|
|
|
27580
27680
|
}
|
|
27581
27681
|
]
|
|
27582
27682
|
},
|
|
27683
|
+
"set_up": {
|
|
27684
|
+
"type": "boolean"
|
|
27685
|
+
},
|
|
27583
27686
|
"reset_epoch": {
|
|
27584
27687
|
"anyOf": [
|
|
27585
27688
|
{
|
|
@@ -27605,6 +27708,9 @@
|
|
|
27605
27708
|
}
|
|
27606
27709
|
]
|
|
27607
27710
|
},
|
|
27711
|
+
"home_sent": {
|
|
27712
|
+
"type": "boolean"
|
|
27713
|
+
},
|
|
27608
27714
|
"unlock_sent": {
|
|
27609
27715
|
"type": "boolean"
|
|
27610
27716
|
},
|
|
@@ -27636,12 +27742,54 @@
|
|
|
27636
27742
|
},
|
|
27637
27743
|
"challenge": {
|
|
27638
27744
|
"type": "string"
|
|
27745
|
+
},
|
|
27746
|
+
"proof": {
|
|
27747
|
+
"anyOf": [
|
|
27748
|
+
{
|
|
27749
|
+
"type": "object",
|
|
27750
|
+
"properties": {
|
|
27751
|
+
"kind": {
|
|
27752
|
+
"type": "string",
|
|
27753
|
+
"enum": [
|
|
27754
|
+
"signed"
|
|
27755
|
+
]
|
|
27756
|
+
},
|
|
27757
|
+
"signature": {
|
|
27758
|
+
"type": "string"
|
|
27759
|
+
}
|
|
27760
|
+
},
|
|
27761
|
+
"required": [
|
|
27762
|
+
"kind",
|
|
27763
|
+
"signature"
|
|
27764
|
+
],
|
|
27765
|
+
"additionalProperties": false
|
|
27766
|
+
},
|
|
27767
|
+
{
|
|
27768
|
+
"type": "object",
|
|
27769
|
+
"properties": {
|
|
27770
|
+
"kind": {
|
|
27771
|
+
"type": "string",
|
|
27772
|
+
"enum": [
|
|
27773
|
+
"fresh"
|
|
27774
|
+
]
|
|
27775
|
+
}
|
|
27776
|
+
},
|
|
27777
|
+
"required": [
|
|
27778
|
+
"kind"
|
|
27779
|
+
],
|
|
27780
|
+
"additionalProperties": false
|
|
27781
|
+
},
|
|
27782
|
+
{
|
|
27783
|
+
"type": "null"
|
|
27784
|
+
}
|
|
27785
|
+
]
|
|
27639
27786
|
}
|
|
27640
27787
|
},
|
|
27641
27788
|
"required": [
|
|
27642
27789
|
"generation",
|
|
27643
27790
|
"pubkey",
|
|
27644
|
-
"challenge"
|
|
27791
|
+
"challenge",
|
|
27792
|
+
"proof"
|
|
27645
27793
|
],
|
|
27646
27794
|
"additionalProperties": false
|
|
27647
27795
|
},
|
|
@@ -27660,8 +27808,10 @@
|
|
|
27660
27808
|
"public_ipv4",
|
|
27661
27809
|
"failure_code",
|
|
27662
27810
|
"key_id",
|
|
27811
|
+
"set_up",
|
|
27663
27812
|
"reset_epoch",
|
|
27664
27813
|
"subject_id",
|
|
27814
|
+
"home_sent",
|
|
27665
27815
|
"unlock_sent",
|
|
27666
27816
|
"has_machine",
|
|
27667
27817
|
"boot",
|
|
@@ -28166,6 +28316,9 @@
|
|
|
28166
28316
|
}
|
|
28167
28317
|
]
|
|
28168
28318
|
},
|
|
28319
|
+
"set_up": {
|
|
28320
|
+
"type": "boolean"
|
|
28321
|
+
},
|
|
28169
28322
|
"reset_epoch": {
|
|
28170
28323
|
"anyOf": [
|
|
28171
28324
|
{
|
|
@@ -28191,6 +28344,9 @@
|
|
|
28191
28344
|
}
|
|
28192
28345
|
]
|
|
28193
28346
|
},
|
|
28347
|
+
"home_sent": {
|
|
28348
|
+
"type": "boolean"
|
|
28349
|
+
},
|
|
28194
28350
|
"unlock_sent": {
|
|
28195
28351
|
"type": "boolean"
|
|
28196
28352
|
},
|
|
@@ -28222,12 +28378,54 @@
|
|
|
28222
28378
|
},
|
|
28223
28379
|
"challenge": {
|
|
28224
28380
|
"type": "string"
|
|
28381
|
+
},
|
|
28382
|
+
"proof": {
|
|
28383
|
+
"anyOf": [
|
|
28384
|
+
{
|
|
28385
|
+
"type": "object",
|
|
28386
|
+
"properties": {
|
|
28387
|
+
"kind": {
|
|
28388
|
+
"type": "string",
|
|
28389
|
+
"enum": [
|
|
28390
|
+
"signed"
|
|
28391
|
+
]
|
|
28392
|
+
},
|
|
28393
|
+
"signature": {
|
|
28394
|
+
"type": "string"
|
|
28395
|
+
}
|
|
28396
|
+
},
|
|
28397
|
+
"required": [
|
|
28398
|
+
"kind",
|
|
28399
|
+
"signature"
|
|
28400
|
+
],
|
|
28401
|
+
"additionalProperties": false
|
|
28402
|
+
},
|
|
28403
|
+
{
|
|
28404
|
+
"type": "object",
|
|
28405
|
+
"properties": {
|
|
28406
|
+
"kind": {
|
|
28407
|
+
"type": "string",
|
|
28408
|
+
"enum": [
|
|
28409
|
+
"fresh"
|
|
28410
|
+
]
|
|
28411
|
+
}
|
|
28412
|
+
},
|
|
28413
|
+
"required": [
|
|
28414
|
+
"kind"
|
|
28415
|
+
],
|
|
28416
|
+
"additionalProperties": false
|
|
28417
|
+
},
|
|
28418
|
+
{
|
|
28419
|
+
"type": "null"
|
|
28420
|
+
}
|
|
28421
|
+
]
|
|
28225
28422
|
}
|
|
28226
28423
|
},
|
|
28227
28424
|
"required": [
|
|
28228
28425
|
"generation",
|
|
28229
28426
|
"pubkey",
|
|
28230
|
-
"challenge"
|
|
28427
|
+
"challenge",
|
|
28428
|
+
"proof"
|
|
28231
28429
|
],
|
|
28232
28430
|
"additionalProperties": false
|
|
28233
28431
|
},
|
|
@@ -28246,8 +28444,10 @@
|
|
|
28246
28444
|
"public_ipv4",
|
|
28247
28445
|
"failure_code",
|
|
28248
28446
|
"key_id",
|
|
28447
|
+
"set_up",
|
|
28249
28448
|
"reset_epoch",
|
|
28250
28449
|
"subject_id",
|
|
28450
|
+
"home_sent",
|
|
28251
28451
|
"unlock_sent",
|
|
28252
28452
|
"has_machine",
|
|
28253
28453
|
"boot",
|
|
@@ -28752,6 +28952,9 @@
|
|
|
28752
28952
|
}
|
|
28753
28953
|
]
|
|
28754
28954
|
},
|
|
28955
|
+
"set_up": {
|
|
28956
|
+
"type": "boolean"
|
|
28957
|
+
},
|
|
28755
28958
|
"reset_epoch": {
|
|
28756
28959
|
"anyOf": [
|
|
28757
28960
|
{
|
|
@@ -28777,6 +28980,9 @@
|
|
|
28777
28980
|
}
|
|
28778
28981
|
]
|
|
28779
28982
|
},
|
|
28983
|
+
"home_sent": {
|
|
28984
|
+
"type": "boolean"
|
|
28985
|
+
},
|
|
28780
28986
|
"unlock_sent": {
|
|
28781
28987
|
"type": "boolean"
|
|
28782
28988
|
},
|
|
@@ -28808,12 +29014,54 @@
|
|
|
28808
29014
|
},
|
|
28809
29015
|
"challenge": {
|
|
28810
29016
|
"type": "string"
|
|
29017
|
+
},
|
|
29018
|
+
"proof": {
|
|
29019
|
+
"anyOf": [
|
|
29020
|
+
{
|
|
29021
|
+
"type": "object",
|
|
29022
|
+
"properties": {
|
|
29023
|
+
"kind": {
|
|
29024
|
+
"type": "string",
|
|
29025
|
+
"enum": [
|
|
29026
|
+
"signed"
|
|
29027
|
+
]
|
|
29028
|
+
},
|
|
29029
|
+
"signature": {
|
|
29030
|
+
"type": "string"
|
|
29031
|
+
}
|
|
29032
|
+
},
|
|
29033
|
+
"required": [
|
|
29034
|
+
"kind",
|
|
29035
|
+
"signature"
|
|
29036
|
+
],
|
|
29037
|
+
"additionalProperties": false
|
|
29038
|
+
},
|
|
29039
|
+
{
|
|
29040
|
+
"type": "object",
|
|
29041
|
+
"properties": {
|
|
29042
|
+
"kind": {
|
|
29043
|
+
"type": "string",
|
|
29044
|
+
"enum": [
|
|
29045
|
+
"fresh"
|
|
29046
|
+
]
|
|
29047
|
+
}
|
|
29048
|
+
},
|
|
29049
|
+
"required": [
|
|
29050
|
+
"kind"
|
|
29051
|
+
],
|
|
29052
|
+
"additionalProperties": false
|
|
29053
|
+
},
|
|
29054
|
+
{
|
|
29055
|
+
"type": "null"
|
|
29056
|
+
}
|
|
29057
|
+
]
|
|
28811
29058
|
}
|
|
28812
29059
|
},
|
|
28813
29060
|
"required": [
|
|
28814
29061
|
"generation",
|
|
28815
29062
|
"pubkey",
|
|
28816
|
-
"challenge"
|
|
29063
|
+
"challenge",
|
|
29064
|
+
"proof"
|
|
28817
29065
|
],
|
|
28818
29066
|
"additionalProperties": false
|
|
28819
29067
|
},
|
|
@@ -28832,8 +29080,10 @@
|
|
|
28832
29080
|
"public_ipv4",
|
|
28833
29081
|
"failure_code",
|
|
28834
29082
|
"key_id",
|
|
29083
|
+
"set_up",
|
|
28835
29084
|
"reset_epoch",
|
|
28836
29085
|
"subject_id",
|
|
29086
|
+
"home_sent",
|
|
28837
29087
|
"unlock_sent",
|
|
28838
29088
|
"has_machine",
|
|
28839
29089
|
"boot",
|
|
@@ -29338,6 +29588,9 @@
|
|
|
29338
29588
|
}
|
|
29339
29589
|
]
|
|
29340
29590
|
},
|
|
29591
|
+
"set_up": {
|
|
29592
|
+
"type": "boolean"
|
|
29593
|
+
},
|
|
29341
29594
|
"reset_epoch": {
|
|
29342
29595
|
"anyOf": [
|
|
29343
29596
|
{
|
|
@@ -29363,6 +29616,9 @@
|
|
|
29363
29616
|
}
|
|
29364
29617
|
]
|
|
29365
29618
|
},
|
|
29619
|
+
"home_sent": {
|
|
29620
|
+
"type": "boolean"
|
|
29621
|
+
},
|
|
29366
29622
|
"unlock_sent": {
|
|
29367
29623
|
"type": "boolean"
|
|
29368
29624
|
},
|
|
@@ -29394,12 +29650,54 @@
|
|
|
29394
29650
|
},
|
|
29395
29651
|
"challenge": {
|
|
29396
29652
|
"type": "string"
|
|
29653
|
+
},
|
|
29654
|
+
"proof": {
|
|
29655
|
+
"anyOf": [
|
|
29656
|
+
{
|
|
29657
|
+
"type": "object",
|
|
29658
|
+
"properties": {
|
|
29659
|
+
"kind": {
|
|
29660
|
+
"type": "string",
|
|
29661
|
+
"enum": [
|
|
29662
|
+
"signed"
|
|
29663
|
+
]
|
|
29664
|
+
},
|
|
29665
|
+
"signature": {
|
|
29666
|
+
"type": "string"
|
|
29667
|
+
}
|
|
29668
|
+
},
|
|
29669
|
+
"required": [
|
|
29670
|
+
"kind",
|
|
29671
|
+
"signature"
|
|
29672
|
+
],
|
|
29673
|
+
"additionalProperties": false
|
|
29674
|
+
},
|
|
29675
|
+
{
|
|
29676
|
+
"type": "object",
|
|
29677
|
+
"properties": {
|
|
29678
|
+
"kind": {
|
|
29679
|
+
"type": "string",
|
|
29680
|
+
"enum": [
|
|
29681
|
+
"fresh"
|
|
29682
|
+
]
|
|
29683
|
+
}
|
|
29684
|
+
},
|
|
29685
|
+
"required": [
|
|
29686
|
+
"kind"
|
|
29687
|
+
],
|
|
29688
|
+
"additionalProperties": false
|
|
29689
|
+
},
|
|
29690
|
+
{
|
|
29691
|
+
"type": "null"
|
|
29692
|
+
}
|
|
29693
|
+
]
|
|
29397
29694
|
}
|
|
29398
29695
|
},
|
|
29399
29696
|
"required": [
|
|
29400
29697
|
"generation",
|
|
29401
29698
|
"pubkey",
|
|
29402
|
-
"challenge"
|
|
29699
|
+
"challenge",
|
|
29700
|
+
"proof"
|
|
29403
29701
|
],
|
|
29404
29702
|
"additionalProperties": false
|
|
29405
29703
|
},
|
|
@@ -29418,8 +29716,10 @@
|
|
|
29418
29716
|
"public_ipv4",
|
|
29419
29717
|
"failure_code",
|
|
29420
29718
|
"key_id",
|
|
29719
|
+
"set_up",
|
|
29421
29720
|
"reset_epoch",
|
|
29422
29721
|
"subject_id",
|
|
29722
|
+
"home_sent",
|
|
29423
29723
|
"unlock_sent",
|
|
29424
29724
|
"has_machine",
|
|
29425
29725
|
"boot",
|
|
@@ -30277,6 +30577,13 @@
|
|
|
30277
30577
|
"schema": {
|
|
30278
30578
|
"type": "object",
|
|
30279
30579
|
"properties": {
|
|
30580
|
+
"phase": {
|
|
30581
|
+
"type": "string",
|
|
30582
|
+
"enum": [
|
|
30583
|
+
"home",
|
|
30584
|
+
"key"
|
|
30585
|
+
]
|
|
30586
|
+
},
|
|
30280
30587
|
"boot_generation": {
|
|
30281
30588
|
"anyOf": [
|
|
30282
30589
|
{
|
|
@@ -30368,6 +30675,7 @@
|
|
|
30368
30675
|
}
|
|
30369
30676
|
},
|
|
30370
30677
|
"required": [
|
|
30678
|
+
"phase",
|
|
30371
30679
|
"boot_generation",
|
|
30372
30680
|
"envelope"
|
|
30373
30681
|
],
|
|
@@ -2,6 +2,7 @@ import type { TMintedApiKey } from "./api-key.js";
|
|
|
2
2
|
export declare const ROUTEBOX_HOME_HKDF_INFO = "openllm-routebox-home-v2";
|
|
3
3
|
export declare const ROUTEBOX_KEY_ID_HKDF_INFO = "openllm-routebox-key-id-v1";
|
|
4
4
|
export declare const ROUTEBOX_KEY_SECRET_HKDF_INFO = "openllm-routebox-key-secret-v1";
|
|
5
|
+
export declare const ROUTEBOX_IDENTITY_HKDF_INFO = "openllm-routebox-identity-v1";
|
|
5
6
|
/** Derive the box's home key; the caller must zero the returned bytes. */
|
|
6
7
|
export declare const deriveRouteboxHomeKey: (controlSeed: Uint8Array, subjectId: string, epoch: number) => Promise<Uint8Array>;
|
|
7
8
|
/** The box's API key id, in the ordinary base64url key-id encoding. */
|
|
@@ -14,3 +15,11 @@ export declare const deriveRouteboxKeySecret: (controlSeed: Uint8Array, subjectI
|
|
|
14
15
|
* the DEK-wrap nonces are random).
|
|
15
16
|
*/
|
|
16
17
|
export declare const mintRouteboxApiKey: (dek: Uint8Array, vaultVersion: number, controlSeed: Uint8Array, subjectId: string, epoch: number) => Promise<TMintedApiKey>;
|
|
18
|
+
/**
|
|
19
|
+
* The box's identity seed (an Ed25519 private key, RFC 8032 seed form). Sent
|
|
20
|
+
* to the box once, when it is set up, and kept only inside its encrypted home;
|
|
21
|
+
* the caller must zero the returned bytes.
|
|
22
|
+
*/
|
|
23
|
+
export declare const deriveRouteboxIdentitySeed: (controlSeed: Uint8Array, subjectId: string, epoch: number) => Promise<Uint8Array>;
|
|
24
|
+
/** The identity's public key (base64 of the raw 32 bytes): what a proof must verify against. */
|
|
25
|
+
export declare const deriveRouteboxIdentityPublicKey: (controlSeed: Uint8Array, subjectId: string, epoch: number) => Promise<string>;
|
|
@@ -5,7 +5,10 @@
|
|
|
5
5
|
*
|
|
6
6
|
* - the box's API key id (10 bytes, the normal key-id encoding),
|
|
7
7
|
* - the box's API key secret (32 bytes),
|
|
8
|
-
* - the home key that opens its encrypted home (LUKS)
|
|
8
|
+
* - the home key that opens its encrypted home (LUKS),
|
|
9
|
+
* - the box's identity: an Ed25519 seed the box keeps inside that home, with
|
|
10
|
+
* which it proves on every later boot that it is the machine this vault set
|
|
11
|
+
* up (`routebox-seal.ts`, the proof).
|
|
9
12
|
*
|
|
10
13
|
* all also depend on the box's reset epoch (see `saltOf`).
|
|
11
14
|
*
|
|
@@ -23,11 +26,13 @@
|
|
|
23
26
|
*/
|
|
24
27
|
import { OPENLLM_API_KEY_ID_BYTES, OPENLLM_API_KEY_SECRET_BYTES, } from "@openllmsh/sdk/protocol";
|
|
25
28
|
import { mintApiKeyFrom } from "./api-key.js";
|
|
26
|
-
import {
|
|
29
|
+
import { getPublicKeyAsync } from "@noble/ed25519";
|
|
30
|
+
import { hkdfSha256, toB64, toB64Url, zero } from "./crypto.js";
|
|
27
31
|
import { DEVICE_CONTROL_SEED_BYTES } from "./device-control.js";
|
|
28
32
|
export const ROUTEBOX_HOME_HKDF_INFO = "openllm-routebox-home-v2";
|
|
29
33
|
export const ROUTEBOX_KEY_ID_HKDF_INFO = "openllm-routebox-key-id-v1";
|
|
30
34
|
export const ROUTEBOX_KEY_SECRET_HKDF_INFO = "openllm-routebox-key-secret-v1";
|
|
35
|
+
export const ROUTEBOX_IDENTITY_HKDF_INFO = "openllm-routebox-identity-v1";
|
|
31
36
|
/**
|
|
32
37
|
* The salt: the subject id and the box's reset epoch. A Reset increments the
|
|
33
38
|
* epoch, so it derives a NEW key id, secret and home key (an old `sk-llm` is
|
|
@@ -77,3 +82,19 @@ export const mintRouteboxApiKey = async (dek, vaultVersion, controlSeed, subject
|
|
|
77
82
|
zero(secret);
|
|
78
83
|
}
|
|
79
84
|
};
|
|
85
|
+
/**
|
|
86
|
+
* The box's identity seed (an Ed25519 private key, RFC 8032 seed form). Sent
|
|
87
|
+
* to the box once, when it is set up, and kept only inside its encrypted home;
|
|
88
|
+
* the caller must zero the returned bytes.
|
|
89
|
+
*/
|
|
90
|
+
export const deriveRouteboxIdentitySeed = (controlSeed, subjectId, epoch) => derive(controlSeed, subjectId, epoch, ROUTEBOX_IDENTITY_HKDF_INFO, 32);
|
|
91
|
+
/** The identity's public key (base64 of the raw 32 bytes): what a proof must verify against. */
|
|
92
|
+
export const deriveRouteboxIdentityPublicKey = async (controlSeed, subjectId, epoch) => {
|
|
93
|
+
const seed = await deriveRouteboxIdentitySeed(controlSeed, subjectId, epoch);
|
|
94
|
+
try {
|
|
95
|
+
return toB64(await getPublicKeyAsync(seed));
|
|
96
|
+
}
|
|
97
|
+
finally {
|
|
98
|
+
zero(seed);
|
|
99
|
+
}
|
|
100
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Seal a Routebox's unlock to the one-time token its current boot made
|
|
2
|
+
* Seal a Routebox's unlock to the one-time token its current boot made, and
|
|
3
|
+
* check the boot's proof that it is the box this vault set up.
|
|
3
4
|
*
|
|
4
5
|
* The box generates a fresh X25519 keypair on every boot and keeps the
|
|
5
6
|
* private half in RAM (`/run`, tmpfs). The browser seals to the public half:
|
|
@@ -7,24 +8,38 @@
|
|
|
7
8
|
* construction as `public-key-seal.ts`, so the box can open it with Python's
|
|
8
9
|
* `cryptography` (cloud-init's own dependency) and no OpenLLM binary change.
|
|
9
10
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
11
|
+
* Every boot is unlocked in two phases:
|
|
12
|
+
*
|
|
13
|
+
* 1. `home`: only the home key. The box opens its encrypted home and answers
|
|
14
|
+
* with a PROOF: an Ed25519 signature, by the identity key kept inside that
|
|
15
|
+
* home, over this boot (`routeboxProofMessage`), or `fresh` when the home
|
|
16
|
+
* holds no identity yet (a new box, or a machine re-imaged under it).
|
|
17
|
+
* 2. `key`: the box's API key, sealed only once the proof verifies against
|
|
18
|
+
* the identity the vault derives (`deriveRouteboxIdentityPublicKey`). A
|
|
19
|
+
* `fresh` box gets it, with the identity seed to keep, only when the user
|
|
20
|
+
* set it up on purpose. So a machine that merely claims the box's IP (a
|
|
21
|
+
* re-image, or a boot key written into the database) never receives a key
|
|
22
|
+
* that carries the vault.
|
|
23
|
+
*
|
|
24
|
+
* The associated data binds each envelope to the phase, user, box, boot
|
|
25
|
+
* generation, boot public key and challenge, so an envelope sealed for one
|
|
26
|
+
* boot or phase can't be replayed into another, and the server, which only
|
|
27
|
+
* stores and forwards the ciphertext, can't redirect it.
|
|
14
28
|
*
|
|
15
29
|
* Deliberately NOT re-exported from `vault/index.ts` (the `openllm` binary
|
|
16
30
|
* imports that barrel). Import by subpath:
|
|
17
31
|
* `@openllmsh/sdk/vault/routebox-seal`.
|
|
18
32
|
*
|
|
19
|
-
* The box side mirrors `open_unlock` in
|
|
33
|
+
* The box side mirrors `open_unlock` and `prove` in
|
|
20
34
|
* `packages/api/lib/routebox/box-agent.ts` (Python).
|
|
21
35
|
*/
|
|
22
36
|
export declare const ROUTEBOX_SEAL_DOMAIN = "openllm-routebox-seal-v1";
|
|
37
|
+
export declare const ROUTEBOX_PROOF_DOMAIN = "openllm-routebox-proof-v1";
|
|
38
|
+
/** Which half of a boot's unlock an envelope carries. */
|
|
39
|
+
export type TRouteboxUnlockPhase = "home" | "key";
|
|
23
40
|
export type TRouteboxSealBinding = {
|
|
24
41
|
readonly userId: string;
|
|
25
42
|
readonly boxId: string;
|
|
26
|
-
/** The box's API key; its home key derives from this key's anchor. */
|
|
27
|
-
readonly keyId: string;
|
|
28
43
|
readonly bootGeneration: number;
|
|
29
44
|
/** The boot's X25519 public key, base64 of the raw 32 bytes. */
|
|
30
45
|
readonly bootPubkeyB64: string;
|
|
@@ -38,19 +53,32 @@ export type TRouteboxEnvelope = {
|
|
|
38
53
|
readonly nonce: string;
|
|
39
54
|
readonly ct: string;
|
|
40
55
|
};
|
|
56
|
+
/** The `home` phase: opens the box's encrypted home, nothing more. */
|
|
57
|
+
export type TRouteboxHomeUnlock = {
|
|
58
|
+
readonly home_key: string;
|
|
59
|
+
};
|
|
41
60
|
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
* before installing it recovers on its next boot.
|
|
61
|
+
* The `key` phase: the box's ANCHORED `sk-llm` key (so its daemon pins the
|
|
62
|
+
* control key, which WebRTC needs), and, only when the box is being set up,
|
|
63
|
+
* the identity seed it keeps inside its home from then on.
|
|
46
64
|
*/
|
|
47
|
-
export type
|
|
48
|
-
readonly home_key: string;
|
|
65
|
+
export type TRouteboxKeyUnlock = {
|
|
49
66
|
readonly api_key: string;
|
|
67
|
+
readonly identity_seed?: string;
|
|
50
68
|
};
|
|
69
|
+
export type TRouteboxUnlockFor<TPhase extends TRouteboxUnlockPhase> = TPhase extends "home" ? TRouteboxHomeUnlock : TRouteboxKeyUnlock;
|
|
51
70
|
/** Canonical associated data; the Python side builds the same bytes. */
|
|
52
|
-
export declare const routeboxSealAad: (binding: TRouteboxSealBinding) => Uint8Array;
|
|
53
|
-
/**
|
|
54
|
-
export declare const
|
|
71
|
+
export declare const routeboxSealAad: (phase: TRouteboxUnlockPhase, binding: TRouteboxSealBinding) => Uint8Array;
|
|
72
|
+
/** What the box signs to prove its identity for this boot; Python builds the same bytes. */
|
|
73
|
+
export declare const routeboxProofMessage: (binding: TRouteboxSealBinding) => Uint8Array;
|
|
74
|
+
/**
|
|
75
|
+
* Does `signatureB64` prove this boot holds the identity whose public key is
|
|
76
|
+
* `identityPublicKeyB64`? Any malformed input is simply "no".
|
|
77
|
+
*/
|
|
78
|
+
export declare const verifyRouteboxProof: (binding: TRouteboxSealBinding, signatureB64: string, identityPublicKeyB64: string) => Promise<boolean>;
|
|
79
|
+
/** Sign a proof with the identity seed (tests; the box signs in Python). */
|
|
80
|
+
export declare const signRouteboxProof: (binding: TRouteboxSealBinding, identitySeed: Uint8Array) => Promise<string>;
|
|
81
|
+
/** Seal one phase of the unlock to the boot in `binding`. */
|
|
82
|
+
export declare const sealRouteboxUnlock: <TPhase extends TRouteboxUnlockPhase>(phase: TPhase, binding: TRouteboxSealBinding, unlock: TRouteboxUnlockFor<TPhase>) => Promise<TRouteboxEnvelope>;
|
|
55
83
|
/** Open an envelope with the boot's private key (tests; the box uses Python). */
|
|
56
|
-
export declare const openRouteboxUnlock: (binding: TRouteboxSealBinding, envelope: TRouteboxEnvelope, bootPrivateKey: CryptoKey) => Promise<
|
|
84
|
+
export declare const openRouteboxUnlock: <TPhase extends TRouteboxUnlockPhase>(phase: TPhase, binding: TRouteboxSealBinding, envelope: TRouteboxEnvelope, bootPrivateKey: CryptoKey) => Promise<TRouteboxUnlockFor<TPhase>>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Seal a Routebox's unlock to the one-time token its current boot made
|
|
2
|
+
* Seal a Routebox's unlock to the one-time token its current boot made, and
|
|
3
|
+
* check the boot's proof that it is the box this vault set up.
|
|
3
4
|
*
|
|
4
5
|
* The box generates a fresh X25519 keypair on every boot and keeps the
|
|
5
6
|
* private half in RAM (`/run`, tmpfs). The browser seals to the public half:
|
|
@@ -7,28 +8,52 @@
|
|
|
7
8
|
* construction as `public-key-seal.ts`, so the box can open it with Python's
|
|
8
9
|
* `cryptography` (cloud-init's own dependency) and no OpenLLM binary change.
|
|
9
10
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
11
|
+
* Every boot is unlocked in two phases:
|
|
12
|
+
*
|
|
13
|
+
* 1. `home`: only the home key. The box opens its encrypted home and answers
|
|
14
|
+
* with a PROOF: an Ed25519 signature, by the identity key kept inside that
|
|
15
|
+
* home, over this boot (`routeboxProofMessage`), or `fresh` when the home
|
|
16
|
+
* holds no identity yet (a new box, or a machine re-imaged under it).
|
|
17
|
+
* 2. `key`: the box's API key, sealed only once the proof verifies against
|
|
18
|
+
* the identity the vault derives (`deriveRouteboxIdentityPublicKey`). A
|
|
19
|
+
* `fresh` box gets it, with the identity seed to keep, only when the user
|
|
20
|
+
* set it up on purpose. So a machine that merely claims the box's IP (a
|
|
21
|
+
* re-image, or a boot key written into the database) never receives a key
|
|
22
|
+
* that carries the vault.
|
|
23
|
+
*
|
|
24
|
+
* The associated data binds each envelope to the phase, user, box, boot
|
|
25
|
+
* generation, boot public key and challenge, so an envelope sealed for one
|
|
26
|
+
* boot or phase can't be replayed into another, and the server, which only
|
|
27
|
+
* stores and forwards the ciphertext, can't redirect it.
|
|
14
28
|
*
|
|
15
29
|
* Deliberately NOT re-exported from `vault/index.ts` (the `openllm` binary
|
|
16
30
|
* imports that barrel). Import by subpath:
|
|
17
31
|
* `@openllmsh/sdk/vault/routebox-seal`.
|
|
18
32
|
*
|
|
19
|
-
* The box side mirrors `open_unlock` in
|
|
33
|
+
* The box side mirrors `open_unlock` and `prove` in
|
|
20
34
|
* `packages/api/lib/routebox/box-agent.ts` (Python).
|
|
21
35
|
*/
|
|
36
|
+
import { signAsync, verifyAsync } from "@noble/ed25519";
|
|
22
37
|
import { fromB64, toB64, zero } from "./crypto.js";
|
|
23
38
|
import { openX25519, sealX25519 } from "./x25519-seal.js";
|
|
24
39
|
export const ROUTEBOX_SEAL_DOMAIN = "openllm-routebox-seal-v1";
|
|
40
|
+
export const ROUTEBOX_PROOF_DOMAIN = "openllm-routebox-proof-v1";
|
|
25
41
|
const encoder = new TextEncoder();
|
|
26
42
|
/** Canonical associated data; the Python side builds the same bytes. */
|
|
27
|
-
export const routeboxSealAad = (binding) => encoder.encode(JSON.stringify([
|
|
43
|
+
export const routeboxSealAad = (phase, binding) => encoder.encode(JSON.stringify([
|
|
28
44
|
ROUTEBOX_SEAL_DOMAIN,
|
|
45
|
+
phase,
|
|
46
|
+
binding.userId,
|
|
47
|
+
binding.boxId,
|
|
48
|
+
binding.bootGeneration,
|
|
49
|
+
binding.bootPubkeyB64,
|
|
50
|
+
binding.challengeB64,
|
|
51
|
+
]));
|
|
52
|
+
/** What the box signs to prove its identity for this boot; Python builds the same bytes. */
|
|
53
|
+
export const routeboxProofMessage = (binding) => encoder.encode(JSON.stringify([
|
|
54
|
+
ROUTEBOX_PROOF_DOMAIN,
|
|
29
55
|
binding.userId,
|
|
30
56
|
binding.boxId,
|
|
31
|
-
binding.keyId,
|
|
32
57
|
binding.bootGeneration,
|
|
33
58
|
binding.bootPubkeyB64,
|
|
34
59
|
binding.challengeB64,
|
|
@@ -40,8 +65,25 @@ const raw32 = (b64, what) => {
|
|
|
40
65
|
}
|
|
41
66
|
return bytes;
|
|
42
67
|
};
|
|
43
|
-
/**
|
|
44
|
-
|
|
68
|
+
/**
|
|
69
|
+
* Does `signatureB64` prove this boot holds the identity whose public key is
|
|
70
|
+
* `identityPublicKeyB64`? Any malformed input is simply "no".
|
|
71
|
+
*/
|
|
72
|
+
export const verifyRouteboxProof = async (binding, signatureB64, identityPublicKeyB64) => {
|
|
73
|
+
try {
|
|
74
|
+
const signature = fromB64(signatureB64);
|
|
75
|
+
if (signature.length !== 64)
|
|
76
|
+
return false;
|
|
77
|
+
return await verifyAsync(signature, routeboxProofMessage(binding), raw32(identityPublicKeyB64, "identity public key"));
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
/** Sign a proof with the identity seed (tests; the box signs in Python). */
|
|
84
|
+
export const signRouteboxProof = async (binding, identitySeed) => toB64(await signAsync(routeboxProofMessage(binding), identitySeed));
|
|
85
|
+
/** Seal one phase of the unlock to the boot in `binding`. */
|
|
86
|
+
export const sealRouteboxUnlock = async (phase, binding, unlock) => {
|
|
45
87
|
raw32(binding.challengeB64, "challenge");
|
|
46
88
|
const plaintext = encoder.encode(JSON.stringify(unlock));
|
|
47
89
|
try {
|
|
@@ -50,7 +92,7 @@ export const sealRouteboxUnlock = async (binding, unlock) => {
|
|
|
50
92
|
recipientB64: binding.bootPubkeyB64,
|
|
51
93
|
recipientBytes: raw32(binding.bootPubkeyB64, "boot public key"),
|
|
52
94
|
format: "raw",
|
|
53
|
-
aad: routeboxSealAad(binding),
|
|
95
|
+
aad: routeboxSealAad(phase, binding),
|
|
54
96
|
plaintext,
|
|
55
97
|
});
|
|
56
98
|
}
|
|
@@ -58,8 +100,28 @@ export const sealRouteboxUnlock = async (binding, unlock) => {
|
|
|
58
100
|
zero(plaintext);
|
|
59
101
|
}
|
|
60
102
|
};
|
|
103
|
+
const isRecord = (value) => typeof value === "object" && value !== null;
|
|
104
|
+
const parsePhase = (phase, parsed) => {
|
|
105
|
+
if (!isRecord(parsed))
|
|
106
|
+
throw new Error("malformed routebox unlock payload");
|
|
107
|
+
if (phase === "home") {
|
|
108
|
+
if (typeof parsed.home_key !== "string" || "api_key" in parsed) {
|
|
109
|
+
throw new Error("malformed routebox home unlock");
|
|
110
|
+
}
|
|
111
|
+
return { home_key: parsed.home_key };
|
|
112
|
+
}
|
|
113
|
+
if (typeof parsed.api_key !== "string" ||
|
|
114
|
+
"home_key" in parsed ||
|
|
115
|
+
(parsed.identity_seed !== undefined &&
|
|
116
|
+
typeof parsed.identity_seed !== "string")) {
|
|
117
|
+
throw new Error("malformed routebox key unlock");
|
|
118
|
+
}
|
|
119
|
+
return typeof parsed.identity_seed === "string"
|
|
120
|
+
? { api_key: parsed.api_key, identity_seed: parsed.identity_seed }
|
|
121
|
+
: { api_key: parsed.api_key };
|
|
122
|
+
};
|
|
61
123
|
/** Open an envelope with the boot's private key (tests; the box uses Python). */
|
|
62
|
-
export const openRouteboxUnlock = async (binding, envelope, bootPrivateKey) => {
|
|
124
|
+
export const openRouteboxUnlock = async (phase, binding, envelope, bootPrivateKey) => {
|
|
63
125
|
if (envelope.v !== 1)
|
|
64
126
|
throw new Error("unknown envelope version");
|
|
65
127
|
const plaintext = await openX25519({
|
|
@@ -69,21 +131,13 @@ export const openRouteboxUnlock = async (binding, envelope, bootPrivateKey) => {
|
|
|
69
131
|
epkBytes: raw32(envelope.epk, "ephemeral key"),
|
|
70
132
|
epkB64: envelope.epk,
|
|
71
133
|
format: "raw",
|
|
72
|
-
aad: routeboxSealAad(binding),
|
|
134
|
+
aad: routeboxSealAad(phase, binding),
|
|
73
135
|
nonce: fromB64(envelope.nonce),
|
|
74
136
|
ct: fromB64(envelope.ct),
|
|
75
137
|
});
|
|
76
138
|
try {
|
|
77
139
|
const parsed = JSON.parse(new TextDecoder().decode(plaintext));
|
|
78
|
-
|
|
79
|
-
parsed === null ||
|
|
80
|
-
!("home_key" in parsed) ||
|
|
81
|
-
!("api_key" in parsed) ||
|
|
82
|
-
typeof parsed.home_key !== "string" ||
|
|
83
|
-
typeof parsed.api_key !== "string") {
|
|
84
|
-
throw new Error("malformed routebox unlock payload");
|
|
85
|
-
}
|
|
86
|
-
return { home_key: parsed.home_key, api_key: parsed.api_key };
|
|
140
|
+
return parsePhase(phase, parsed);
|
|
87
141
|
}
|
|
88
142
|
finally {
|
|
89
143
|
zero(plaintext);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openllmsh/sdk",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.22-alpha.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The OpenLLM SDK: typed API contracts, wire-format adapters, the device tunnel, client-side vault crypto, the OpenAPI spec and MCP tools.",
|
|
6
6
|
"keywords": [
|