You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
summary: Retrieve a single-use session nonce for client provisioning
449
-
description: Returns a cryptographically random single-use nonce. No authentication required. Returns 409 if provisioning mode is not active. The nonce is regenerated on each call.
448
+
summary: Exchange credentials for a per-device provisioning token
449
+
description: >
450
+
Authenticates an unprovisioned controller by UUID and MAC address, and returns a short-lived
451
+
bearer token for use in subsequent provisioning requests. The token is bound to the requesting
452
+
device's MAC address and has a sliding expiry window (5 minutes in production, 30 minutes in
453
+
debug builds). A second POST for the same MAC invalidates the previous token. Only accessible
454
+
via the provisioning SoftAP — Ethernet requests are rejected.
455
+
requestBody:
456
+
required: true
457
+
content:
458
+
application/json:
459
+
schema:
460
+
type: object
461
+
required:
462
+
- uuid
463
+
- mac_address
464
+
properties:
465
+
uuid:
466
+
$ref: '#/components/schemas/uuid'
467
+
mac_address:
468
+
$ref: '#/components/schemas/macAddress'
469
+
description: MAC address of the requesting controller. Must match the mac field stored in the controller record.
450
470
responses:
451
471
'200':
452
-
description: OK
472
+
description: OK — token issued
453
473
content:
454
474
application/json:
455
475
schema:
456
476
type: object
457
477
properties:
458
-
nonce:
478
+
token:
459
479
type: integer
460
480
format: int64
461
-
description: Single-use session nonce; must be passed as the x-nonce header in the subsequent GET /api/provisioning/client call
481
+
description: Per-device provisioning token. Pass as the provisioning-token header in subsequent GET requests.
462
482
example: 3819273645
463
-
'403':
464
-
description: Forbidden — request did not arrive via the provisioning SoftAP network
465
-
content:
466
-
application/json:
467
-
schema:
468
-
$ref: '#/components/schemas/error_message'
469
-
example:
470
-
message: Only accessible via provisioning network
471
-
'405':
472
-
description: Method Not Allowed
473
-
'409':
474
-
description: Conflict
475
-
content:
476
-
application/json:
477
-
schema:
478
-
$ref: '#/components/schemas/error_message'
479
-
example:
480
-
message: Provisioning mode inactive
481
-
482
-
/api/provisioning/client:
483
-
get:
484
-
tags:
485
-
- Controllers
486
-
summary: Retrieve a client configuration during active provisioning
487
-
description: Returns the full client configuration JSON for the device identified by the mac-address header. Requires provisioning mode to be active, a valid unused nonce, and a MAC address that matches a registered client record. The nonce is invalidated after a successful response.
488
-
security:
489
-
- macAddress: []
490
-
parameters:
491
-
- in: header
492
-
name: x-nonce
493
-
required: true
494
-
schema:
495
-
type: integer
496
-
format: int64
497
-
description: Single-use nonce obtained from GET /api/provisioning/nonce
498
-
responses:
499
-
'200':
500
-
description: OK
501
-
content:
502
-
application/json:
503
-
schema:
504
-
$ref: '#/components/schemas/client'
505
-
'401':
506
-
description: Unauthorized — missing or invalid mac-address or x-nonce header
507
-
'403':
508
-
description: Forbidden — request did not arrive via the provisioning SoftAP network, or MAC address not in the provisioning allowlist
509
-
content:
510
-
application/json:
511
-
schema:
512
-
$ref: '#/components/schemas/error_message'
513
-
example:
514
-
message: Request will not be fulfilled
515
-
'404':
516
-
description: Not Found — no client record matches the provided MAC address
517
-
'405':
518
-
description: Method Not Allowed
519
-
'409':
520
-
description: Conflict
521
-
content:
522
-
application/json:
523
-
schema:
524
-
$ref: '#/components/schemas/error_message'
525
-
example:
526
-
message: Provisioning mode inactive
527
-
'500':
528
-
description: Internal Server Error
529
-
content:
530
-
application/json:
531
-
schema:
532
-
$ref: '#/components/schemas/error_message'
533
-
example:
534
-
message: File system not mounted
535
-
536
-
/api/provisioning/controller:
537
-
get:
538
-
tags:
539
-
- Controllers
540
-
summary: Retrieve all controller and client records during active provisioning
541
-
description: Returns a JSON bundle containing all controller records and all client records stored on the source controller. Intended for controller-to-controller provisioning — an unprovisioned controller connecting via the provisioning SoftAP uses this endpoint to pull the full configuration. Requires provisioning mode to be active, a valid unused nonce, and a MAC address that matches a registered controller record. The nonce is invalidated after a successful response.
542
-
security:
543
-
- macAddress: []
544
-
parameters:
545
-
- in: header
546
-
name: x-nonce
547
-
required: true
548
-
schema:
549
-
type: integer
550
-
format: int64
551
-
description: Single-use nonce obtained from GET /api/provisioning/nonce
552
-
- in: header
553
-
name: x-device-uuid
554
-
required: false
555
-
schema:
556
-
type: string
557
-
format: uuid
558
-
description: UUID of the requesting controller. When provided, the host attempts a direct file lookup by UUID and verifies the MAC matches before falling back to full enumeration.
559
-
responses:
560
-
'200':
561
-
description: OK
483
+
'400':
484
+
description: Bad Request — uuid must be 36 characters, or mac_address is missing
562
485
content:
563
486
application/json:
564
487
schema:
565
-
type: object
566
-
properties:
567
-
controllers:
568
-
type: array
569
-
description: All controller records stored on the source controller, each augmented with a uuid field set to the record's filename
570
-
items:
571
-
$ref: '#/components/schemas/controller'
572
-
clients:
573
-
type: array
574
-
description: All client records stored on the source controller, each augmented with a uuid field set to the record's filename
575
-
items:
576
-
$ref: '#/components/schemas/client'
488
+
$ref: '#/components/schemas/bad_request_message'
577
489
'401':
578
-
description: Unauthorized — missing or invalid mac-address or x-nonce header
490
+
description: Unauthorized — MAC address does not match the stored controller record
579
491
'403':
580
492
description: Forbidden — request did not arrive via the provisioning SoftAP network
581
493
content:
@@ -585,11 +497,11 @@ paths:
585
497
example:
586
498
message: Only accessible via provisioning network
587
499
'404':
588
-
description: Not Found — no controller record matches the provided MAC address
500
+
description: Not Found — no controller record found for the provided UUID, or the record has no mac field
589
501
'405':
590
502
description: Method Not Allowed
591
503
'409':
592
-
description: Conflict
504
+
description: Conflict — provisioning mode is not active
593
505
content:
594
506
application/json:
595
507
schema:
@@ -602,8 +514,6 @@ paths:
602
514
application/json:
603
515
schema:
604
516
$ref: '#/components/schemas/error_message'
605
-
example:
606
-
message: File system not mounted
607
517
608
518
609
519
/api/provisioning/certs:
@@ -682,6 +592,7 @@ paths:
682
592
description: Retrieve the list of defined controller UUIDs
683
593
security:
684
594
- visualToken: []
595
+
- provisioningToken: []
685
596
responses:
686
597
'200':
687
598
description: OK
@@ -710,6 +621,7 @@ paths:
710
621
description: Retrieve a controller
711
622
security:
712
623
- visualToken: []
624
+
- provisioningToken: []
713
625
parameters:
714
626
- in: path
715
627
name: uuid
@@ -817,6 +729,7 @@ paths:
817
729
description: Retrieve the list of defined client UUIDs
818
730
security:
819
731
- visualToken: []
732
+
- provisioningToken: []
820
733
responses:
821
734
'200':
822
735
description: OK
@@ -845,7 +758,7 @@ paths:
845
758
description: Retrieve a client
846
759
security:
847
760
- visualToken: []
848
-
- macAddress: []
761
+
- provisioningToken: []
849
762
parameters:
850
763
- in: path
851
764
name: uuid
@@ -860,26 +773,26 @@ paths:
860
773
application/json:
861
774
schema:
862
775
$ref: '#/components/schemas/client'
863
-
'400':
864
-
description: Bad Request
865
-
content:
866
-
application/json:
867
-
schema:
868
-
$ref: '#/components/schemas/error_message'
869
-
example:
870
-
message: Provisioning mode inactive
871
776
'401':
872
777
description: Unauthorized
873
778
'403':
874
-
description: Forbidden
779
+
description: Forbidden — provisioning-token request did not arrive via the provisioning SoftAP network
875
780
content:
876
781
application/json:
877
782
schema:
878
783
$ref: '#/components/schemas/error_message'
879
784
example:
880
-
message: Request will not be fulfilled
785
+
message: Only accessible via provisioning network
881
786
'404':
882
787
description: Not Found
788
+
'409':
789
+
description: Conflict — provisioning-token used but provisioning mode is not active
790
+
content:
791
+
application/json:
792
+
schema:
793
+
$ref: '#/components/schemas/error_message'
794
+
example:
795
+
message: Provisioning mode inactive
883
796
'500':
884
797
description: Internal Server Error
885
798
content:
@@ -995,6 +908,7 @@ paths:
995
908
description: Retrieves the backup of the database in Dexie format.
996
909
security:
997
910
- visualToken: []
911
+
- provisioningToken: []
998
912
responses:
999
913
'200':
1000
914
description: OK
@@ -1009,8 +923,24 @@ paths:
1009
923
$ref: '#/components/schemas/dexieFormat'
1010
924
'401':
1011
925
description: Unauthorized
926
+
'403':
927
+
description: Forbidden — provisioning-token request did not arrive via the provisioning SoftAP network
928
+
content:
929
+
application/json:
930
+
schema:
931
+
$ref: '#/components/schemas/error_message'
932
+
example:
933
+
message: Only accessible via provisioning network
1012
934
'404':
1013
935
description: Not Found
936
+
'409':
937
+
description: Conflict — provisioning-token used but provisioning mode is not active
938
+
content:
939
+
application/json:
940
+
schema:
941
+
$ref: '#/components/schemas/error_message'
942
+
example:
943
+
message: Provisioning mode inactive
1014
944
'500':
1015
945
description: Internal Server Error
1016
946
content:
@@ -1236,7 +1166,13 @@ components:
1236
1166
type: apiKey
1237
1167
in: header
1238
1168
name: mac-address
1239
-
description: A client MAC address that matches the resource being requested, valid only while in provisoining mode
1169
+
description: A client MAC address that matches the resource being requested, valid only while in provisioning mode
1170
+
1171
+
provisioningToken:
1172
+
type: apiKey
1173
+
in: header
1174
+
name: provisioning-token
1175
+
description: A per-device token issued by POST /api/provisioning/token, valid while provisioning mode is active. Must be used via the provisioning SoftAP; tokens are refused on the Ethernet interface.
0 commit comments