feat: deploy platform inventory and signed APT retry client compatibility
Rust development slice / linux (push) Failing after 6s
Rust development slice / linux (push) Failing after 6s
This commit is contained in:
@@ -48,6 +48,26 @@ describe('root and dedicated dev-test APT actions', () => {
|
||||
const before = JSON.stringify(value); await validateSensitiveInput(value, auth); expect(JSON.stringify(value)).toBe(before);
|
||||
await expect(validateSensitiveInput({ ...value, parameters: { ...value.parameters, version: '2' } }, auth)).rejects.toThrow('Paketidentität');
|
||||
});
|
||||
it('requires an explicit schema3 native retry reference; rejects missing/unknown/normal retry fields', async () => {
|
||||
const base = await manifest();
|
||||
const native_retry = { schema_version: 1, previous_grant_id: '11111111-1111-4111-8111-111111111111', previous_attempt_id: '22222222-2222-4222-8222-222222222222', bootstrap_marker_sha256: 'a'.repeat(64) };
|
||||
const m = { ...base, schema_version: 3, native_retry };
|
||||
await validateSensitiveInput(input(m), auth);
|
||||
expect(() => validateAptManifest({ ...base, schema_version: 3 }, true)).toThrow();
|
||||
expect(() => validateAptManifest({ ...base, native_retry }, true)).toThrow();
|
||||
expect(() => validateAptManifest({ ...m, native_retry: { ...native_retry, previous_grant_id: '../active' } }, true)).toThrow();
|
||||
expect(() => validateAptManifest({ ...m, native_retry: { ...native_retry, previous_attempt_id: '00000000-0000-0000-0000-000000000000' } }, true)).toThrow();
|
||||
expect(() => validateAptManifest({ ...m, native_retry: { ...native_retry, bootstrap_marker_sha256: '0'.repeat(64) } }, true)).toThrow();
|
||||
expect(() => validateAptManifest({ ...m, action: 'apt-execute' }, false)).toThrow('eigener nativer');
|
||||
});
|
||||
it('binds update package names to the exact versions in the unchanged signed manifest', async () => {
|
||||
const m = await manifest(false); const value = input(m); value.action = 'apply_updates';
|
||||
value.parameters = { execution_identity: 'root', provider: 'apt', packages: ['rmm-mvp-test'], reboot_policy: 'never', apt_manifest: m };
|
||||
await validateSensitiveInput(value, auth);
|
||||
await expect(validateSensitiveInput({ ...value, parameters: { ...value.parameters, packages: ['other'] } }, auth)).rejects.toThrow('Updateauswahl');
|
||||
await expect(validateSensitiveInput({ ...value, parameters: { ...value.parameters, packages: [] } }, auth)).rejects.toThrow('Updateauswahl');
|
||||
await expect(validateSensitiveInput({ ...value, parameters: { ...value.parameters, packages: ['rmm-mvp-test=1.0'] } }, auth)).rejects.toThrow('Updateauswahl');
|
||||
});
|
||||
it('checks exact plan byte hash and manifest consistency without demanding execution IDs', async () => {
|
||||
const p = { targets: ['asset'], jobs: [{ payload: { asset_id: 'asset', action: { action: 'apt_native_acceptance', apt_manifest: await manifest() } } }] }, raw = new TextEncoder().encode(JSON.stringify(p));
|
||||
const plan = { plan_payload: p, plan_payload_bytes: Array.from(raw), plan_hash: await sha256(raw), jobs: p.jobs };
|
||||
|
||||
Reference in New Issue
Block a user