feat: complete device onboarding and mobile binding workflows
ci / verify (push) Canceled after 0s

This commit is contained in:
Codex Local
2026-09-12 08:57:29 +08:00
parent 7846f30d0b
commit 98fb2965d0
116 changed files with 15669 additions and 64 deletions
+7
View File
@@ -124,6 +124,13 @@ func Apply(ctx context.Context, tx pgx.Tx, input Input) (Result, error) {
if err != nil {
return Result{}, fmt.Errorf("parse stored device activation state: %w", err)
}
var enrollmentMode string
if err := tx.QueryRow(ctx, `SELECT enrollment_mode FROM device WHERE id=$1::uuid`, input.DeviceID).Scan(&enrollmentMode); err != nil {
return Result{}, err
}
if enrollmentMode == "physical_confirm" && input.Source != "onboarding" && (target == Active || target == Bound || target == Provisioning) {
return Result{}, ErrTransitionRejected
}
if input.ExpectedRevision != nil && revision != *input.ExpectedRevision {
return Result{}, ErrRevisionConflict
}