add /api/v1/sim-cards GET endpoint

This commit is contained in:
2026-05-01 20:37:17 +02:00
parent e5128df5a0
commit ab86ed7e76
4 changed files with 55 additions and 8 deletions
+8 -1
View File
@@ -14,7 +14,7 @@ cur = con.cursor()
cur.execute("CREATE TABLE devices(access_key, secret_key_hash, type, name)")
cur.execute("CREATE TABLE messages(content, ts_received, ts_sent, sender, recipient)")
cur.execute("CREATE TABLE sim_events(sim_id, ts, note, cost, currency)")
cur.execute("CREATE TABLE sim_cards(phone_number, device_id)")
cur.execute("CREATE TABLE sim_cards(phone_number, device_access_key)")
pw1_hash = flask_bcrypt.generate_password_hash('pw1').decode('utf-8')
pw2_hash = flask_bcrypt.generate_password_hash('pw2').decode('utf-8')
@@ -24,6 +24,13 @@ cur.execute("""
('test_access_key2', ?, 'SECONDARY', 'test-secondary')
""", (pw1_hash, pw2_hash))
cur.execute("""
INSERT INTO sim_cards VALUES
('+420123456789', 'test_access_key'),
('+421000111222', 'test_access_key'),
('+422999888777', 'test_access_key2')
""")
con.commit()
con.close()