feat: Passwordless cross-device authentication

- Arkitektur: docs/auth/passwordless-architecture.md
- Backend: iom/quixzoom-auth-service/ (FastAPI + Redis)
- Webb: quixzoom-market-pages/se/login/ (QR-kod + polling)
- App: iom/quixzoom-app/src/features/auth/ (push + deep links)

Flöde: QR-kod → app-godkännande → webb-inloggad
This commit is contained in:
Bernt
2026-07-07 07:11:50 +00:00
parent 4aa984ad74
commit 6989a98d75
61843 changed files with 5491611 additions and 872231 deletions
+45
View File
@@ -0,0 +1,45 @@
import assert from 'assert';
import {Buffer as BufferT, uint8, DecodeStream, EncodeStream} from 'restructure';
describe('Buffer', function() {
describe('decode', function() {
it('should decode', function() {
const buffer = new Uint8Array([0xab, 0xff]);
const buf = new BufferT(2);
assert.deepEqual(buf.fromBuffer(buffer), new Uint8Array([0xab, 0xff]));
});
it('should decode with parent key length', function() {
const stream = new DecodeStream(new Uint8Array([0xab, 0xff, 0x1f, 0xb6]));
const buf = new BufferT('len');
assert.deepEqual(buf.decode(stream, {len: 3}), new Uint8Array([0xab, 0xff, 0x1f]));
assert.deepEqual(buf.decode(stream, {len: 1}), new Uint8Array([0xb6]));
});
});
describe('size', function() {
it('should return size', function() {
const buf = new BufferT(2);
assert.equal(buf.size(new Uint8Array([0xab, 0xff])), 2);
});
it('should use defined length if no value given', function() {
const array = new BufferT(10);
assert.equal(array.size(), 10);
});
});
describe('encode', function() {
it('should encode', function() {
const buf = new BufferT(2);
const buffer = buf.toBuffer(new Uint8Array([0xab, 0xff]));
assert.deepEqual(buffer, new Uint8Array([0xab, 0xff]));
});
it('should encode length before buffer', function() {
const buf = new BufferT(uint8);
const buffer = buf.toBuffer(new Uint8Array([0xab, 0xff]));
assert.deepEqual(buffer, new Uint8Array([2, 0xab, 0xff]));
});
});
});