From 1a4470a1d62742473b0a7b61caeaa8cf5d2cf92a Mon Sep 17 00:00:00 2001 From: Niko Heller Date: Thu, 26 Nov 2026 16:40:08 +0100 Subject: [PATCH] feat(saml): return emailConfirmed on users --- fixtures/users/01_doejohn_kv-salzgitter_stadtrat.json | 1 + .../02_beckjan_kv-berlin-mitte_wahlkampf-koordinator-kv.json | 1 + .../03_rotheva_kv-berlin-mitte_wahlkampf-koordinator-lv.json | 1 + .../04_graftom_kv-berlin-mitte_wahlkampf-koordinator-bv.json | 1 + fixtures/users/05_mayluz_mitarbeiter-extern_gnetzadmin.json | 1 + fixtures/users/06_muellean_kv-konstanz_mitglied.json | 1 + fixtures/users/07_schmidth_kv-konstanz_mitglied.json | 1 + fixtures/users/08_webermar_kv-konstanz_mitglied.json | 1 + fixtures/users/09_fischepe_kv-konstanz_mitglied.json | 1 + fixtures/users/10_wagnersa_kv-rhein-hunsrueck_mitglied.json | 1 + fixtures/users/11_beckermi_kv-rhein-hunsrueck_mitglied.json | 1 + fixtures/users/12_schulzju_kv-rhein-hunsrueck_mitglied.json | 1 + fixtures/users/13_hoffmast_kv-rhein-hunsrueck_mitglied.json | 1 + .../14_kochlisa_kv-konstanz_wahlkampf-koordinator-kv.json | 1 + .../15_richteda_kv-konstanz_wahlkampf-koordinator-kv.json | 1 + ...kleinnin_kv-rhein-hunsrueck_wahlkampf-koordinator-kv.json | 1 + ...wolfmart_kv-rhein-hunsrueck_wahlkampf-koordinator-kv.json | 1 + ...unsrueck_haustuer-wk-lokal-koordination_kommunalwahl.json | 1 + ...itte_landesverband-koordinatorin_bundestagswahlkampf.json | 1 + .../users/20_schneima_ov-holm_wahlkampf-koordinator-kv.json | 1 + spec/SOURCE | 2 +- spec/openapi.d.ts | 2 ++ spec/openapi.yaml | 4 ++++ src/store/migrations.ts | 1 + src/store/seed.ts | 5 +++-- src/store/users.ts | 2 ++ 26 files changed, 33 insertions(+), 3 deletions(-) diff --git a/fixtures/users/01_doejohn_kv-salzgitter_stadtrat.json b/fixtures/users/01_doejohn_kv-salzgitter_stadtrat.json index 772f2dc..53530bf 100644 --- a/fixtures/users/01_doejohn_kv-salzgitter_stadtrat.json +++ b/fixtures/users/01_doejohn_kv-salzgitter_stadtrat.json @@ -4,6 +4,7 @@ "name1": "John", "name2": "Doe", "email": "john.doe@example.com", + "emailConfirmed": true, "ownerId": "9373", "ownerIdentifier": "10903700", "createdOn": "2024-01-01T12:33:41.123Z", diff --git a/fixtures/users/02_beckjan_kv-berlin-mitte_wahlkampf-koordinator-kv.json b/fixtures/users/02_beckjan_kv-berlin-mitte_wahlkampf-koordinator-kv.json index 38996f5..5773dcf 100644 --- a/fixtures/users/02_beckjan_kv-berlin-mitte_wahlkampf-koordinator-kv.json +++ b/fixtures/users/02_beckjan_kv-berlin-mitte_wahlkampf-koordinator-kv.json @@ -4,6 +4,7 @@ "name1": "Jan", "name2": "Beck", "email": "jan.beck@example.com", + "emailConfirmed": true, "ownerId": "5919", "ownerIdentifier": "10300100", "createdOn": "2020-01-01T12:00:00+0200", diff --git a/fixtures/users/03_rotheva_kv-berlin-mitte_wahlkampf-koordinator-lv.json b/fixtures/users/03_rotheva_kv-berlin-mitte_wahlkampf-koordinator-lv.json index 02a860b..e57a697 100644 --- a/fixtures/users/03_rotheva_kv-berlin-mitte_wahlkampf-koordinator-lv.json +++ b/fixtures/users/03_rotheva_kv-berlin-mitte_wahlkampf-koordinator-lv.json @@ -4,6 +4,7 @@ "name1": "Eva", "name2": "Roth", "email": "eva.roth@example.com", + "emailConfirmed": true, "ownerId": "5919", "ownerIdentifier": "10300100", "createdOn": "2020-01-01T12:00:00+0200", diff --git a/fixtures/users/04_graftom_kv-berlin-mitte_wahlkampf-koordinator-bv.json b/fixtures/users/04_graftom_kv-berlin-mitte_wahlkampf-koordinator-bv.json index 7a52932..15f5399 100644 --- a/fixtures/users/04_graftom_kv-berlin-mitte_wahlkampf-koordinator-bv.json +++ b/fixtures/users/04_graftom_kv-berlin-mitte_wahlkampf-koordinator-bv.json @@ -4,6 +4,7 @@ "name1": "Tom", "name2": "Graf", "email": "tom.graf@example.com", + "emailConfirmed": true, "ownerId": "5919", "ownerIdentifier": "10300100", "createdOn": "2020-01-01T12:00:00+0200", diff --git a/fixtures/users/05_mayluz_mitarbeiter-extern_gnetzadmin.json b/fixtures/users/05_mayluz_mitarbeiter-extern_gnetzadmin.json index 88aea7f..6a64dc4 100644 --- a/fixtures/users/05_mayluz_mitarbeiter-extern_gnetzadmin.json +++ b/fixtures/users/05_mayluz_mitarbeiter-extern_gnetzadmin.json @@ -4,6 +4,7 @@ "name1": "Luz", "name2": "May", "email": "luz.may@example.com", + "emailConfirmed": true, "ownerId": "5919", "ownerIdentifier": "10300100", "createdOn": "2020-01-01T12:00:00+0200", diff --git a/fixtures/users/06_muellean_kv-konstanz_mitglied.json b/fixtures/users/06_muellean_kv-konstanz_mitglied.json index 492af82..7786f2a 100644 --- a/fixtures/users/06_muellean_kv-konstanz_mitglied.json +++ b/fixtures/users/06_muellean_kv-konstanz_mitglied.json @@ -4,6 +4,7 @@ "name1": "Anna", "name2": "Müller", "email": "anna.mueller@example.com", + "emailConfirmed": true, "ownerId": "2828", "ownerIdentifier": "10102100", "createdOn": "2025-12-16T12:00:00+0100", diff --git a/fixtures/users/07_schmidth_kv-konstanz_mitglied.json b/fixtures/users/07_schmidth_kv-konstanz_mitglied.json index b66a9df..3fd32b7 100644 --- a/fixtures/users/07_schmidth_kv-konstanz_mitglied.json +++ b/fixtures/users/07_schmidth_kv-konstanz_mitglied.json @@ -4,6 +4,7 @@ "name1": "Thomas", "name2": "Schmidt", "email": "thomas.schmidt@example.com", + "emailConfirmed": false, "ownerId": "2828", "ownerIdentifier": "10102100", "createdOn": "2025-12-16T12:00:00+0100", diff --git a/fixtures/users/08_webermar_kv-konstanz_mitglied.json b/fixtures/users/08_webermar_kv-konstanz_mitglied.json index 9a489de..61d7995 100644 --- a/fixtures/users/08_webermar_kv-konstanz_mitglied.json +++ b/fixtures/users/08_webermar_kv-konstanz_mitglied.json @@ -4,6 +4,7 @@ "name1": "Maria", "name2": "Weber", "email": "maria.weber@example.com", + "emailConfirmed": true, "ownerId": "2828", "ownerIdentifier": "10102100", "createdOn": "2025-12-16T12:00:00+0100", diff --git a/fixtures/users/09_fischepe_kv-konstanz_mitglied.json b/fixtures/users/09_fischepe_kv-konstanz_mitglied.json index c09f44d..8c98f83 100644 --- a/fixtures/users/09_fischepe_kv-konstanz_mitglied.json +++ b/fixtures/users/09_fischepe_kv-konstanz_mitglied.json @@ -4,6 +4,7 @@ "name1": "Peter", "name2": "Fischer", "email": "peter.fischer@example.com", + "emailConfirmed": true, "ownerId": "2828", "ownerIdentifier": "10102100", "createdOn": "2025-12-16T12:00:00+0100", diff --git a/fixtures/users/10_wagnersa_kv-rhein-hunsrueck_mitglied.json b/fixtures/users/10_wagnersa_kv-rhein-hunsrueck_mitglied.json index 520937f..22ece55 100644 --- a/fixtures/users/10_wagnersa_kv-rhein-hunsrueck_mitglied.json +++ b/fixtures/users/10_wagnersa_kv-rhein-hunsrueck_mitglied.json @@ -4,6 +4,7 @@ "name1": "Sarah", "name2": "Wagner", "email": "sarah.wagner@example.com", + "emailConfirmed": true, "ownerId": "13081", "ownerIdentifier": "11102700", "createdOn": "2025-12-16T12:00:00+0100", diff --git a/fixtures/users/11_beckermi_kv-rhein-hunsrueck_mitglied.json b/fixtures/users/11_beckermi_kv-rhein-hunsrueck_mitglied.json index 1abe98e..e388b5d 100644 --- a/fixtures/users/11_beckermi_kv-rhein-hunsrueck_mitglied.json +++ b/fixtures/users/11_beckermi_kv-rhein-hunsrueck_mitglied.json @@ -4,6 +4,7 @@ "name1": "Michael", "name2": "Becker", "email": "michael.becker@example.com", + "emailConfirmed": false, "ownerId": "13081", "ownerIdentifier": "11102700", "createdOn": "2025-12-16T12:00:00+0100", diff --git a/fixtures/users/12_schulzju_kv-rhein-hunsrueck_mitglied.json b/fixtures/users/12_schulzju_kv-rhein-hunsrueck_mitglied.json index bf77400..db45b3d 100644 --- a/fixtures/users/12_schulzju_kv-rhein-hunsrueck_mitglied.json +++ b/fixtures/users/12_schulzju_kv-rhein-hunsrueck_mitglied.json @@ -4,6 +4,7 @@ "name1": "Julia", "name2": "Schulz", "email": "julia.schulz@example.com", + "emailConfirmed": true, "ownerId": "13081", "ownerIdentifier": "11102700", "createdOn": "2025-12-16T12:00:00+0100", diff --git a/fixtures/users/13_hoffmast_kv-rhein-hunsrueck_mitglied.json b/fixtures/users/13_hoffmast_kv-rhein-hunsrueck_mitglied.json index 2d6bd2e..1058292 100644 --- a/fixtures/users/13_hoffmast_kv-rhein-hunsrueck_mitglied.json +++ b/fixtures/users/13_hoffmast_kv-rhein-hunsrueck_mitglied.json @@ -4,6 +4,7 @@ "name1": "Stefan", "name2": "Hoffmann", "email": "stefan.hoffmann@example.com", + "emailConfirmed": true, "ownerId": "13081", "ownerIdentifier": "11102700", "createdOn": "2025-12-16T12:00:00+0100", diff --git a/fixtures/users/14_kochlisa_kv-konstanz_wahlkampf-koordinator-kv.json b/fixtures/users/14_kochlisa_kv-konstanz_wahlkampf-koordinator-kv.json index 1e1f497..fdd93de 100644 --- a/fixtures/users/14_kochlisa_kv-konstanz_wahlkampf-koordinator-kv.json +++ b/fixtures/users/14_kochlisa_kv-konstanz_wahlkampf-koordinator-kv.json @@ -4,6 +4,7 @@ "name1": "Lisa", "name2": "Koch", "email": "lisa.koch@example.com", + "emailConfirmed": true, "ownerId": "2828", "ownerIdentifier": "10102100", "createdOn": "2025-12-16T12:00:00+0100", diff --git a/fixtures/users/15_richteda_kv-konstanz_wahlkampf-koordinator-kv.json b/fixtures/users/15_richteda_kv-konstanz_wahlkampf-koordinator-kv.json index 8f95ff6..47c987f 100644 --- a/fixtures/users/15_richteda_kv-konstanz_wahlkampf-koordinator-kv.json +++ b/fixtures/users/15_richteda_kv-konstanz_wahlkampf-koordinator-kv.json @@ -4,6 +4,7 @@ "name1": "David", "name2": "Richter", "email": "david.richter@example.com", + "emailConfirmed": true, "ownerId": "2828", "ownerIdentifier": "10102100", "createdOn": "2025-12-16T12:00:00+0100", diff --git a/fixtures/users/16_kleinnin_kv-rhein-hunsrueck_wahlkampf-koordinator-kv.json b/fixtures/users/16_kleinnin_kv-rhein-hunsrueck_wahlkampf-koordinator-kv.json index 1a99cc5..8db8fc5 100644 --- a/fixtures/users/16_kleinnin_kv-rhein-hunsrueck_wahlkampf-koordinator-kv.json +++ b/fixtures/users/16_kleinnin_kv-rhein-hunsrueck_wahlkampf-koordinator-kv.json @@ -4,6 +4,7 @@ "name1": "Nina", "name2": "Klein", "email": "nina.klein@example.com", + "emailConfirmed": true, "ownerId": "13081", "ownerIdentifier": "11102700", "createdOn": "2025-12-16T12:00:00+0100", diff --git a/fixtures/users/17_wolfmart_kv-rhein-hunsrueck_wahlkampf-koordinator-kv.json b/fixtures/users/17_wolfmart_kv-rhein-hunsrueck_wahlkampf-koordinator-kv.json index f1cd09b..28e5c49 100644 --- a/fixtures/users/17_wolfmart_kv-rhein-hunsrueck_wahlkampf-koordinator-kv.json +++ b/fixtures/users/17_wolfmart_kv-rhein-hunsrueck_wahlkampf-koordinator-kv.json @@ -4,6 +4,7 @@ "name1": "Martin", "name2": "Wolf", "email": "martin.wolf@example.com", + "emailConfirmed": true, "ownerId": "13081", "ownerIdentifier": "11102700", "createdOn": "2025-12-16T12:00:00+0100", diff --git a/fixtures/users/18_webernad_kv-rhein-hunsrueck_haustuer-wk-lokal-koordination_kommunalwahl.json b/fixtures/users/18_webernad_kv-rhein-hunsrueck_haustuer-wk-lokal-koordination_kommunalwahl.json index bfee4e4..0d1f4f2 100644 --- a/fixtures/users/18_webernad_kv-rhein-hunsrueck_haustuer-wk-lokal-koordination_kommunalwahl.json +++ b/fixtures/users/18_webernad_kv-rhein-hunsrueck_haustuer-wk-lokal-koordination_kommunalwahl.json @@ -4,6 +4,7 @@ "name1": "Nadine", "name2": "Weber", "email": "nadine.weber@example.com", + "emailConfirmed": true, "ownerId": "13081", "ownerIdentifier": "11102700", "createdOn": "2026-01-05T12:00:00+0100", diff --git a/fixtures/users/19_nussbami_kv-berlin-mitte_landesverband-koordinatorin_bundestagswahlkampf.json b/fixtures/users/19_nussbami_kv-berlin-mitte_landesverband-koordinatorin_bundestagswahlkampf.json index 33e20ac..4041f10 100644 --- a/fixtures/users/19_nussbami_kv-berlin-mitte_landesverband-koordinatorin_bundestagswahlkampf.json +++ b/fixtures/users/19_nussbami_kv-berlin-mitte_landesverband-koordinatorin_bundestagswahlkampf.json @@ -4,6 +4,7 @@ "name1": "Michael", "name2": "Nussbaum", "email": "michael.nussbaum@example.com", + "emailConfirmed": true, "ownerId": "5919", "ownerIdentifier": "10300100", "createdOn": "2026-01-05T12:00:00+0100", diff --git a/fixtures/users/20_schneima_ov-holm_wahlkampf-koordinator-kv.json b/fixtures/users/20_schneima_ov-holm_wahlkampf-koordinator-kv.json index f4dcda4..cb1da39 100644 --- a/fixtures/users/20_schneima_ov-holm_wahlkampf-koordinator-kv.json +++ b/fixtures/users/20_schneima_ov-holm_wahlkampf-koordinator-kv.json @@ -4,6 +4,7 @@ "name1": "Maximilian", "name2": "Schneider", "email": "maximilian.schneider@example.com", + "emailConfirmed": false, "ownerId": "6910057", "ownerIdentifier": "11500917", "createdOn": "2026-01-05T12:00:00+0100", diff --git a/spec/SOURCE b/spec/SOURCE index 9876834..c75a1c8 100644 --- a/spec/SOURCE +++ b/spec/SOURCE @@ -1 +1 @@ -https://git.verdigado.com/verdigado/sherpa-api/src/commit/54178798409b97cf7b55caafcc5bf4a797b45d45/openapi.yaml +https://git.verdigado.com/verdigado/sherpa-api/src/commit/8f9f537611820ec5d3c7b37e4d35601c060db415/openapi.yaml diff --git a/spec/openapi.d.ts b/spec/openapi.d.ts index bfefa03..f9255b8 100644 --- a/spec/openapi.d.ts +++ b/spec/openapi.d.ts @@ -1079,6 +1079,8 @@ export interface components { * @example john.doe@example.com */ email: string | null; + /** @description Whether the email address has been verified as belonging to the user. */ + emailConfirmed: boolean; /** @description Sperrvermerk in sherpa. Flag to indicate that user should not receive any emails. */ blockingNotice?: boolean; roles: components["schemas"]["SamlUserRole"][]; diff --git a/spec/openapi.yaml b/spec/openapi.yaml index 7b5266a..b71f7e6 100644 --- a/spec/openapi.yaml +++ b/spec/openapi.yaml @@ -2064,6 +2064,9 @@ components: type: [string, 'null'] format: email example: john.doe@example.com + emailConfirmed: + description: Whether the email address has been verified as belonging to the user. + type: boolean blockingNotice: description: Sperrvermerk in sherpa. Flag to indicate that user should not receive any emails. type: boolean @@ -2085,6 +2088,7 @@ components: - name1 - name2 - email + - emailConfirmed - roles - memberships diff --git a/src/store/migrations.ts b/src/store/migrations.ts index 7e17742..31954ae 100644 --- a/src/store/migrations.ts +++ b/src/store/migrations.ts @@ -11,6 +11,7 @@ export const MIGRATIONS = [ name1 TEXT NOT NULL, name2 TEXT NOT NULL, email TEXT, + email_confirmed INTEGER NOT NULL, owner_id TEXT NOT NULL, owner_identifier TEXT NOT NULL, created_on TEXT NOT NULL, diff --git a/src/store/seed.ts b/src/store/seed.ts index faf915e..97c0f26 100644 --- a/src/store/seed.ts +++ b/src/store/seed.ts @@ -21,9 +21,9 @@ export function resetDatabase(db: DatabaseSync) { function seed(db: DatabaseSync) { const insertUser = db.prepare(` - INSERT INTO users (id, personal_id, name1, name2, email, owner_id, owner_identifier, + INSERT INTO users (id, personal_id, name1, name2, email, email_confirmed, owner_id, owner_identifier, created_on, last_modified_on, achievements, form_values) - VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) `) const insertMembership = db.prepare(` INSERT INTO memberships (id, user_id, owner_identifier, member_of_structure_identifier, @@ -43,6 +43,7 @@ function seed(db: DatabaseSync) { user.name1, user.name2, user.email, + Number(user.emailConfirmed), user.ownerId, user.ownerIdentifier, toIso(user.createdOn), diff --git a/src/store/users.ts b/src/store/users.ts index f3d13e9..7c5b48a 100644 --- a/src/store/users.ts +++ b/src/store/users.ts @@ -8,6 +8,7 @@ export type UserRow = { name1: string name2: string email: string | null + email_confirmed: number owner_id: string owner_identifier: string created_on: string @@ -117,6 +118,7 @@ export function toSamlUser( name1: user.name1, name2: user.name2, email: user.email, + emailConfirmed: Boolean(user.email_confirmed), roles: getRoleAssignments(db, user.id).map((assignment) => ({ toType: 'SamlSynchronizationRoleAssignmentTO', id: assignment.id,