@synopackageland/cli 0.8.0 → 0.9.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.
- package/CHANGELOG.md +124 -0
- package/README.md +26 -4
- package/dist/add.js +4 -17
- package/dist/authorization-sdk.d.ts +0 -1
- package/dist/authorization-sdk.js +0 -1
- package/dist/build-spk/gateway.js +2 -2
- package/dist/build-spk/notices.js +12 -8
- package/dist/capability-overlays.d.ts +15 -0
- package/dist/capability-overlays.js +18 -0
- package/dist/cli-version.d.ts +2 -0
- package/dist/cli-version.js +3 -0
- package/dist/cli.js +3 -1
- package/dist/error-registry.js +12 -4
- package/dist/info.js +2 -1
- package/dist/init.js +52 -58
- package/dist/reproducible.js +1 -1
- package/dist/runtime/delegate-contract.d.ts +15 -0
- package/dist/runtime/delegate-contract.js +2 -0
- package/dist/runtime/executor-build.d.ts +15 -1
- package/dist/runtime/executor-build.js +42 -11
- package/dist/runtime/executor-digests.json +13 -0
- package/dist/runtime/executor-inspect.d.ts +1 -0
- package/dist/runtime/executor-inspect.js +5 -2
- package/dist/runtime/executor-policy.d.ts +3 -1
- package/dist/runtime/executor-policy.js +7 -2
- package/dist/runtime/executor-source.d.ts +21 -0
- package/dist/runtime/executor-source.js +35 -0
- package/dist/runtime/executor-tasks.d.ts +5 -2
- package/dist/runtime/executor-tasks.js +6 -4
- package/dist/runtime/sdk-source.d.ts +31 -0
- package/dist/runtime/sdk-source.js +92 -0
- package/dist/standalone/api-permissions.d.ts +4 -1
- package/dist/standalone/api-permissions.js +10 -18
- package/dist/standalone/build.d.ts +1 -0
- package/dist/standalone/build.js +11 -4
- package/dist/standalone/daemon.js +2 -2
- package/dist/standalone/dsm-window.js +2 -2
- package/dist/standalone/manifest.d.ts +5 -2
- package/dist/standalone/manifest.js +9 -3
- package/dist/standalone/root-window.d.ts +1 -1
- package/dist/standalone/root-window.js +0 -1
- package/dist/standalone/sdk-check.d.ts +9 -0
- package/dist/standalone/sdk-check.js +43 -0
- package/dist/standalone/spk.js +1 -1
- package/dist/template-paths.d.ts +7 -2
- package/dist/template-paths.js +18 -6
- package/package.json +13 -3
- package/dist/templates/_executor/README.md +0 -318
- package/dist/templates/_executor/anchor.go +0 -156
- package/dist/templates/_executor/anchor_test.go +0 -161
- package/dist/templates/_executor/apppriv_review_test.go +0 -28
- package/dist/templates/_executor/auth_presence_review_test.go +0 -38
- package/dist/templates/_executor/cancel_contract_test.go +0 -236
- package/dist/templates/_executor/cmd/lifecycle/main.go +0 -42
- package/dist/templates/_executor/cookie_review_test.go +0 -27
- package/dist/templates/_executor/copy.go +0 -64
- package/dist/templates/_executor/copy_test.go +0 -88
- package/dist/templates/_executor/digest_review_test.go +0 -120
- package/dist/templates/_executor/directories.go +0 -40
- package/dist/templates/_executor/dsm.go +0 -369
- package/dist/templates/_executor/dsm_test.go +0 -290
- package/dist/templates/_executor/executor.go +0 -735
- package/dist/templates/_executor/executor_test.go +0 -314
- package/dist/templates/_executor/go.mod +0 -5
- package/dist/templates/_executor/identity.go +0 -74
- package/dist/templates/_executor/identity_kernel_linux_test.go +0 -60
- package/dist/templates/_executor/identity_linux.go +0 -82
- package/dist/templates/_executor/identity_security_test.go +0 -43
- package/dist/templates/_executor/internal/lifecycle/lifecycle.go +0 -95
- package/dist/templates/_executor/internal/lifecycle/lifecycle_test.go +0 -232
- package/dist/templates/_executor/internal/taskscript/boot.sh +0 -31
- package/dist/templates/_executor/internal/taskscript/cmd/main.go +0 -19
- package/dist/templates/_executor/internal/taskscript/control.sh +0 -31
- package/dist/templates/_executor/internal/taskscript/tasks.go +0 -44
- package/dist/templates/_executor/json_review_test.go +0 -40
- package/dist/templates/_executor/lifecycle_test.go +0 -97
- package/dist/templates/_executor/link_linux.go +0 -28
- package/dist/templates/_executor/long_running_test.go +0 -530
- package/dist/templates/_executor/main.go +0 -576
- package/dist/templates/_executor/managed.go +0 -117
- package/dist/templates/_executor/managed_test.go +0 -137
- package/dist/templates/_executor/move_linux.go +0 -490
- package/dist/templates/_executor/move_linux_test.go +0 -460
- package/dist/templates/_executor/move_validation.go +0 -46
- package/dist/templates/_executor/move_validation_test.go +0 -187
- package/dist/templates/_executor/operations.go +0 -926
- package/dist/templates/_executor/path_test.go +0 -35
- package/dist/templates/_executor/pid.go +0 -37
- package/dist/templates/_executor/pid_test.go +0 -113
- package/dist/templates/_executor/platform_linux.go +0 -187
- package/dist/templates/_executor/platform_linux_test.go +0 -191
- package/dist/templates/_executor/platform_other.go +0 -76
- package/dist/templates/_executor/process.go +0 -142
- package/dist/templates/_executor/purge_log.go +0 -18
- package/dist/templates/_executor/records.go +0 -242
- package/dist/templates/_executor/scope_cancel_contract_test.go +0 -91
- package/dist/templates/_executor/scope_client.go +0 -37
- package/dist/templates/_executor/scope_contract.go +0 -12
- package/dist/templates/_executor/selected_scope.go +0 -146
- package/dist/templates/_executor/selected_scope_test.go +0 -186
- package/dist/templates/_executor/socket_linux_test.go +0 -46
- package/dist/templates/_executor/status_disabled_test.go +0 -33
- package/dist/templates/_executor/store.go +0 -91
- package/dist/templates/_executor/supervise.go +0 -109
- package/dist/templates/_executor/supervise_test.go +0 -130
- package/dist/templates/_executor/task_race_review_test.go +0 -47
- package/dist/templates/_executor/tasks.go +0 -320
- package/dist/templates/_executor/tasks_dsm71_test.go +0 -114
- package/dist/templates/_executor/tasks_review_test.go +0 -43
- package/dist/templates/_executor/tasks_test.go +0 -223
- package/dist/templates/_executor/testdata/evidence/cleanup.json +0 -24
- package/dist/templates/_executor/testdata/evidence/final-smoke.jsonl +0 -9
- package/dist/templates/_executor/testdata/evidence/kernel-acl.json +0 -6
- package/dist/templates/_executor/testdata/evidence/linux-tests.log +0 -123
- package/dist/templates/_executor/testdata/evidence/live.jsonl +0 -23
- package/dist/templates/_executor/testdata/evidence/storage.json +0 -90
- package/dist/templates/_executor/testdata/evidence/validation.json +0 -55
- package/dist/templates/_executor/testdata/live_probe.py +0 -98
- package/dist/templates/_executor/upgrade_watch_test.go +0 -244
- package/dist/templates/_executor/watch.go +0 -164
- package/dist/templates/_executor/watch_test.go +0 -291
- package/dist/templates/_executor/write_review_linux_test.go +0 -87
- package/dist/templates/_shared/AGENTS.md +0 -146
- package/dist/templates/_shared/CLAUDE.md +0 -1
- package/dist/templates/_shared/third-party-notices.mjs +0 -51
- package/dist/templates/binary/LICENSES/GO-LICENSE +0 -27
- package/dist/templates/binary/LICENSES/GO-PATENTS +0 -22
- package/dist/templates/binary/dsm-package.yaml +0 -46
- package/dist/templates/binary/example/main.go +0 -16
- package/dist/templates/binary/gitignore +0 -2
- package/dist/templates/binary/i18n/messages/de.json +0 -4
- package/dist/templates/binary/i18n/messages/en.json +0 -4
- package/dist/templates/binary/i18n/messages/es.json +0 -4
- package/dist/templates/binary/i18n/messages/fr.json +0 -4
- package/dist/templates/binary/i18n/messages/it.json +0 -4
- package/dist/templates/binary/i18n/messages/ja.json +0 -4
- package/dist/templates/binary/i18n/messages/ko.json +0 -4
- package/dist/templates/binary/i18n/messages/zh-CN.json +0 -4
- package/dist/templates/binary/i18n/messages/zh-TW.json +0 -4
- package/dist/templates/binary/ui/app.css +0 -4
- package/dist/templates/binary/ui/app.js +0 -32
- package/dist/templates/compose/compose.yaml +0 -8
- package/dist/templates/compose/synology-app.yaml +0 -16
- package/dist/templates/native-authorization/AuthorizationGate.vue +0 -91
- package/dist/templates/native-authorization/i18n/de.json +0 -37
- package/dist/templates/native-authorization/i18n/en.json +0 -37
- package/dist/templates/native-authorization/i18n/es.json +0 -37
- package/dist/templates/native-authorization/i18n/fr.json +0 -37
- package/dist/templates/native-authorization/i18n/index.ts +0 -15
- package/dist/templates/native-authorization/i18n/it.json +0 -37
- package/dist/templates/native-authorization/i18n/ja.json +0 -37
- package/dist/templates/native-authorization/i18n/ko.json +0 -37
- package/dist/templates/native-authorization/i18n/zh-CN.json +0 -37
- package/dist/templates/native-authorization/i18n/zh-TW.json +0 -37
- package/dist/templates/native-go/README.md +0 -459
- package/dist/templates/native-go/backend/THIRD_PARTY_NOTICES.txt +0 -61
- package/dist/templates/native-go/backend/cmd/app/main.go +0 -95
- package/dist/templates/native-go/backend/cmd/background-worker/main.go +0 -38
- package/dist/templates/native-go/backend/go.mod +0 -9
- package/dist/templates/native-go/backend/go.sum +0 -4
- package/dist/templates/native-go/backend/internal/api/cgi_framing_test.go +0 -32
- package/dist/templates/native-go/backend/internal/api/cookie_review_test.go +0 -28
- package/dist/templates/native-go/backend/internal/api/deadline_test.go +0 -114
- package/dist/templates/native-go/backend/internal/api/dsm-session.go +0 -54
- package/dist/templates/native-go/backend/internal/api/dsm-session_test.go +0 -51
- package/dist/templates/native-go/backend/internal/api/entry_test.go +0 -47
- package/dist/templates/native-go/backend/internal/api/errors.go +0 -47
- package/dist/templates/native-go/backend/internal/api/permissions.go +0 -161
- package/dist/templates/native-go/backend/internal/api/permissions.json +0 -5
- package/dist/templates/native-go/backend/internal/api/permissions_test.go +0 -113
- package/dist/templates/native-go/backend/internal/api/policy_fixture_test.go +0 -8
- package/dist/templates/native-go/backend/internal/api/registry.go +0 -142
- package/dist/templates/native-go/backend/internal/api/registry_test.go +0 -344
- package/dist/templates/native-go/backend/internal/api/resource_limits_test.go +0 -87
- package/dist/templates/native-go/backend/internal/api/sdk-permissions.json +0 -59
- package/dist/templates/native-go/backend/internal/api/sdk_policy_test.go +0 -31
- package/dist/templates/native-go/backend/internal/api/server.go +0 -305
- package/dist/templates/native-go/backend/internal/api/testdata/permissions-cases.json +0 -172
- package/dist/templates/native-go/backend/internal/app/background.go +0 -249
- package/dist/templates/native-go/backend/internal/app/background_none.go +0 -8
- package/dist/templates/native-go/backend/internal/app/background_owner.go +0 -38
- package/dist/templates/native-go/backend/internal/app/background_owner_test.go +0 -163
- package/dist/templates/native-go/backend/internal/app/background_schedule.go +0 -69
- package/dist/templates/native-go/backend/internal/app/background_schedule_test.go +0 -62
- package/dist/templates/native-go/backend/internal/app/background_test.go +0 -320
- package/dist/templates/native-go/backend/internal/app/delegate_config.go +0 -57
- package/dist/templates/native-go/backend/internal/app/delegate_config_test.go +0 -28
- package/dist/templates/native-go/backend/internal/app/delegate_none.go +0 -5
- package/dist/templates/native-go/backend/internal/app/identity.go +0 -20
- package/dist/templates/native-go/backend/internal/app/identity_test.go +0 -15
- package/dist/templates/native-go/backend/internal/app/migrations.go +0 -41
- package/dist/templates/native-go/backend/internal/app/migrations_test.go +0 -41
- package/dist/templates/native-go/backend/internal/app/portal.go +0 -30
- package/dist/templates/native-go/backend/internal/app/portal_test.go +0 -55
- package/dist/templates/native-go/backend/internal/app/root_none.go +0 -9
- package/dist/templates/native-go/backend/internal/app/routes.go +0 -137
- package/dist/templates/native-go/backend/internal/app/routes_test.go +0 -165
- package/dist/templates/native-go/backend/internal/app/session_files.go +0 -9
- package/dist/templates/native-go/backend/internal/app/session_files_test.go +0 -14
- package/dist/templates/native-go/backend/internal/app/shared_folder.go +0 -144
- package/dist/templates/native-go/backend/internal/app/shared_folder_test.go +0 -158
- package/dist/templates/native-go/backend/internal/background/access.go +0 -57
- package/dist/templates/native-go/backend/internal/background/lock_test.go +0 -131
- package/dist/templates/native-go/backend/internal/background/owner_test.go +0 -118
- package/dist/templates/native-go/backend/internal/background/runner.go +0 -185
- package/dist/templates/native-go/backend/internal/background/runner_test.go +0 -209
- package/dist/templates/native-go/backend/internal/background/schedule.go +0 -336
- package/dist/templates/native-go/backend/internal/background/schedule_test.go +0 -368
- package/dist/templates/native-go/backend/internal/background/store.go +0 -825
- package/dist/templates/native-go/backend/internal/background/store_test.go +0 -365
- package/dist/templates/native-go/backend/internal/datamigrate/migrate.go +0 -191
- package/dist/templates/native-go/backend/internal/datamigrate/migrate_test.go +0 -177
- package/dist/templates/native-go/backend/internal/dsm/admin.go +0 -76
- package/dist/templates/native-go/backend/internal/dsm/admin_linux.go +0 -110
- package/dist/templates/native-go/backend/internal/dsm/admin_linux_test.go +0 -105
- package/dist/templates/native-go/backend/internal/dsm/admin_other.go +0 -15
- package/dist/templates/native-go/backend/internal/dsm/admin_test.go +0 -67
- package/dist/templates/native-go/backend/internal/dsm/apppriv.go +0 -30
- package/dist/templates/native-go/backend/internal/dsm/auth.go +0 -94
- package/dist/templates/native-go/backend/internal/dsm/auth_test.go +0 -159
- package/dist/templates/native-go/backend/internal/dsm/bridge_file.go +0 -75
- package/dist/templates/native-go/backend/internal/dsm/bridge_file_test.go +0 -57
- package/dist/templates/native-go/backend/internal/dsm/entry.go +0 -177
- package/dist/templates/native-go/backend/internal/dsm/entry_test.go +0 -315
- package/dist/templates/native-go/backend/internal/dsm/native/admin-aarch64.elf +0 -0
- package/dist/templates/native-go/backend/internal/dsm/native/admin-armv7.elf +0 -0
- package/dist/templates/native-go/backend/internal/dsm/native/admin-x86_64.elf +0 -0
- package/dist/templates/native-go/backend/internal/dsm/native/admin_check.c +0 -28
- package/dist/templates/native-go/backend/internal/dsm/native/apppriv-aarch64.elf +0 -0
- package/dist/templates/native-go/backend/internal/dsm/native/apppriv-armv7.elf +0 -0
- package/dist/templates/native-go/backend/internal/dsm/native/apppriv-x86_64.elf +0 -0
- package/dist/templates/native-go/backend/internal/dsm/native/apppriv_check.c +0 -33
- package/dist/templates/native-go/backend/internal/dsm/native/build.sh +0 -18
- package/dist/templates/native-go/backend/internal/dsm/native/licenses/GLIBC-NOTICES.txt +0 -400
- package/dist/templates/native-go/backend/internal/dsm/native/licenses/LGPL-2.1.txt +0 -501
- package/dist/templates/native-go/backend/internal/dsm/native/licenses/SOURCE.txt +0 -5
- package/dist/templates/native-go/backend/internal/dsm/native/licenses/ZIG-MIT.txt +0 -21
- package/dist/templates/native-go/backend/internal/dsm/native/provenance.json +0 -18
- package/dist/templates/native-go/backend/internal/filestation/browse_test.go +0 -67
- package/dist/templates/native-go/backend/internal/filestation/check_permission.go +0 -71
- package/dist/templates/native-go/backend/internal/filestation/check_permission_test.go +0 -77
- package/dist/templates/native-go/backend/internal/filestation/client.go +0 -337
- package/dist/templates/native-go/backend/internal/filestation/client_test.go +0 -155
- package/dist/templates/native-go/backend/internal/filestation/doc.go +0 -4
- package/dist/templates/native-go/backend/internal/filestation/download_dsm71_test.go +0 -82
- package/dist/templates/native-go/backend/internal/filestation/http.go +0 -70
- package/dist/templates/native-go/backend/internal/filestation/http_test.go +0 -188
- package/dist/templates/native-go/backend/internal/filestation/operations_test.go +0 -206
- package/dist/templates/native-go/backend/internal/filestation/read_file_test.go +0 -89
- package/dist/templates/native-go/backend/internal/filestation/sdk_policy_test.go +0 -39
- package/dist/templates/native-go/backend/internal/filestation/service.go +0 -254
- package/dist/templates/native-go/backend/internal/filestation/service_test.go +0 -74
- package/dist/templates/native-go/backend/internal/filestation/upload_stream.go +0 -76
- package/dist/templates/native-go/backend/internal/filestation/upload_stream_test.go +0 -77
- package/dist/templates/native-go/backend/internal/filestation/write.go +0 -32
- package/dist/templates/native-go/backend/internal/filestation/write_test.go +0 -124
- package/dist/templates/native-go/backend/internal/identity/README.md +0 -59
- package/dist/templates/native-go/backend/internal/identity/dsm.go +0 -115
- package/dist/templates/native-go/backend/internal/identity/http.go +0 -291
- package/dist/templates/native-go/backend/internal/identity/identity_test.go +0 -530
- package/dist/templates/native-go/backend/internal/identity/service.go +0 -159
- package/dist/templates/native-go/backend/internal/identity/store.go +0 -109
- package/dist/templates/native-go/backend/internal/jsonlimits/limits.go +0 -48
- package/dist/templates/native-go/backend/internal/jsonlimits/limits_test.go +0 -52
- package/dist/templates/native-go/backend/internal/portal/portal.go +0 -138
- package/dist/templates/native-go/backend/internal/portal/portal_test.go +0 -89
- package/dist/templates/native-go/dsm-package.yaml +0 -71
- package/dist/templates/native-go/gitignore +0 -1
- package/dist/templates/native-go/i18n/glossary.json +0 -663
- package/dist/templates/native-go/i18n/messages/de.json +0 -29
- package/dist/templates/native-go/i18n/messages/en.json +0 -29
- package/dist/templates/native-go/i18n/messages/es.json +0 -29
- package/dist/templates/native-go/i18n/messages/fr.json +0 -29
- package/dist/templates/native-go/i18n/messages/it.json +0 -29
- package/dist/templates/native-go/i18n/messages/ja.json +0 -29
- package/dist/templates/native-go/i18n/messages/ko.json +0 -29
- package/dist/templates/native-go/i18n/messages/zh-CN.json +0 -29
- package/dist/templates/native-go/i18n/messages/zh-TW.json +0 -29
- package/dist/templates/native-go/ui/app.css +0 -45
- package/dist/templates/native-go/ui/app.js +0 -111
- package/dist/templates/native-go-delegate/DELEGATE.md +0 -263
- package/dist/templates/native-go-delegate/backend/cmd/background-worker/main.go +0 -48
- package/dist/templates/native-go-delegate/backend/internal/app/delegate.go +0 -25
- package/dist/templates/native-go-delegate/backend/internal/app/delegate_on.go +0 -5
- package/dist/templates/native-go-delegate/backend/internal/app/delegate_routes_test.go +0 -31
- package/dist/templates/native-go-delegate/backend/internal/background/delegate_review_test.go +0 -174
- package/dist/templates/native-go-delegate/backend/internal/background/delegated.go +0 -277
- package/dist/templates/native-go-delegate/backend/internal/background/delegated_moves.go +0 -270
- package/dist/templates/native-go-delegate/backend/internal/background/delegated_test.go +0 -34
- package/dist/templates/native-go-delegate/backend/internal/delegate/admission_recovery_test.go +0 -410
- package/dist/templates/native-go-delegate/backend/internal/delegate/busy_review_test.go +0 -15
- package/dist/templates/native-go-delegate/backend/internal/delegate/cancel_contract_test.go +0 -95
- package/dist/templates/native-go-delegate/backend/internal/delegate/client.go +0 -151
- package/dist/templates/native-go-delegate/backend/internal/delegate/client_test.go +0 -214
- package/dist/templates/native-go-delegate/backend/internal/delegate/destination.go +0 -110
- package/dist/templates/native-go-delegate/backend/internal/delegate/destination_state.go +0 -117
- package/dist/templates/native-go-delegate/backend/internal/delegate/destination_state_test.go +0 -60
- package/dist/templates/native-go-delegate/backend/internal/delegate/destination_test.go +0 -116
- package/dist/templates/native-go-delegate/backend/internal/delegate/example.go +0 -81
- package/dist/templates/native-go-delegate/backend/internal/delegate/example_test.go +0 -91
- package/dist/templates/native-go-delegate/backend/internal/delegate/executor_contract_test.go +0 -511
- package/dist/templates/native-go-delegate/backend/internal/delegate/files.go +0 -132
- package/dist/templates/native-go-delegate/backend/internal/delegate/long_running_routes.go +0 -92
- package/dist/templates/native-go-delegate/backend/internal/delegate/long_running_routes_test.go +0 -99
- package/dist/templates/native-go-delegate/backend/internal/delegate/move.go +0 -348
- package/dist/templates/native-go-delegate/backend/internal/delegate/move_test.go +0 -351
- package/dist/templates/native-go-delegate/backend/internal/delegate/operations_list.go +0 -65
- package/dist/templates/native-go-delegate/backend/internal/delegate/operations_list_test.go +0 -114
- package/dist/templates/native-go-delegate/backend/internal/delegate/retry.go +0 -106
- package/dist/templates/native-go-delegate/backend/internal/delegate/retry_test.go +0 -143
- package/dist/templates/native-go-delegate/backend/internal/delegate/service.go +0 -364
- package/dist/templates/native-go-delegate/backend/internal/delegate/service_test.go +0 -318
- package/dist/templates/native-go-delegate/backend/internal/delegate/staging.go +0 -121
- package/dist/templates/native-go-delegate/backend/internal/delegate/status_disabled_test.go +0 -51
- package/dist/templates/native-go-delegate/backend/internal/delegate/testdata/executor_contract.txt +0 -112
- package/dist/templates/native-go-delegate/backend/internal/delegate/transient_contract_test.go +0 -137
- package/dist/templates/native-go-delegate/backend/internal/delegate/wait_cancel_test.go +0 -101
- package/dist/templates/native-go-delegate/backend/internal/delegate/worker.go +0 -225
- package/dist/templates/native-go-delegate/backend/internal/filestation/files.go +0 -43
- package/dist/templates/native-go-delegate/backend/internal/filestation/files_test.go +0 -59
- package/dist/templates/native-go-delegate/frontend/src/CapabilityPanels.vue +0 -37
- package/dist/templates/native-go-delegate/frontend/src/delegate/BackgroundSavePanel.vue +0 -113
- package/dist/templates/native-go-delegate/frontend/src/delegate/DelegatePanel.vue +0 -70
- package/dist/templates/native-go-delegate/frontend/src/delegate/copy.ts +0 -8
- package/dist/templates/native-go-delegate/frontend/src/delegate/i18n/waiting.json +0 -11
- package/dist/templates/native-go-delegate/frontend/test/background-save.test.ts +0 -121
- package/dist/templates/native-go-delegate/frontend/test/delegate.test.ts +0 -145
- package/dist/templates/native-go-delegate/frontend/test/scope-settings.test.ts +0 -49
- package/dist/templates/native-go-delegate/test-frontend.sh +0 -12
- package/dist/templates/native-go-delegate/test.sh +0 -18
- package/dist/templates/native-go-jobs/BACKGROUND.md +0 -108
- package/dist/templates/native-go-jobs/backend/internal/app/background_on.go +0 -7
- package/dist/templates/native-go-jobs/backend/internal/app/background_routes_test.go +0 -90
- package/dist/templates/native-go-jobs/frontend/src/background/BackgroundPanel.vue +0 -170
- package/dist/templates/native-go-jobs/frontend/src/background/i18n/de.json +0 -75
- package/dist/templates/native-go-jobs/frontend/src/background/i18n/en.json +0 -75
- package/dist/templates/native-go-jobs/frontend/src/background/i18n/es.json +0 -75
- package/dist/templates/native-go-jobs/frontend/src/background/i18n/fr.json +0 -75
- package/dist/templates/native-go-jobs/frontend/src/background/i18n/it.json +0 -75
- package/dist/templates/native-go-jobs/frontend/src/background/i18n/ja.json +0 -75
- package/dist/templates/native-go-jobs/frontend/src/background/i18n/ko.json +0 -75
- package/dist/templates/native-go-jobs/frontend/src/background/i18n/zh-CN.json +0 -75
- package/dist/templates/native-go-jobs/frontend/src/background/i18n/zh-TW.json +0 -75
- package/dist/templates/native-go-jobs/frontend/src/background/i18n.ts +0 -19
- package/dist/templates/native-go-jobs/frontend/src/background/picker-provider.ts +0 -12
- package/dist/templates/native-go-jobs/frontend/src/background/request-key.ts +0 -5
- package/dist/templates/native-go-jobs/frontend/test/background.test.ts +0 -205
- package/dist/templates/native-go-root-ops/backend/internal/app/executor.go +0 -140
- package/dist/templates/native-go-root-ops/backend/internal/app/executor_test.go +0 -117
- package/dist/templates/native-go-root-ops/root/whoami.sh +0 -3
- package/dist/templates/native-go-vue/README.md +0 -47
- package/dist/templates/native-go-vue/frontend/DESIGN.md +0 -61
- package/dist/templates/native-go-vue/frontend/package-lock.json +0 -2530
- package/dist/templates/native-go-vue/frontend/package.json +0 -6
- package/dist/templates/native-go-vue/frontend/src/App.vue +0 -96
- package/dist/templates/native-go-vue/frontend/src/CapabilityPanels.vue +0 -6
- package/dist/templates/native-go-vue/frontend/src/context.ts +0 -78
- package/dist/templates/native-go-vue/frontend/src/delegate/ExecutorSettings.vue +0 -70
- package/dist/templates/native-go-vue/frontend/src/delegate/catalogs.ts +0 -11
- package/dist/templates/native-go-vue/frontend/src/delegate/copy.test.ts +0 -12
- package/dist/templates/native-go-vue/frontend/src/delegate/copy.ts +0 -4
- package/dist/templates/native-go-vue/frontend/src/delegate/executor-settings.test.ts +0 -23
- package/dist/templates/native-go-vue/frontend/src/delegate/executor-setup.ts +0 -24
- package/dist/templates/native-go-vue/frontend/src/delegate/facade.test.ts +0 -100
- package/dist/templates/native-go-vue/frontend/src/delegate/facade.ts +0 -85
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/de.json +0 -47
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/en.json +0 -47
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/es.json +0 -47
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/fr.json +0 -47
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/it.json +0 -47
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/ja.json +0 -47
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/ko.json +0 -47
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/save/de.json +0 -42
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/save/en.json +0 -42
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/save/es.json +0 -42
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/save/fr.json +0 -42
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/save/it.json +0 -42
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/save/ja.json +0 -42
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/save/ko.json +0 -42
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/save/zh-CN.json +0 -42
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/save/zh-TW.json +0 -42
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/zh-CN.json +0 -47
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/zh-TW.json +0 -47
- package/dist/templates/native-go-vue/frontend/src/delegate/long-running.ts +0 -57
- package/dist/templates/native-go-vue/frontend/src/delegate/save-copy.test.ts +0 -12
- package/dist/templates/native-go-vue/frontend/src/delegate/save-copy.ts +0 -24
- package/dist/templates/native-go-vue/frontend/src/delegate/scoped-picker.test.ts +0 -12
- package/dist/templates/native-go-vue/frontend/src/delegate/scoped-picker.ts +0 -21
- package/dist/templates/native-go-vue/frontend/src/files/FileBrowser.vue +0 -131
- package/dist/templates/native-go-vue/frontend/src/files/FilesPage.vue +0 -35
- package/dist/templates/native-go-vue/frontend/src/files/files.test.ts +0 -100
- package/dist/templates/native-go-vue/frontend/src/files/provider.test.ts +0 -48
- package/dist/templates/native-go-vue/frontend/src/files/transfers.test.ts +0 -27
- package/dist/templates/native-go-vue/frontend/src/files/transfers.ts +0 -25
- package/dist/templates/native-go-vue/frontend/src/i18n/de.json +0 -20
- package/dist/templates/native-go-vue/frontend/src/i18n/en.json +0 -20
- package/dist/templates/native-go-vue/frontend/src/i18n/es.json +0 -20
- package/dist/templates/native-go-vue/frontend/src/i18n/fr.json +0 -20
- package/dist/templates/native-go-vue/frontend/src/i18n/it.json +0 -20
- package/dist/templates/native-go-vue/frontend/src/i18n/ja.json +0 -20
- package/dist/templates/native-go-vue/frontend/src/i18n/ko.json +0 -20
- package/dist/templates/native-go-vue/frontend/src/i18n/zh-CN.json +0 -20
- package/dist/templates/native-go-vue/frontend/src/i18n/zh-TW.json +0 -20
- package/dist/templates/native-go-vue/frontend/src/i18n.ts +0 -13
- package/dist/templates/native-go-vue/frontend/src/identity/DESIGN.md +0 -46
- package/dist/templates/native-go-vue/frontend/src/identity/LoginPage.vue +0 -78
- package/dist/templates/native-go-vue/frontend/src/identity/i18n/de.json +0 -27
- package/dist/templates/native-go-vue/frontend/src/identity/i18n/en.json +0 -27
- package/dist/templates/native-go-vue/frontend/src/identity/i18n/es.json +0 -27
- package/dist/templates/native-go-vue/frontend/src/identity/i18n/fr.json +0 -27
- package/dist/templates/native-go-vue/frontend/src/identity/i18n/it.json +0 -27
- package/dist/templates/native-go-vue/frontend/src/identity/i18n/ja.json +0 -27
- package/dist/templates/native-go-vue/frontend/src/identity/i18n/ko.json +0 -27
- package/dist/templates/native-go-vue/frontend/src/identity/i18n/zh-CN.json +0 -27
- package/dist/templates/native-go-vue/frontend/src/identity/i18n/zh-TW.json +0 -27
- package/dist/templates/native-go-vue/frontend/src/identity/i18n.ts +0 -14
- package/dist/templates/native-go-vue/frontend/src/identity/login.test.ts +0 -32
- package/dist/templates/native-go-vue/frontend/src/identity/session.test.ts +0 -33
- package/dist/templates/native-go-vue/frontend/src/identity/session.ts +0 -74
- package/dist/templates/native-go-vue/frontend/src/main.ts +0 -32
- package/dist/templates/native-go-vue/frontend/src/nas/NasPicker.vue +0 -42
- package/dist/templates/native-go-vue/frontend/src/nas/contract.ts +0 -12
- package/dist/templates/native-go-vue/frontend/src/nas/destination.test.ts +0 -48
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/files/de.json +0 -41
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/files/en.json +0 -41
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/files/es.json +0 -41
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/files/fr.json +0 -41
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/files/it.json +0 -41
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/files/ja.json +0 -41
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/files/ko.json +0 -41
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/files/zh-CN.json +0 -41
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/files/zh-TW.json +0 -41
- package/dist/templates/native-go-vue/frontend/src/nas/i18n.ts +0 -2
- package/dist/templates/native-go-vue/frontend/src/nas/locale.ts +0 -24
- package/dist/templates/native-go-vue/frontend/src/nas/provider.ts +0 -50
- package/dist/templates/native-go-vue/frontend/src/nas/use-request.ts +0 -18
- package/dist/templates/native-go-vue/frontend/src/portal/PortalSettings.vue +0 -39
- package/dist/templates/native-go-vue/frontend/src/shell/AppShell.vue +0 -48
- package/dist/templates/native-go-vue/frontend/src/shell/i18n/de.json +0 -4
- package/dist/templates/native-go-vue/frontend/src/shell/i18n/en.json +0 -4
- package/dist/templates/native-go-vue/frontend/src/shell/i18n/es.json +0 -4
- package/dist/templates/native-go-vue/frontend/src/shell/i18n/fr.json +0 -4
- package/dist/templates/native-go-vue/frontend/src/shell/i18n/it.json +0 -4
- package/dist/templates/native-go-vue/frontend/src/shell/i18n/ja.json +0 -4
- package/dist/templates/native-go-vue/frontend/src/shell/i18n/ko.json +0 -4
- package/dist/templates/native-go-vue/frontend/src/shell/i18n/zh-CN.json +0 -4
- package/dist/templates/native-go-vue/frontend/src/shell/i18n/zh-TW.json +0 -4
- package/dist/templates/native-go-vue/frontend/src/shell/i18n.ts +0 -17
- package/dist/templates/native-go-vue/frontend/src/shell/pages.ts +0 -15
- package/dist/templates/native-go-vue/frontend/src/style.css +0 -27
- package/dist/templates/native-go-vue/frontend/test/apps.test.ts +0 -57
- package/dist/templates/native-go-vue/frontend/test/native-controls.test.ts +0 -27
- package/dist/templates/native-go-vue/frontend/test/portal-settings.test.ts +0 -71
- package/dist/templates/native-go-vue/frontend/test/shell-i18n.test.ts +0 -50
- package/dist/templates/native-go-vue/frontend/test/shell-ui.test.ts +0 -20
- package/dist/templates/native-go-vue/frontend/test/shell.test.ts +0 -30
- package/dist/templates/native-go-vue/frontend/tsconfig.json +0 -1
- package/dist/templates/native-go-vue/frontend/vite.config.ts +0 -10
- package/dist/templates/native-go-vue/gitignore +0 -2
- package/templates/_daemon/fixture_linux_test.go +0 -15
- package/templates/_daemon/fixture_other_test.go +0 -7
- package/templates/_daemon/go.mod +0 -5
- package/templates/_daemon/main.go +0 -611
- package/templates/_daemon/main_test.go +0 -315
- package/templates/_daemon/process_linux.go +0 -55
- package/templates/_daemon/process_linux_test.go +0 -161
- package/templates/_daemon/process_other.go +0 -14
- package/templates/_daemon/testdata/child.go +0 -44
- package/templates/_executor/README.md +0 -318
- package/templates/_executor/anchor.go +0 -156
- package/templates/_executor/anchor_test.go +0 -161
- package/templates/_executor/apppriv_review_test.go +0 -28
- package/templates/_executor/auth_presence_review_test.go +0 -38
- package/templates/_executor/cancel_contract_test.go +0 -236
- package/templates/_executor/cmd/lifecycle/main.go +0 -42
- package/templates/_executor/cookie_review_test.go +0 -27
- package/templates/_executor/copy.go +0 -64
- package/templates/_executor/copy_test.go +0 -88
- package/templates/_executor/digest_review_test.go +0 -120
- package/templates/_executor/directories.go +0 -40
- package/templates/_executor/dsm.go +0 -369
- package/templates/_executor/dsm_test.go +0 -290
- package/templates/_executor/executor.go +0 -735
- package/templates/_executor/executor_test.go +0 -314
- package/templates/_executor/go.mod +0 -5
- package/templates/_executor/identity.go +0 -74
- package/templates/_executor/identity_kernel_linux_test.go +0 -60
- package/templates/_executor/identity_linux.go +0 -82
- package/templates/_executor/identity_security_test.go +0 -43
- package/templates/_executor/internal/lifecycle/lifecycle.go +0 -95
- package/templates/_executor/internal/lifecycle/lifecycle_test.go +0 -232
- package/templates/_executor/internal/taskscript/boot.sh +0 -31
- package/templates/_executor/internal/taskscript/cmd/main.go +0 -19
- package/templates/_executor/internal/taskscript/control.sh +0 -31
- package/templates/_executor/internal/taskscript/tasks.go +0 -44
- package/templates/_executor/json_review_test.go +0 -40
- package/templates/_executor/lifecycle_test.go +0 -97
- package/templates/_executor/link_linux.go +0 -28
- package/templates/_executor/long_running_test.go +0 -530
- package/templates/_executor/main.go +0 -576
- package/templates/_executor/managed.go +0 -117
- package/templates/_executor/managed_test.go +0 -137
- package/templates/_executor/move_linux.go +0 -490
- package/templates/_executor/move_linux_test.go +0 -460
- package/templates/_executor/move_validation.go +0 -46
- package/templates/_executor/move_validation_test.go +0 -187
- package/templates/_executor/operations.go +0 -926
- package/templates/_executor/path_test.go +0 -35
- package/templates/_executor/pid.go +0 -37
- package/templates/_executor/pid_test.go +0 -113
- package/templates/_executor/platform_linux.go +0 -187
- package/templates/_executor/platform_linux_test.go +0 -191
- package/templates/_executor/platform_other.go +0 -76
- package/templates/_executor/process.go +0 -142
- package/templates/_executor/purge_log.go +0 -18
- package/templates/_executor/records.go +0 -242
- package/templates/_executor/scope_cancel_contract_test.go +0 -91
- package/templates/_executor/scope_client.go +0 -37
- package/templates/_executor/scope_contract.go +0 -12
- package/templates/_executor/selected_scope.go +0 -146
- package/templates/_executor/selected_scope_test.go +0 -186
- package/templates/_executor/socket_linux_test.go +0 -46
- package/templates/_executor/status_disabled_test.go +0 -33
- package/templates/_executor/store.go +0 -91
- package/templates/_executor/supervise.go +0 -109
- package/templates/_executor/supervise_test.go +0 -130
- package/templates/_executor/task_race_review_test.go +0 -47
- package/templates/_executor/tasks.go +0 -320
- package/templates/_executor/tasks_dsm71_test.go +0 -114
- package/templates/_executor/tasks_review_test.go +0 -43
- package/templates/_executor/tasks_test.go +0 -223
- package/templates/_executor/testdata/evidence/cleanup.json +0 -24
- package/templates/_executor/testdata/evidence/final-smoke.jsonl +0 -9
- package/templates/_executor/testdata/evidence/kernel-acl.json +0 -6
- package/templates/_executor/testdata/evidence/linux-tests.log +0 -123
- package/templates/_executor/testdata/evidence/live.jsonl +0 -23
- package/templates/_executor/testdata/evidence/storage.json +0 -90
- package/templates/_executor/testdata/evidence/validation.json +0 -55
- package/templates/_executor/testdata/live_probe.py +0 -98
- package/templates/_executor/upgrade_watch_test.go +0 -244
- package/templates/_executor/watch.go +0 -164
- package/templates/_executor/watch_test.go +0 -291
- package/templates/_executor/write_review_linux_test.go +0 -87
- package/templates/_gateway/auth.go +0 -101
- package/templates/_gateway/auth_test.go +0 -216
- package/templates/_gateway/cgi.go +0 -133
- package/templates/_gateway/cgi_test.go +0 -156
- package/templates/_gateway/csrf.go +0 -73
- package/templates/_gateway/csrf_test.go +0 -155
- package/templates/_gateway/directory.go +0 -108
- package/templates/_gateway/directory_test.go +0 -202
- package/templates/_gateway/gateway.go +0 -412
- package/templates/_gateway/gateway_test.go +0 -676
- package/templates/_gateway/go.mod +0 -5
- package/templates/_gateway/groups.go +0 -66
- package/templates/_gateway/main.go +0 -45
- package/templates/_shared/AGENTS.md +0 -146
- package/templates/_shared/CLAUDE.md +0 -1
- package/templates/_shared/GO-LICENSE +0 -27
- package/templates/_shared/GO-PATENTS +0 -22
- package/templates/_shared/LICENSES/TEMPLATE.txt +0 -21
- package/templates/_shared/third-party-notices.mjs +0 -51
- package/templates/binary/LICENSES/GO-LICENSE +0 -27
- package/templates/binary/LICENSES/GO-PATENTS +0 -22
- package/templates/binary/dsm-package.yaml +0 -46
- package/templates/binary/example/main.go +0 -16
- package/templates/binary/gitignore +0 -2
- package/templates/binary/i18n/messages/de.json +0 -4
- package/templates/binary/i18n/messages/en.json +0 -4
- package/templates/binary/i18n/messages/es.json +0 -4
- package/templates/binary/i18n/messages/fr.json +0 -4
- package/templates/binary/i18n/messages/it.json +0 -4
- package/templates/binary/i18n/messages/ja.json +0 -4
- package/templates/binary/i18n/messages/ko.json +0 -4
- package/templates/binary/i18n/messages/zh-CN.json +0 -4
- package/templates/binary/i18n/messages/zh-TW.json +0 -4
- package/templates/binary/ui/app.css +0 -4
- package/templates/binary/ui/app.js +0 -32
- package/templates/compose/compose.yaml +0 -8
- package/templates/compose/synology-app.yaml +0 -16
- package/templates/native-authorization/AuthorizationGate.vue +0 -91
- package/templates/native-authorization/i18n/de.json +0 -37
- package/templates/native-authorization/i18n/en.json +0 -37
- package/templates/native-authorization/i18n/es.json +0 -37
- package/templates/native-authorization/i18n/fr.json +0 -37
- package/templates/native-authorization/i18n/index.ts +0 -15
- package/templates/native-authorization/i18n/it.json +0 -37
- package/templates/native-authorization/i18n/ja.json +0 -37
- package/templates/native-authorization/i18n/ko.json +0 -37
- package/templates/native-authorization/i18n/zh-CN.json +0 -37
- package/templates/native-authorization/i18n/zh-TW.json +0 -37
- package/templates/native-go/README.md +0 -459
- package/templates/native-go/backend/THIRD_PARTY_NOTICES.txt +0 -61
- package/templates/native-go/backend/cmd/app/main.go +0 -95
- package/templates/native-go/backend/cmd/background-worker/main.go +0 -38
- package/templates/native-go/backend/go.mod +0 -9
- package/templates/native-go/backend/go.sum +0 -4
- package/templates/native-go/backend/internal/api/cgi_framing_test.go +0 -32
- package/templates/native-go/backend/internal/api/cookie_review_test.go +0 -28
- package/templates/native-go/backend/internal/api/deadline_test.go +0 -114
- package/templates/native-go/backend/internal/api/dsm-session.go +0 -54
- package/templates/native-go/backend/internal/api/dsm-session_test.go +0 -51
- package/templates/native-go/backend/internal/api/entry_test.go +0 -47
- package/templates/native-go/backend/internal/api/errors.go +0 -47
- package/templates/native-go/backend/internal/api/permissions.go +0 -161
- package/templates/native-go/backend/internal/api/permissions.json +0 -5
- package/templates/native-go/backend/internal/api/permissions_test.go +0 -113
- package/templates/native-go/backend/internal/api/policy_fixture_test.go +0 -8
- package/templates/native-go/backend/internal/api/registry.go +0 -142
- package/templates/native-go/backend/internal/api/registry_test.go +0 -344
- package/templates/native-go/backend/internal/api/resource_limits_test.go +0 -87
- package/templates/native-go/backend/internal/api/sdk-permissions.json +0 -59
- package/templates/native-go/backend/internal/api/sdk_policy_test.go +0 -31
- package/templates/native-go/backend/internal/api/server.go +0 -305
- package/templates/native-go/backend/internal/api/testdata/permissions-cases.json +0 -172
- package/templates/native-go/backend/internal/app/background.go +0 -249
- package/templates/native-go/backend/internal/app/background_none.go +0 -8
- package/templates/native-go/backend/internal/app/background_owner.go +0 -38
- package/templates/native-go/backend/internal/app/background_owner_test.go +0 -163
- package/templates/native-go/backend/internal/app/background_schedule.go +0 -69
- package/templates/native-go/backend/internal/app/background_schedule_test.go +0 -62
- package/templates/native-go/backend/internal/app/background_test.go +0 -320
- package/templates/native-go/backend/internal/app/delegate_config.go +0 -57
- package/templates/native-go/backend/internal/app/delegate_config_test.go +0 -28
- package/templates/native-go/backend/internal/app/delegate_none.go +0 -5
- package/templates/native-go/backend/internal/app/identity.go +0 -20
- package/templates/native-go/backend/internal/app/identity_test.go +0 -15
- package/templates/native-go/backend/internal/app/migrations.go +0 -41
- package/templates/native-go/backend/internal/app/migrations_test.go +0 -41
- package/templates/native-go/backend/internal/app/portal.go +0 -30
- package/templates/native-go/backend/internal/app/portal_test.go +0 -55
- package/templates/native-go/backend/internal/app/root_none.go +0 -9
- package/templates/native-go/backend/internal/app/routes.go +0 -137
- package/templates/native-go/backend/internal/app/routes_test.go +0 -165
- package/templates/native-go/backend/internal/app/session_files.go +0 -9
- package/templates/native-go/backend/internal/app/session_files_test.go +0 -14
- package/templates/native-go/backend/internal/app/shared_folder.go +0 -144
- package/templates/native-go/backend/internal/app/shared_folder_test.go +0 -158
- package/templates/native-go/backend/internal/background/access.go +0 -57
- package/templates/native-go/backend/internal/background/lock_test.go +0 -131
- package/templates/native-go/backend/internal/background/owner_test.go +0 -118
- package/templates/native-go/backend/internal/background/runner.go +0 -185
- package/templates/native-go/backend/internal/background/runner_test.go +0 -209
- package/templates/native-go/backend/internal/background/schedule.go +0 -336
- package/templates/native-go/backend/internal/background/schedule_test.go +0 -368
- package/templates/native-go/backend/internal/background/store.go +0 -825
- package/templates/native-go/backend/internal/background/store_test.go +0 -365
- package/templates/native-go/backend/internal/datamigrate/migrate.go +0 -191
- package/templates/native-go/backend/internal/datamigrate/migrate_test.go +0 -177
- package/templates/native-go/backend/internal/dsm/admin.go +0 -76
- package/templates/native-go/backend/internal/dsm/admin_linux.go +0 -110
- package/templates/native-go/backend/internal/dsm/admin_linux_test.go +0 -105
- package/templates/native-go/backend/internal/dsm/admin_other.go +0 -15
- package/templates/native-go/backend/internal/dsm/admin_test.go +0 -67
- package/templates/native-go/backend/internal/dsm/apppriv.go +0 -30
- package/templates/native-go/backend/internal/dsm/auth.go +0 -94
- package/templates/native-go/backend/internal/dsm/auth_test.go +0 -159
- package/templates/native-go/backend/internal/dsm/bridge_file.go +0 -75
- package/templates/native-go/backend/internal/dsm/bridge_file_test.go +0 -57
- package/templates/native-go/backend/internal/dsm/entry.go +0 -177
- package/templates/native-go/backend/internal/dsm/entry_test.go +0 -315
- package/templates/native-go/backend/internal/dsm/native/admin-aarch64.elf +0 -0
- package/templates/native-go/backend/internal/dsm/native/admin-armv7.elf +0 -0
- package/templates/native-go/backend/internal/dsm/native/admin-x86_64.elf +0 -0
- package/templates/native-go/backend/internal/dsm/native/admin_check.c +0 -28
- package/templates/native-go/backend/internal/dsm/native/apppriv-aarch64.elf +0 -0
- package/templates/native-go/backend/internal/dsm/native/apppriv-armv7.elf +0 -0
- package/templates/native-go/backend/internal/dsm/native/apppriv-x86_64.elf +0 -0
- package/templates/native-go/backend/internal/dsm/native/apppriv_check.c +0 -33
- package/templates/native-go/backend/internal/dsm/native/build.sh +0 -18
- package/templates/native-go/backend/internal/dsm/native/licenses/GLIBC-NOTICES.txt +0 -400
- package/templates/native-go/backend/internal/dsm/native/licenses/LGPL-2.1.txt +0 -501
- package/templates/native-go/backend/internal/dsm/native/licenses/SOURCE.txt +0 -5
- package/templates/native-go/backend/internal/dsm/native/licenses/ZIG-MIT.txt +0 -21
- package/templates/native-go/backend/internal/dsm/native/provenance.json +0 -18
- package/templates/native-go/backend/internal/filestation/browse_test.go +0 -67
- package/templates/native-go/backend/internal/filestation/check_permission.go +0 -71
- package/templates/native-go/backend/internal/filestation/check_permission_test.go +0 -77
- package/templates/native-go/backend/internal/filestation/client.go +0 -337
- package/templates/native-go/backend/internal/filestation/client_test.go +0 -155
- package/templates/native-go/backend/internal/filestation/doc.go +0 -4
- package/templates/native-go/backend/internal/filestation/download_dsm71_test.go +0 -82
- package/templates/native-go/backend/internal/filestation/http.go +0 -70
- package/templates/native-go/backend/internal/filestation/http_test.go +0 -188
- package/templates/native-go/backend/internal/filestation/operations_test.go +0 -206
- package/templates/native-go/backend/internal/filestation/read_file_test.go +0 -89
- package/templates/native-go/backend/internal/filestation/sdk_policy_test.go +0 -39
- package/templates/native-go/backend/internal/filestation/service.go +0 -254
- package/templates/native-go/backend/internal/filestation/service_test.go +0 -74
- package/templates/native-go/backend/internal/filestation/upload_stream.go +0 -76
- package/templates/native-go/backend/internal/filestation/upload_stream_test.go +0 -77
- package/templates/native-go/backend/internal/filestation/write.go +0 -32
- package/templates/native-go/backend/internal/filestation/write_test.go +0 -124
- package/templates/native-go/backend/internal/identity/README.md +0 -59
- package/templates/native-go/backend/internal/identity/dsm.go +0 -115
- package/templates/native-go/backend/internal/identity/http.go +0 -291
- package/templates/native-go/backend/internal/identity/identity_test.go +0 -530
- package/templates/native-go/backend/internal/identity/service.go +0 -159
- package/templates/native-go/backend/internal/identity/store.go +0 -109
- package/templates/native-go/backend/internal/jsonlimits/limits.go +0 -48
- package/templates/native-go/backend/internal/jsonlimits/limits_test.go +0 -52
- package/templates/native-go/backend/internal/portal/portal.go +0 -138
- package/templates/native-go/backend/internal/portal/portal_test.go +0 -89
- package/templates/native-go/dsm-package.yaml +0 -71
- package/templates/native-go/gitignore +0 -1
- package/templates/native-go/i18n/glossary.json +0 -663
- package/templates/native-go/i18n/messages/de.json +0 -29
- package/templates/native-go/i18n/messages/en.json +0 -29
- package/templates/native-go/i18n/messages/es.json +0 -29
- package/templates/native-go/i18n/messages/fr.json +0 -29
- package/templates/native-go/i18n/messages/it.json +0 -29
- package/templates/native-go/i18n/messages/ja.json +0 -29
- package/templates/native-go/i18n/messages/ko.json +0 -29
- package/templates/native-go/i18n/messages/zh-CN.json +0 -29
- package/templates/native-go/i18n/messages/zh-TW.json +0 -29
- package/templates/native-go/ui/app.css +0 -45
- package/templates/native-go/ui/app.js +0 -111
- package/templates/native-go-delegate/DELEGATE.md +0 -263
- package/templates/native-go-delegate/backend/cmd/background-worker/main.go +0 -48
- package/templates/native-go-delegate/backend/internal/app/delegate.go +0 -25
- package/templates/native-go-delegate/backend/internal/app/delegate_on.go +0 -5
- package/templates/native-go-delegate/backend/internal/app/delegate_routes_test.go +0 -31
- package/templates/native-go-delegate/backend/internal/background/delegate_review_test.go +0 -174
- package/templates/native-go-delegate/backend/internal/background/delegated.go +0 -277
- package/templates/native-go-delegate/backend/internal/background/delegated_moves.go +0 -270
- package/templates/native-go-delegate/backend/internal/background/delegated_test.go +0 -34
- package/templates/native-go-delegate/backend/internal/delegate/admission_recovery_test.go +0 -410
- package/templates/native-go-delegate/backend/internal/delegate/busy_review_test.go +0 -15
- package/templates/native-go-delegate/backend/internal/delegate/cancel_contract_test.go +0 -95
- package/templates/native-go-delegate/backend/internal/delegate/client.go +0 -151
- package/templates/native-go-delegate/backend/internal/delegate/client_test.go +0 -214
- package/templates/native-go-delegate/backend/internal/delegate/destination.go +0 -110
- package/templates/native-go-delegate/backend/internal/delegate/destination_state.go +0 -117
- package/templates/native-go-delegate/backend/internal/delegate/destination_state_test.go +0 -60
- package/templates/native-go-delegate/backend/internal/delegate/destination_test.go +0 -116
- package/templates/native-go-delegate/backend/internal/delegate/example.go +0 -81
- package/templates/native-go-delegate/backend/internal/delegate/example_test.go +0 -91
- package/templates/native-go-delegate/backend/internal/delegate/executor_contract_test.go +0 -511
- package/templates/native-go-delegate/backend/internal/delegate/files.go +0 -132
- package/templates/native-go-delegate/backend/internal/delegate/long_running_routes.go +0 -92
- package/templates/native-go-delegate/backend/internal/delegate/long_running_routes_test.go +0 -99
- package/templates/native-go-delegate/backend/internal/delegate/move.go +0 -348
- package/templates/native-go-delegate/backend/internal/delegate/move_test.go +0 -351
- package/templates/native-go-delegate/backend/internal/delegate/operations_list.go +0 -65
- package/templates/native-go-delegate/backend/internal/delegate/operations_list_test.go +0 -114
- package/templates/native-go-delegate/backend/internal/delegate/retry.go +0 -106
- package/templates/native-go-delegate/backend/internal/delegate/retry_test.go +0 -143
- package/templates/native-go-delegate/backend/internal/delegate/service.go +0 -364
- package/templates/native-go-delegate/backend/internal/delegate/service_test.go +0 -318
- package/templates/native-go-delegate/backend/internal/delegate/staging.go +0 -121
- package/templates/native-go-delegate/backend/internal/delegate/status_disabled_test.go +0 -51
- package/templates/native-go-delegate/backend/internal/delegate/testdata/executor_contract.txt +0 -112
- package/templates/native-go-delegate/backend/internal/delegate/transient_contract_test.go +0 -137
- package/templates/native-go-delegate/backend/internal/delegate/wait_cancel_test.go +0 -101
- package/templates/native-go-delegate/backend/internal/delegate/worker.go +0 -225
- package/templates/native-go-delegate/backend/internal/filestation/files.go +0 -43
- package/templates/native-go-delegate/backend/internal/filestation/files_test.go +0 -59
- package/templates/native-go-delegate/frontend/src/CapabilityPanels.vue +0 -37
- package/templates/native-go-delegate/frontend/src/delegate/BackgroundSavePanel.vue +0 -113
- package/templates/native-go-delegate/frontend/src/delegate/DelegatePanel.vue +0 -70
- package/templates/native-go-delegate/frontend/src/delegate/copy.ts +0 -8
- package/templates/native-go-delegate/frontend/src/delegate/i18n/waiting.json +0 -11
- package/templates/native-go-delegate/frontend/test/background-save.test.ts +0 -121
- package/templates/native-go-delegate/frontend/test/delegate.test.ts +0 -145
- package/templates/native-go-delegate/frontend/test/scope-settings.test.ts +0 -49
- package/templates/native-go-delegate/test-frontend.sh +0 -12
- package/templates/native-go-delegate/test.sh +0 -18
- package/templates/native-go-jobs/BACKGROUND.md +0 -108
- package/templates/native-go-jobs/backend/internal/app/background_on.go +0 -7
- package/templates/native-go-jobs/backend/internal/app/background_routes_test.go +0 -90
- package/templates/native-go-jobs/frontend/src/background/BackgroundPanel.vue +0 -170
- package/templates/native-go-jobs/frontend/src/background/i18n/de.json +0 -75
- package/templates/native-go-jobs/frontend/src/background/i18n/en.json +0 -75
- package/templates/native-go-jobs/frontend/src/background/i18n/es.json +0 -75
- package/templates/native-go-jobs/frontend/src/background/i18n/fr.json +0 -75
- package/templates/native-go-jobs/frontend/src/background/i18n/it.json +0 -75
- package/templates/native-go-jobs/frontend/src/background/i18n/ja.json +0 -75
- package/templates/native-go-jobs/frontend/src/background/i18n/ko.json +0 -75
- package/templates/native-go-jobs/frontend/src/background/i18n/zh-CN.json +0 -75
- package/templates/native-go-jobs/frontend/src/background/i18n/zh-TW.json +0 -75
- package/templates/native-go-jobs/frontend/src/background/i18n.ts +0 -19
- package/templates/native-go-jobs/frontend/src/background/picker-provider.ts +0 -12
- package/templates/native-go-jobs/frontend/src/background/request-key.ts +0 -5
- package/templates/native-go-jobs/frontend/test/background.test.ts +0 -205
- package/templates/native-go-root-ops/backend/internal/app/executor.go +0 -140
- package/templates/native-go-root-ops/backend/internal/app/executor_test.go +0 -117
- package/templates/native-go-root-ops/root/whoami.sh +0 -3
- package/templates/native-go-vue/README.md +0 -47
- package/templates/native-go-vue/frontend/DESIGN.md +0 -61
- package/templates/native-go-vue/frontend/package-lock.json +0 -2530
- package/templates/native-go-vue/frontend/package.json +0 -6
- package/templates/native-go-vue/frontend/src/App.vue +0 -96
- package/templates/native-go-vue/frontend/src/CapabilityPanels.vue +0 -6
- package/templates/native-go-vue/frontend/src/context.ts +0 -78
- package/templates/native-go-vue/frontend/src/delegate/ExecutorSettings.vue +0 -70
- package/templates/native-go-vue/frontend/src/delegate/catalogs.ts +0 -11
- package/templates/native-go-vue/frontend/src/delegate/copy.test.ts +0 -12
- package/templates/native-go-vue/frontend/src/delegate/copy.ts +0 -4
- package/templates/native-go-vue/frontend/src/delegate/executor-settings.test.ts +0 -23
- package/templates/native-go-vue/frontend/src/delegate/executor-setup.ts +0 -24
- package/templates/native-go-vue/frontend/src/delegate/facade.test.ts +0 -100
- package/templates/native-go-vue/frontend/src/delegate/facade.ts +0 -85
- package/templates/native-go-vue/frontend/src/delegate/i18n/de.json +0 -47
- package/templates/native-go-vue/frontend/src/delegate/i18n/en.json +0 -47
- package/templates/native-go-vue/frontend/src/delegate/i18n/es.json +0 -47
- package/templates/native-go-vue/frontend/src/delegate/i18n/fr.json +0 -47
- package/templates/native-go-vue/frontend/src/delegate/i18n/it.json +0 -47
- package/templates/native-go-vue/frontend/src/delegate/i18n/ja.json +0 -47
- package/templates/native-go-vue/frontend/src/delegate/i18n/ko.json +0 -47
- package/templates/native-go-vue/frontend/src/delegate/i18n/save/de.json +0 -42
- package/templates/native-go-vue/frontend/src/delegate/i18n/save/en.json +0 -42
- package/templates/native-go-vue/frontend/src/delegate/i18n/save/es.json +0 -42
- package/templates/native-go-vue/frontend/src/delegate/i18n/save/fr.json +0 -42
- package/templates/native-go-vue/frontend/src/delegate/i18n/save/it.json +0 -42
- package/templates/native-go-vue/frontend/src/delegate/i18n/save/ja.json +0 -42
- package/templates/native-go-vue/frontend/src/delegate/i18n/save/ko.json +0 -42
- package/templates/native-go-vue/frontend/src/delegate/i18n/save/zh-CN.json +0 -42
- package/templates/native-go-vue/frontend/src/delegate/i18n/save/zh-TW.json +0 -42
- package/templates/native-go-vue/frontend/src/delegate/i18n/zh-CN.json +0 -47
- package/templates/native-go-vue/frontend/src/delegate/i18n/zh-TW.json +0 -47
- package/templates/native-go-vue/frontend/src/delegate/long-running.ts +0 -57
- package/templates/native-go-vue/frontend/src/delegate/save-copy.test.ts +0 -12
- package/templates/native-go-vue/frontend/src/delegate/save-copy.ts +0 -24
- package/templates/native-go-vue/frontend/src/delegate/scoped-picker.test.ts +0 -12
- package/templates/native-go-vue/frontend/src/delegate/scoped-picker.ts +0 -21
- package/templates/native-go-vue/frontend/src/files/FileBrowser.vue +0 -131
- package/templates/native-go-vue/frontend/src/files/FilesPage.vue +0 -35
- package/templates/native-go-vue/frontend/src/files/files.test.ts +0 -100
- package/templates/native-go-vue/frontend/src/files/provider.test.ts +0 -48
- package/templates/native-go-vue/frontend/src/files/transfers.test.ts +0 -27
- package/templates/native-go-vue/frontend/src/files/transfers.ts +0 -25
- package/templates/native-go-vue/frontend/src/i18n/de.json +0 -20
- package/templates/native-go-vue/frontend/src/i18n/en.json +0 -20
- package/templates/native-go-vue/frontend/src/i18n/es.json +0 -20
- package/templates/native-go-vue/frontend/src/i18n/fr.json +0 -20
- package/templates/native-go-vue/frontend/src/i18n/it.json +0 -20
- package/templates/native-go-vue/frontend/src/i18n/ja.json +0 -20
- package/templates/native-go-vue/frontend/src/i18n/ko.json +0 -20
- package/templates/native-go-vue/frontend/src/i18n/zh-CN.json +0 -20
- package/templates/native-go-vue/frontend/src/i18n/zh-TW.json +0 -20
- package/templates/native-go-vue/frontend/src/i18n.ts +0 -13
- package/templates/native-go-vue/frontend/src/identity/DESIGN.md +0 -46
- package/templates/native-go-vue/frontend/src/identity/LoginPage.vue +0 -78
- package/templates/native-go-vue/frontend/src/identity/i18n/de.json +0 -27
- package/templates/native-go-vue/frontend/src/identity/i18n/en.json +0 -27
- package/templates/native-go-vue/frontend/src/identity/i18n/es.json +0 -27
- package/templates/native-go-vue/frontend/src/identity/i18n/fr.json +0 -27
- package/templates/native-go-vue/frontend/src/identity/i18n/it.json +0 -27
- package/templates/native-go-vue/frontend/src/identity/i18n/ja.json +0 -27
- package/templates/native-go-vue/frontend/src/identity/i18n/ko.json +0 -27
- package/templates/native-go-vue/frontend/src/identity/i18n/zh-CN.json +0 -27
- package/templates/native-go-vue/frontend/src/identity/i18n/zh-TW.json +0 -27
- package/templates/native-go-vue/frontend/src/identity/i18n.ts +0 -14
- package/templates/native-go-vue/frontend/src/identity/login.test.ts +0 -32
- package/templates/native-go-vue/frontend/src/identity/session.test.ts +0 -33
- package/templates/native-go-vue/frontend/src/identity/session.ts +0 -74
- package/templates/native-go-vue/frontend/src/main.ts +0 -32
- package/templates/native-go-vue/frontend/src/nas/NasPicker.vue +0 -42
- package/templates/native-go-vue/frontend/src/nas/contract.ts +0 -12
- package/templates/native-go-vue/frontend/src/nas/destination.test.ts +0 -48
- package/templates/native-go-vue/frontend/src/nas/i18n/files/de.json +0 -41
- package/templates/native-go-vue/frontend/src/nas/i18n/files/en.json +0 -41
- package/templates/native-go-vue/frontend/src/nas/i18n/files/es.json +0 -41
- package/templates/native-go-vue/frontend/src/nas/i18n/files/fr.json +0 -41
- package/templates/native-go-vue/frontend/src/nas/i18n/files/it.json +0 -41
- package/templates/native-go-vue/frontend/src/nas/i18n/files/ja.json +0 -41
- package/templates/native-go-vue/frontend/src/nas/i18n/files/ko.json +0 -41
- package/templates/native-go-vue/frontend/src/nas/i18n/files/zh-CN.json +0 -41
- package/templates/native-go-vue/frontend/src/nas/i18n/files/zh-TW.json +0 -41
- package/templates/native-go-vue/frontend/src/nas/i18n.ts +0 -2
- package/templates/native-go-vue/frontend/src/nas/locale.ts +0 -24
- package/templates/native-go-vue/frontend/src/nas/provider.ts +0 -50
- package/templates/native-go-vue/frontend/src/nas/use-request.ts +0 -18
- package/templates/native-go-vue/frontend/src/portal/PortalSettings.vue +0 -39
- package/templates/native-go-vue/frontend/src/shell/AppShell.vue +0 -48
- package/templates/native-go-vue/frontend/src/shell/i18n/de.json +0 -4
- package/templates/native-go-vue/frontend/src/shell/i18n/en.json +0 -4
- package/templates/native-go-vue/frontend/src/shell/i18n/es.json +0 -4
- package/templates/native-go-vue/frontend/src/shell/i18n/fr.json +0 -4
- package/templates/native-go-vue/frontend/src/shell/i18n/it.json +0 -4
- package/templates/native-go-vue/frontend/src/shell/i18n/ja.json +0 -4
- package/templates/native-go-vue/frontend/src/shell/i18n/ko.json +0 -4
- package/templates/native-go-vue/frontend/src/shell/i18n/zh-CN.json +0 -4
- package/templates/native-go-vue/frontend/src/shell/i18n/zh-TW.json +0 -4
- package/templates/native-go-vue/frontend/src/shell/i18n.ts +0 -17
- package/templates/native-go-vue/frontend/src/shell/pages.ts +0 -15
- package/templates/native-go-vue/frontend/src/style.css +0 -27
- package/templates/native-go-vue/frontend/test/apps.test.ts +0 -57
- package/templates/native-go-vue/frontend/test/native-controls.test.ts +0 -27
- package/templates/native-go-vue/frontend/test/portal-settings.test.ts +0 -71
- package/templates/native-go-vue/frontend/test/shell-i18n.test.ts +0 -50
- package/templates/native-go-vue/frontend/test/shell-ui.test.ts +0 -20
- package/templates/native-go-vue/frontend/test/shell.test.ts +0 -30
- package/templates/native-go-vue/frontend/tsconfig.json +0 -1
- package/templates/native-go-vue/frontend/vite.config.ts +0 -10
- package/templates/native-go-vue/gitignore +0 -2
- /package/{dist/templates/_daemon → assets/go/daemon}/fixture_linux_test.go +0 -0
- /package/{dist/templates/_daemon → assets/go/daemon}/fixture_other_test.go +0 -0
- /package/{dist/templates/_daemon → assets/go/daemon}/go.mod +0 -0
- /package/{dist/templates/_daemon → assets/go/daemon}/main.go +0 -0
- /package/{dist/templates/_daemon → assets/go/daemon}/main_test.go +0 -0
- /package/{dist/templates/_daemon → assets/go/daemon}/process_linux.go +0 -0
- /package/{dist/templates/_daemon → assets/go/daemon}/process_linux_test.go +0 -0
- /package/{dist/templates/_daemon → assets/go/daemon}/process_other.go +0 -0
- /package/{dist/templates/_daemon → assets/go/daemon}/testdata/child.go +0 -0
- /package/{dist/templates/_gateway → assets/go/gateway}/auth.go +0 -0
- /package/{dist/templates/_gateway → assets/go/gateway}/auth_test.go +0 -0
- /package/{dist/templates/_gateway → assets/go/gateway}/cgi.go +0 -0
- /package/{dist/templates/_gateway → assets/go/gateway}/cgi_test.go +0 -0
- /package/{dist/templates/_gateway → assets/go/gateway}/csrf.go +0 -0
- /package/{dist/templates/_gateway → assets/go/gateway}/csrf_test.go +0 -0
- /package/{dist/templates/_gateway → assets/go/gateway}/directory.go +0 -0
- /package/{dist/templates/_gateway → assets/go/gateway}/directory_test.go +0 -0
- /package/{dist/templates/_gateway → assets/go/gateway}/gateway.go +0 -0
- /package/{dist/templates/_gateway → assets/go/gateway}/gateway_test.go +0 -0
- /package/{dist/templates/_gateway → assets/go/gateway}/go.mod +0 -0
- /package/{dist/templates/_gateway → assets/go/gateway}/groups.go +0 -0
- /package/{dist/templates/_gateway → assets/go/gateway}/main.go +0 -0
- /package/{dist/templates/_shared → assets/licenses}/GO-LICENSE +0 -0
- /package/{dist/templates/_shared → assets/licenses}/GO-PATENTS +0 -0
- /package/{dist/templates/_shared/LICENSES → assets/licenses}/TEMPLATE.txt +0 -0
|
@@ -1,263 +0,0 @@
|
|
|
1
|
-
# Delegated background file jobs
|
|
2
|
-
|
|
3
|
-
This overlay implements PLAN §2.4 v1. It runs in the package account and connects
|
|
4
|
-
only to the executor socket. The executor verifies the current DSM `id` cookie
|
|
5
|
-
when creating/listing/revoking a user delegation; the CGI never sends a username.
|
|
6
|
-
A worker stores only a delegation ID and job ID, never session credentials.
|
|
7
|
-
|
|
8
|
-
## CLI assembly
|
|
9
|
-
|
|
10
|
-
`init --with delegate` and `add delegate` apply base → jobs → delegate.
|
|
11
|
-
The SDK registers `DelegateRoutes` using the trusted manifest scope and lists
|
|
12
|
-
all 17 delegate methods in `sdk-permissions.json`: `delegate.disable` and
|
|
13
|
-
`delegate.enable` require administrators, the others `authenticated`.
|
|
14
|
-
App-owned permissions remain in `permissions.json`. `init --with delegate` sets
|
|
15
|
-
`app.status` to authenticated so ordinary users can mount their panels;
|
|
16
|
-
`add delegate` leaves `permissions.json` unchanged. The CLI binds both
|
|
17
|
-
policy files to the CGI build. SDK policy edits and overrides fail validation.
|
|
18
|
-
|
|
19
|
-
`background.Job.DelegationID` is an optional field in the shared base store.
|
|
20
|
-
Delegate does not replace store.go, so CGI lock budgets, cancellation and schedule
|
|
21
|
-
recovery always use the same implementation as jobs. CGI routes use
|
|
22
|
-
`NewRequestStore`; workers retain `NewStore`. `add` still checks ownership of the
|
|
23
|
-
shared store before activating delegate.
|
|
24
|
-
|
|
25
|
-
```ts
|
|
26
|
-
interface ExecutorSetup {
|
|
27
|
-
status(): Promise<CapabilityStatus>
|
|
28
|
-
authorize(password: string, selectedScope?: string): Promise<CapabilityStatus>
|
|
29
|
-
control(action: 'start' | 'stop' | 'purge'): Promise<CapabilityStatus>
|
|
30
|
-
}
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
Passwords are sent only to DSM PasswordConfirm and are never persisted. Socket
|
|
34
|
-
status must match the packaged executor and policy digests before readiness.
|
|
35
|
-
|
|
36
|
-
Jobs are available to authenticated users immediately after executor approval;
|
|
37
|
-
there are no enabled/ordinary-user admission switches. The jobs overlay supplies
|
|
38
|
-
the shared NasPicker and session metadata provider without delegate UI copies.
|
|
39
|
-
|
|
40
|
-
The overlay replaces `cmd/background-worker/main.go`, which refuses root and
|
|
41
|
-
uses a fixed dispatcher for the existing SHA256 worker and the download worker.
|
|
42
|
-
It retains the existing jobs spool, owner/UID checks, admission quotas,
|
|
43
|
-
cancellation journal, schedule tick, recovery and heartbeat. There is no arbitrary
|
|
44
|
-
worker name from HTTP input.
|
|
45
|
-
|
|
46
|
-
## CGI routes
|
|
47
|
-
|
|
48
|
-
| Method | Parameters | Result |
|
|
49
|
-
| --- | --- | --- |
|
|
50
|
-
| `delegate.status` | `{}` | capability `state`, optional `reason` |
|
|
51
|
-
| `delegate.create` | `job_id`, `ops`, `path`, `ttl_seconds` | executor grant |
|
|
52
|
-
| `delegate.list` | `{}` | executor's `{delegations: [...]}` |
|
|
53
|
-
| `delegate.revoke` | `delegation_id` | `{revoked}` |
|
|
54
|
-
| `delegate.jobs.submit` | `key`, `url`, `dest`, `name` | owner-bound job including `delegation_id` |
|
|
55
|
-
| `delegate.jobs.list` | `{}` | `{jobs: [...]}` for the current username AND UID |
|
|
56
|
-
| `delegate.jobs.cancel` | `id` | `{job, revocation_pending}` |
|
|
57
|
-
|
|
58
|
-
`delegate.create` uses the manifest's scope and accepts only the five Files
|
|
59
|
-
operation IDs, with a TTL of 1–3600 seconds. The download example creates a
|
|
60
|
-
one-hour `files.write` grant. Administrators do not bypass job ownership here.
|
|
61
|
-
The executor independently rejects ineligible subjects, including admin runners.
|
|
62
|
-
List items use `delegation_id`, `job_id`, `path`, `expires_at`, optional `revoked`.
|
|
63
|
-
|
|
64
|
-
## Typed files
|
|
65
|
-
|
|
66
|
-
`filestation.Files` is a single typed interface with List, Info, CreateFolder,
|
|
67
|
-
CheckPermission and Write. Both `filestation.RequestContext.Files()` (live
|
|
68
|
-
File Station session) and `delegate.JobContext.Files()` (executor) implement it.
|
|
69
|
-
The request adapter is added by this overlay in the existing filestation package;
|
|
70
|
-
no second Page, Entry or ListOptions type is introduced.
|
|
71
|
-
|
|
72
|
-
For metadata operations the executor receives `path`; createFolder additionally
|
|
73
|
-
receives `name`. The fixed executor accepts no pagination/sort parameters, so
|
|
74
|
-
job Files.List supports the default ListOptions only; nondefault options return
|
|
75
|
-
`unsupported`. Adding wire pagination requires the controller to approve a §2.4
|
|
76
|
-
contract extension.
|
|
77
|
-
Every offline operation also receives `delegation_id` and `job_id`. Write uses
|
|
78
|
-
exactly §2.4's `staging`, `dest_dir`, `name`. Paths in these payloads never grant
|
|
79
|
-
permission; the executor checks current subject, operation and scope.
|
|
80
|
-
|
|
81
|
-
```go
|
|
82
|
-
func save(ctx context.Context, job delegate.JobContext, content io.Reader, size int64) error {
|
|
83
|
-
return job.Files().Write(ctx, "/home/Downloads", "download.txt", content, size)
|
|
84
|
-
}
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
Write stages exactly `size` bytes under `/var/packages/<pkg>/var/executor-staging/`
|
|
88
|
-
using an internally generated filename, mode 0600 inside a 0700 directory.
|
|
89
|
-
The executor receives only that relative random name. Local staging is removed
|
|
90
|
-
on success or any refusal/read/size/cancellation/transport failure. Download is
|
|
91
|
-
limited to 64 MiB and 60 seconds, accepts HTTP/HTTPS without embedded credentials,
|
|
92
|
-
and does not follow redirects or use ambient proxy settings. Both declared and
|
|
93
|
-
streamed lengths are bounded. The worker downloads into a random staging file,
|
|
94
|
-
then passes the content through Files.Write.
|
|
95
|
-
|
|
96
|
-
The persisted `delegate-<job-id>.json` record is a revocation retry journal,
|
|
97
|
-
separate from the job's `delegation_id`. It survives canceled input removal and
|
|
98
|
-
history trimming. Completion, failure, cancellation, purge and restart
|
|
99
|
-
recovery all feed cleanup; an unavailable executor leaves a record for the next
|
|
100
|
-
worker sweep. Outstanding revocation records are bounded to 80; admission refuses
|
|
101
|
-
new grants if cleanup reaches that limit. An unknown grant-creation response cannot reveal a delegation ID;
|
|
102
|
-
the executor TTL bounds that grant. An uncertain write is never replayed.
|
|
103
|
-
|
|
104
|
-
If the executor socket cannot be dialed, no request has been sent. The download
|
|
105
|
-
worker retains its staged bytes and retries that request after 2, 4, 8, 16,
|
|
106
|
-
then 30 seconds (30-second cap), for at most 15 minutes. This wait is separate
|
|
107
|
-
from the 60-second download budget. `delegate.jobs.list` reports
|
|
108
|
-
`waiting_executor`; the panel shows the startup waiting message in all nine
|
|
109
|
-
supported locales and keeps cancellation and polling available. The shared
|
|
110
|
-
journal retains the claimed running slot for quota/ownership/recovery rules;
|
|
111
|
-
the delegation sidecar stores the waiting flag and grant expiry. List reads
|
|
112
|
-
both under one short lock, and retry timers/socket calls never hold that lock.
|
|
113
|
-
Cancellation and local revocation stop waiting through the existing 100 ms
|
|
114
|
-
cancel watcher; grant expiry bounds the next wait. The executor still checks
|
|
115
|
-
revocation, expiry and current eligibility before any operation. At the
|
|
116
|
-
15-minute deadline the job fails with `EXECUTOR_UNAVAILABLE`, retaining pending
|
|
117
|
-
revocation cleanup. Errors after a connection is established are terminal;
|
|
118
|
-
partial writes, disconnects, timeouts and executor refusals are never replayed.
|
|
119
|
-
A stopped worker keeps the existing interrupted/no-replay recovery behavior.
|
|
120
|
-
|
|
121
|
-
Stable executor refusal codes are preserved, with sanitized messages. Local
|
|
122
|
-
transport codes are `EXECUTOR_UNAVAILABLE`, `EXECUTOR_TIMEOUT`,
|
|
123
|
-
`EXECUTOR_TOO_LARGE`, `EXECUTOR_PROTOCOL`, and `canceled`. Framing, including the
|
|
124
|
-
newline, is bounded to 64 KiB in each direction, with one request per connection.
|
|
125
|
-
|
|
126
|
-
## Local verification
|
|
127
|
-
|
|
128
|
-
From the repository root:
|
|
129
|
-
|
|
130
|
-
```sh
|
|
131
|
-
packages/app-cli/templates/native-go-delegate/test.sh
|
|
132
|
-
packages/app-cli/templates/native-go-delegate/test-frontend.sh
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
The Go fixture merges the base backend and delegate overlay,
|
|
136
|
-
then runs all base/overlay tests with the race detector, host/Linux amd64/arm64
|
|
137
|
-
vet, and formatting checks. CGI tests use the shipped SDK capability permissions and a
|
|
138
|
-
fake Unix-socket executor. The frontend fixture merges the Vue base and this
|
|
139
|
-
overlay and runs fake-provider UI tests plus Vue type checking and Vite build.
|
|
140
|
-
The fixtures are temporary and are removed after each run.
|
|
141
|
-
|
|
142
|
-
These tests do not claim DSM kernel ACL, owner, reboot, real task or real executor
|
|
143
|
-
validation. CLI activation and real executor/setup integration belong to the other
|
|
144
|
-
P2 workstreams.
|
|
145
|
-
|
|
146
|
-
## Choose the scope at install and confirm it once
|
|
147
|
-
|
|
148
|
-
New `init` / `add delegate` projects default to `scope: install-selected`.
|
|
149
|
-
The DSM install wizard's native `api_store` combobox dynamically lists local
|
|
150
|
-
shares using the installer's administrator session (`SYNO.Core.Share list v1`).
|
|
151
|
-
A checkbox offers each user's `/home` instead; choosing a share never creates it
|
|
152
|
-
or grants its ACL to the package account. This wizard was measured on vt-nas
|
|
153
|
-
DSM 7.4 through a session-only SSH tunnel. Other DSM versions remain unverified.
|
|
154
|
-
|
|
155
|
-
Installation saves `{schema:1, scope}` in package-owned
|
|
156
|
-
`var/delegate-install.json`. It is **only a pre-selection**. The existing
|
|
157
|
-
administrator enable form displays it alongside the DSM password field. One
|
|
158
|
-
PasswordConfirm authorizes the pinned boot/control tasks and a one-time exact
|
|
159
|
-
selection task. Only the root executor writes
|
|
160
|
-
`/usr/local/etc/synopkgland/<pkg>/delegations/selected-scope.record`
|
|
161
|
-
(`schema`, `scope`, `generation`, root 0600). The package peer cannot call the
|
|
162
|
-
internal selection operation, even with an administrator cookie. Shipped
|
|
163
|
-
executor/policy pins lock the selection mode and operations; the chosen scope
|
|
164
|
-
is protected runtime state, so changing it does not rewrite shipped pins.
|
|
165
|
-
|
|
166
|
-
Settings uses this same form and `ctx.executor.authorize(password, scope)` to
|
|
167
|
-
change the scope. There is no extra dialog or step. A new scope generation
|
|
168
|
-
revokes existing grants and cancels pending saves under the publication fence.
|
|
169
|
-
Changing away and back never revives old grants. Existing destination files
|
|
170
|
-
remain. Selecting another directory for the same destination key replaces only
|
|
171
|
-
that person's previous grant for the key. Every person must select again after
|
|
172
|
-
scope changes. If the package draft differs, the UI shows both and follows the
|
|
173
|
-
protected value. Existing `scope: home` and `shared:<name>` manifests retain their
|
|
174
|
-
fixed-scope API and legacy TTL behavior. Dynamic selection requires the
|
|
175
|
-
`until-revoked` / `files.moveFromStaging` declaration.
|
|
176
|
-
|
|
177
|
-
A scope change on a running executor whose pins verify runs only the selection
|
|
178
|
-
task. It never restarts the executor, so a copy in flight ends `canceled` with
|
|
179
|
-
reason `scope-changed`, not `interrupted`. `authorize` waits about 20 seconds
|
|
180
|
-
for the protected readback. A `blocked` reply that carries `requested: {scope,
|
|
181
|
-
generation}` means the root task may still land: read `ctx.executor.status()`
|
|
182
|
-
(or `delegate.status`) until `selection.scope` equals `requested.scope` with a
|
|
183
|
-
`selection.generation` above `requested.generation` (applied); otherwise it was
|
|
184
|
-
not applied. Submitting the same scope again is safe: the task is pinned to the
|
|
185
|
-
current generation and an already selected scope is answered unchanged.
|
|
186
|
-
|
|
187
|
-
## One typed destination lookup, online and offline
|
|
188
|
-
|
|
189
|
-
The generated Vue template contains the complete administrator setup, confirmed
|
|
190
|
-
scope, scope-limited NasPicker, personal destinations and operations, and admin
|
|
191
|
-
kill switch. Use its existing facade:
|
|
192
|
-
|
|
193
|
-
```ts
|
|
194
|
-
import {createBackgroundSaveFacade} from './delegate/facade'
|
|
195
|
-
const sdk = createBackgroundSaveFacade(ctx)
|
|
196
|
-
const current = await sdk.destination('save')
|
|
197
|
-
// current.selection: {scope, root, generation} | null — protected executor evidence
|
|
198
|
-
// current.destination: {id, key, path, username, lifetime} | null — this caller only
|
|
199
|
-
// current.status: active | missing | reselection-required | needs-scope-confirmation | disabled
|
|
200
|
-
if (current.status === 'active') {
|
|
201
|
-
const ref = await sdk.exportExample({key: 'save', job_id: stableJobID})
|
|
202
|
-
// The generated My saves panel queries this reference; admission is not Saved.
|
|
203
|
-
}
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
The authenticated CGI is `delegate.destination` with `{key}`; it verifies the
|
|
207
|
-
fresh DSM session and username+UID, configured key, protected scope/generation
|
|
208
|
-
and current grant. Neither browser storage nor the installation draft supplies
|
|
209
|
-
a destination. Errors or missing protected evidence disable new selections.
|
|
210
|
-
|
|
211
|
-
Go uses `service.Destination(ctx, caller, request, "save") (DestinationState,error)`.
|
|
212
|
-
Capture `current.Destination.ID` in the App's own job only when status is active.
|
|
213
|
-
After logout, a producer uses that ID with `service.MoveFromStaging(ctx, params)`.
|
|
214
|
-
It does not use the package draft, pass a virtual destination path, or retain
|
|
215
|
-
session credentials. The executor rechecks scope generation, account, grant,
|
|
216
|
-
directory identity and DSM ACL before writing as the user's nonzero UID.
|
|
217
|
-
|
|
218
|
-
The shipped **Save example file** button calls `delegate.example.export` with
|
|
219
|
-
`{key, job_id}`. `backend/internal/delegate/example.go` is a working producer:
|
|
220
|
-
it obtains this user's active destination, creates a small package-private JSON
|
|
221
|
-
file (0600) under staging, and invokes `MoveFromStaging`. Repeated job IDs repeat
|
|
222
|
-
the original request: they return the original operation, admit only one the
|
|
223
|
-
executor does not know, and never overwrite staging. Adapt this producer for
|
|
224
|
-
daemon/export jobs and keep its stable ID. An uncertain result has no automatic
|
|
225
|
-
retry; only a protected committed receipt means Saved.
|
|
226
|
-
|
|
227
|
-
If admission failed or its reply was lost, call `MoveFromStaging` again later
|
|
228
|
-
with the same params. It queries the original first and re-sends only an
|
|
229
|
-
operation the executor does not know, with the pinned source unchanged (at most
|
|
230
|
-
10 possibly-delivered sends, 2 s backoff doubling to 5 min; the worker sweep
|
|
231
|
-
does the same). Retry on `EXECUTOR_UNAVAILABLE`, `EXECUTOR_TIMEOUT`,
|
|
232
|
-
`EXECUTOR_PROTOCOL`, `canceled`, `EXECUTOR_PAUSED`, `queue-full`,
|
|
233
|
-
`STORAGE_ERROR`, `ADMISSION_PENDING`, and on the package journal codes
|
|
234
|
-
`jobs_busy` (lock busy), `jobs_unavailable` (transient I/O) and `canceled` (the
|
|
235
|
-
caller's deadline or cancel ended the wait). None of these admitted anything a
|
|
236
|
-
retry could duplicate; while the journal is unavailable, a ref the executor
|
|
237
|
-
already knows still answers its state, so a committed move stays committed.
|
|
238
|
-
Terminal: executor refusals such as `APP_DENIED`, `DELEGATION_DENIED`,
|
|
239
|
-
`operation-conflict`, `disabled`, plus `STAGING_CHANGED`, `ADMISSION_EXHAUSTED`,
|
|
240
|
-
`spool_unsafe` and `journal_corrupt` (the package spool needs repair), and
|
|
241
|
-
`operation-not-found` for an accepted operation. See the delegate guide's Admission recovery table.
|
|
242
|
-
|
|
243
|
-
Cancel with the original reference (`CancelOperation`, or
|
|
244
|
-
`delegate.operations.cancel` from the UI); it is idempotent, so repeat it with
|
|
245
|
-
the same reference after a retryable error or a lost reply. `queued` becomes
|
|
246
|
-
`canceled` at once. A copy in flight answers `copying` with code
|
|
247
|
-
`CANCEL_REQUESTED`: accepted and durable, not finished. Poll `OperationStatus`
|
|
248
|
-
on the same reference until `canceled` (writer stopped, part removed, nothing
|
|
249
|
-
published, staging kept), `committed` (publication won; the file stays, drop only
|
|
250
|
-
the app record) or `uncertain` (a publish attempt failed first; keep querying).
|
|
251
|
-
The request survives executor crash, package stop/start and logout.
|
|
252
|
-
Revoke, scope change and disable store their reason (`grant-revoked`,
|
|
253
|
-
`scope-changed`, `integration-disabled`) the same way: a copy in flight answers
|
|
254
|
-
`CANCEL_REQUESTED` with it and settles `canceled` with it across a restart. A
|
|
255
|
-
copy the executor stops without a cancel ends `interrupted`/`EXECUTOR_PAUSED`
|
|
256
|
-
(`interrupted`/`interrupted` after a crash), never `WRITE_FAILED`. A cancel of
|
|
257
|
-
a reference not yet admitted leaves a `canceled` tombstone that a late or
|
|
258
|
-
recovered admission returns instead of copying, and a producer cancel is written
|
|
259
|
-
to the mirror first, so `MoveFromStaging` and the worker sweep forward it rather
|
|
260
|
-
than admit. See the delegate guide's Cancellation table.
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
The pinned scope-selection task also binds the protected generation observed before confirmation. The executor compares it under the publish lock and refuses stale tasks, so a retained task cannot replay an older selection after another confirmation.
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
// Command background-worker is the package's fixed background worker. DSM runs
|
|
2
|
-
// it as the package's systemd user unit under the package account; it never
|
|
3
|
-
// runs as root and takes no input except the jobs in its private spool.
|
|
4
|
-
package main
|
|
5
|
-
|
|
6
|
-
import (
|
|
7
|
-
"context"
|
|
8
|
-
"log"
|
|
9
|
-
"os"
|
|
10
|
-
"os/signal"
|
|
11
|
-
"os/user"
|
|
12
|
-
"strconv"
|
|
13
|
-
"syscall"
|
|
14
|
-
|
|
15
|
-
"dsmapp/internal/app"
|
|
16
|
-
"dsmapp/internal/background"
|
|
17
|
-
"dsmapp/internal/delegate"
|
|
18
|
-
)
|
|
19
|
-
|
|
20
|
-
// Set by `synopkgland build-spk` through -ldflags -X.
|
|
21
|
-
var packageID = "dev"
|
|
22
|
-
var delegateScope, delegateOperationsJSON, delegateDestinationsJSON, delegateLifetime string
|
|
23
|
-
|
|
24
|
-
func main() {
|
|
25
|
-
log.SetFlags(0)
|
|
26
|
-
log.SetPrefix(packageID + " background: ")
|
|
27
|
-
if err := background.RefuseRoot(os.Geteuid()); err != nil {
|
|
28
|
-
log.Fatal(err)
|
|
29
|
-
}
|
|
30
|
-
name := ""
|
|
31
|
-
if u, err := user.Current(); err == nil {
|
|
32
|
-
name = u.Username
|
|
33
|
-
}
|
|
34
|
-
info := background.WorkerInfo{PID: os.Getpid(), UID: os.Getuid(), Username: name}
|
|
35
|
-
ctx, stop := signal.NotifyContext(context.Background(), syscall.SIGTERM, syscall.SIGINT)
|
|
36
|
-
defer stop()
|
|
37
|
-
log.Printf("started as uid %s", strconv.Itoa(info.UID))
|
|
38
|
-
dataDir := "/var/packages/" + packageID + "/var"
|
|
39
|
-
service := &delegate.Service{Client: delegate.Local(packageID), Store: background.NewStore(dataDir + "/background"), StagingDir: dataDir + "/executor-staging"}
|
|
40
|
-
settings, err := app.ParseDelegateConfig(app.Config{DelegateScope: delegateScope, DelegateOperationsJSON: delegateOperationsJSON, DelegateDestinationsJSON: delegateDestinationsJSON, DelegateLifetime: delegateLifetime})
|
|
41
|
-
if err != nil {
|
|
42
|
-
log.Fatal(err)
|
|
43
|
-
}
|
|
44
|
-
service.Scope, service.Operations, service.Destinations, service.Lifetime = settings.Scope, settings.Operations, settings.Destinations, settings.Lifetime
|
|
45
|
-
if err := service.Run(ctx, info); err != nil {
|
|
46
|
-
log.Fatal(err)
|
|
47
|
-
}
|
|
48
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
package app
|
|
2
|
-
|
|
3
|
-
import (
|
|
4
|
-
"dsmapp/internal/api"
|
|
5
|
-
"dsmapp/internal/background"
|
|
6
|
-
"dsmapp/internal/delegate"
|
|
7
|
-
"dsmapp/internal/filestation"
|
|
8
|
-
"path/filepath"
|
|
9
|
-
)
|
|
10
|
-
|
|
11
|
-
// DelegateRoutes is appended by the CLI's delegate capability assembly.
|
|
12
|
-
// scope comes from the trusted manifest, never an HTTP parameter.
|
|
13
|
-
func DelegateRoutes(cfg Config, scope string) []api.Route {
|
|
14
|
-
service := &delegate.Service{ExecutorDigest: cfg.ExecutorDigest, PolicyDigest: cfg.PolicyDigest, Client: delegate.Local(cfg.PackageID), Store: background.NewRequestStore(filepath.Join(cfg.DataDir, "background")), Scope: scope, StagingDir: filepath.Join(cfg.DataDir, "executor-staging"), InstallDraftPath: filepath.Join(cfg.DataDir, "delegate-install.json")}
|
|
15
|
-
settings, err := ParseDelegateConfig(cfg)
|
|
16
|
-
if err == nil {
|
|
17
|
-
service.Destinations, service.Operations, service.Lifetime = settings.Destinations, settings.Operations, settings.Lifetime
|
|
18
|
-
}
|
|
19
|
-
if cfg.SessionFiles != nil {
|
|
20
|
-
service.SessionFiles = cfg.SessionFiles
|
|
21
|
-
} else {
|
|
22
|
-
service.SessionFiles = filestation.Local(cfg.DataDir)
|
|
23
|
-
}
|
|
24
|
-
return service.Routes()
|
|
25
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
package app
|
|
2
|
-
|
|
3
|
-
func init() {
|
|
4
|
-
for method, params := range map[string]string{
|
|
5
|
-
"delegate.example.export": `{"key":"save","job_id":"example-1"}`,
|
|
6
|
-
"delegate.destination": `{"key":"save"}`,
|
|
7
|
-
"delegate.select_destination": `{"key":"save","path":"/home"}`,
|
|
8
|
-
"delegate.move_from_staging": `{"delegation_id":"grant","job_id":"export-1","staging":"a","name":"a","size":3}`,
|
|
9
|
-
"delegate.operations.get": `{"delegation_id":"grant","job_id":"export-1"}`,
|
|
10
|
-
"delegate.operations.list": `{}`,
|
|
11
|
-
"delegate.operations.cancel": `{"delegation_id":"grant","job_id":"export-1"}`,
|
|
12
|
-
"delegate.disable": `{}`, "delegate.enable": `{}`, "delegate.audit": `{}`,
|
|
13
|
-
} {
|
|
14
|
-
sampleParams[method] = params
|
|
15
|
-
sampleOutcome[method] = "session_required"
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
sampleParams["delegate.status"] = `{}`
|
|
19
|
-
sampleParams["delegate.create"] = `{"job_id":"job1","ops":["files.write"],"path":"/home","ttl_seconds":60}`
|
|
20
|
-
sampleParams["delegate.list"] = `{}`
|
|
21
|
-
sampleParams["delegate.revoke"] = `{"delegation_id":"missing"}`
|
|
22
|
-
sampleParams["delegate.jobs.submit"] = `{"key":"download","url":"http://localhost/file","dest":"/home","name":"file"}`
|
|
23
|
-
sampleParams["delegate.jobs.list"] = `{}`
|
|
24
|
-
sampleParams["delegate.jobs.cancel"] = `{"id":"missing"}`
|
|
25
|
-
sampleOutcome["delegate.create"] = "session_required"
|
|
26
|
-
sampleOutcome["delegate.list"] = "session_required"
|
|
27
|
-
sampleOutcome["delegate.revoke"] = "session_required"
|
|
28
|
-
sampleOutcome["delegate.jobs.submit"] = "identity_unavailable"
|
|
29
|
-
sampleOutcome["delegate.jobs.list"] = "identity_unavailable"
|
|
30
|
-
sampleOutcome["delegate.jobs.cancel"] = "identity_unavailable"
|
|
31
|
-
}
|
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
package background
|
|
2
|
-
|
|
3
|
-
import (
|
|
4
|
-
"context"
|
|
5
|
-
"errors"
|
|
6
|
-
"fmt"
|
|
7
|
-
"os"
|
|
8
|
-
"path/filepath"
|
|
9
|
-
"testing"
|
|
10
|
-
"time"
|
|
11
|
-
)
|
|
12
|
-
|
|
13
|
-
func TestReviewGrantCreationDoesNotBlockOtherOwnersCancel(t *testing.T) {
|
|
14
|
-
dir := filepath.Join(t.TempDir(), "spool")
|
|
15
|
-
worker := NewStore(dir)
|
|
16
|
-
cgi := NewRequestStore(dir)
|
|
17
|
-
cgi.lockTimeout = 20 * time.Millisecond
|
|
18
|
-
ctx := context.Background()
|
|
19
|
-
alice := Submitter{User: "alice", UID: "1205"}
|
|
20
|
-
bob := Submitter{User: "bob", UID: "1206"}
|
|
21
|
-
j, _, err := worker.Submit(ctx, SubmitRequest{Key: "existing", Name: "hash", Data: []byte("x"), Submitter: alice})
|
|
22
|
-
if err != nil {
|
|
23
|
-
t.Fatal(err)
|
|
24
|
-
}
|
|
25
|
-
started, release := make(chan struct{}), make(chan struct{})
|
|
26
|
-
done := make(chan error, 1)
|
|
27
|
-
go func() {
|
|
28
|
-
_, err := cgi.SubmitDelegated(ctx, SubmitRequest{Key: "download", Name: "file", Data: []byte("x"), Submitter: bob}, func(string) (DelegationBinding, error) {
|
|
29
|
-
close(started)
|
|
30
|
-
<-release
|
|
31
|
-
return DelegationBinding{DelegationID: "grant"}, nil
|
|
32
|
-
}, func(DelegationBinding) {})
|
|
33
|
-
done <- err
|
|
34
|
-
}()
|
|
35
|
-
<-started
|
|
36
|
-
_, err = cgi.CancelFor(ctx, j.ID, Access{Owner: alice})
|
|
37
|
-
close(release)
|
|
38
|
-
if err2 := <-done; err2 != nil {
|
|
39
|
-
t.Fatal(err2)
|
|
40
|
-
}
|
|
41
|
-
if errors.Is(err, ErrBusy) {
|
|
42
|
-
t.Fatal("another owner's DSM grant request blocks cancellation under global jobs lock")
|
|
43
|
-
}
|
|
44
|
-
if err != nil {
|
|
45
|
-
t.Fatal(err)
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
func TestDelegatedReservationCannotRunAndCanceledGrantIsRevoked(t *testing.T) {
|
|
50
|
-
s := NewStore(filepath.Join(t.TempDir(), "spool"))
|
|
51
|
-
ctx := context.Background()
|
|
52
|
-
owner := Submitter{User: "alice", UID: "1205"}
|
|
53
|
-
req := SubmitRequest{Key: "pending", Name: "file", Data: []byte("input"), Submitter: owner}
|
|
54
|
-
rollback := 0
|
|
55
|
-
_, err := s.SubmitDelegated(ctx, req, func(id string) (DelegationBinding, error) {
|
|
56
|
-
if claimed, e := s.Claim(ctx); e != nil || claimed != nil {
|
|
57
|
-
t.Fatalf("claimed unfinished reservation: %+v %v", claimed, e)
|
|
58
|
-
}
|
|
59
|
-
if _, e := s.SubmitDelegated(ctx, req, func(string) (DelegationBinding, error) {
|
|
60
|
-
t.Fatal("duplicate grant created")
|
|
61
|
-
return DelegationBinding{DelegationID: ""}, nil
|
|
62
|
-
}, func(DelegationBinding) {}); !errors.Is(e, ErrBusy) {
|
|
63
|
-
t.Fatal("inflight duplicate must be busy", e)
|
|
64
|
-
}
|
|
65
|
-
if _, e := s.CancelFor(ctx, id, Access{Owner: owner}); e != nil {
|
|
66
|
-
t.Fatal(e)
|
|
67
|
-
}
|
|
68
|
-
return DelegationBinding{DelegationID: "grant"}, nil
|
|
69
|
-
}, func(b DelegationBinding) {
|
|
70
|
-
rollback++
|
|
71
|
-
if b.DelegationID != "grant" {
|
|
72
|
-
t.Fatal(b)
|
|
73
|
-
}
|
|
74
|
-
if _, e := s.Delegation(ctx, b.JobID); e != nil {
|
|
75
|
-
t.Fatal("revocation not durable", e)
|
|
76
|
-
}
|
|
77
|
-
})
|
|
78
|
-
if !errors.Is(err, ErrNotCancelable) || rollback != 1 {
|
|
79
|
-
t.Fatal("canceled grant committed", err, rollback)
|
|
80
|
-
}
|
|
81
|
-
pending, e := s.DelegationCleanup(ctx)
|
|
82
|
-
if e != nil || len(pending) != 1 {
|
|
83
|
-
t.Fatal(pending, e)
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
func TestDelegatedCommitFailureRevokesOutsideLock(t *testing.T) {
|
|
88
|
-
s := NewStore(filepath.Join(t.TempDir(), "spool"))
|
|
89
|
-
ctx, cancel := context.WithCancel(context.Background())
|
|
90
|
-
defer cancel()
|
|
91
|
-
rollback := 0
|
|
92
|
-
_, err := s.SubmitDelegated(ctx, SubmitRequest{Key: "cancel-context", Name: "file", Data: []byte("input"), Submitter: Submitter{User: "alice", UID: "1205"}}, func(string) (DelegationBinding, error) {
|
|
93
|
-
cancel()
|
|
94
|
-
return DelegationBinding{DelegationID: "grant"}, nil
|
|
95
|
-
}, func(b DelegationBinding) {
|
|
96
|
-
rollback++
|
|
97
|
-
if _, e := s.Get(context.Background(), b.JobID); e != nil {
|
|
98
|
-
t.Fatal("rollback ran under journal lock", e)
|
|
99
|
-
}
|
|
100
|
-
})
|
|
101
|
-
if !errors.Is(err, context.Canceled) || rollback != 1 {
|
|
102
|
-
t.Fatal(err, rollback)
|
|
103
|
-
}
|
|
104
|
-
pending, e := s.DelegationCleanup(context.Background())
|
|
105
|
-
if e != nil || len(pending) != 1 {
|
|
106
|
-
t.Fatal("grant cleanup binding lost", pending, e)
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
func TestFailedGrantCreationReleasesReservation(t *testing.T) {
|
|
111
|
-
s := NewStore(filepath.Join(t.TempDir(), "spool"))
|
|
112
|
-
ctx := context.Background()
|
|
113
|
-
failure := errors.New("DSM unavailable")
|
|
114
|
-
var id string
|
|
115
|
-
_, err := s.SubmitDelegated(ctx, SubmitRequest{Key: "failed", Name: "file", Data: []byte("input"), Submitter: Submitter{User: "alice", UID: "1205"}}, func(job string) (DelegationBinding, error) {
|
|
116
|
-
id = job
|
|
117
|
-
return DelegationBinding{DelegationID: ""}, failure
|
|
118
|
-
}, func(DelegationBinding) { t.Error("revoked nonexistent grant") })
|
|
119
|
-
if !errors.Is(err, failure) {
|
|
120
|
-
t.Fatal(err)
|
|
121
|
-
}
|
|
122
|
-
job, e := s.Get(ctx, id)
|
|
123
|
-
if e != nil || job.AdmissionPending || job.State != StateFailed {
|
|
124
|
-
t.Fatal(job, e)
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
func TestDelegatedReservationRecoveryFailsClosed(t *testing.T) {
|
|
129
|
-
s := NewStore(filepath.Join(t.TempDir(), "spool"))
|
|
130
|
-
ctx := context.Background()
|
|
131
|
-
revoked := false
|
|
132
|
-
_, err := s.SubmitDelegated(ctx, SubmitRequest{Key: "recover", Name: "file", Data: []byte("input"), Submitter: Submitter{User: "alice", UID: "1205"}}, func(id string) (DelegationBinding, error) {
|
|
133
|
-
if e := s.Recover(ctx); e != nil {
|
|
134
|
-
t.Fatal(e)
|
|
135
|
-
}
|
|
136
|
-
job, e := s.Get(ctx, id)
|
|
137
|
-
if e != nil || job.State != StateInterrupted || job.AdmissionPending {
|
|
138
|
-
t.Fatal(job, e)
|
|
139
|
-
}
|
|
140
|
-
return DelegationBinding{DelegationID: "grant"}, nil
|
|
141
|
-
}, func(DelegationBinding) { revoked = true })
|
|
142
|
-
if !errors.Is(err, ErrNotCancelable) || !revoked {
|
|
143
|
-
t.Fatal("recovered reservation committed", err, revoked)
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
func TestDelegatedReservationsCountAgainstRevocationBacklog(t *testing.T) {
|
|
148
|
-
s := NewStore(filepath.Join(t.TempDir(), "spool"))
|
|
149
|
-
ctx := context.Background()
|
|
150
|
-
if err := s.withJournal(ctx, func(root *os.Root, _ *journal) (bool, error) {
|
|
151
|
-
for i := 0; i < MaxHistory+MaxQueued-1; i++ {
|
|
152
|
-
id := fmt.Sprintf("%032x", i)
|
|
153
|
-
if err := writeAtomic(root, bindingName(id), DelegationBinding{JobID: id, DelegationID: "old-grant"}); err != nil {
|
|
154
|
-
return false, err
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
return false, nil
|
|
158
|
-
}); err != nil {
|
|
159
|
-
t.Fatal(err)
|
|
160
|
-
}
|
|
161
|
-
_, err := s.SubmitDelegated(ctx, SubmitRequest{Key: "first", Name: "file", Data: []byte("input"), Submitter: Submitter{User: "alice", UID: "1205"}}, func(string) (DelegationBinding, error) {
|
|
162
|
-
_, err := s.SubmitDelegated(ctx, SubmitRequest{Key: "second", Name: "file", Data: []byte("input"), Submitter: Submitter{User: "bob", UID: "1206"}}, func(string) (DelegationBinding, error) {
|
|
163
|
-
t.Error("inflight reservation exceeded cleanup backlog bound")
|
|
164
|
-
return DelegationBinding{DelegationID: "extra-grant"}, nil
|
|
165
|
-
}, func(DelegationBinding) {})
|
|
166
|
-
if !errors.Is(err, ErrQuota) {
|
|
167
|
-
t.Errorf("pending reservation did not reserve cleanup capacity: %v", err)
|
|
168
|
-
}
|
|
169
|
-
return DelegationBinding{DelegationID: "grant"}, nil
|
|
170
|
-
}, func(DelegationBinding) {})
|
|
171
|
-
if err != nil {
|
|
172
|
-
t.Fatal(err)
|
|
173
|
-
}
|
|
174
|
-
}
|