From 6883b058246af2a8a0f746b034cd2b300dbe2f4e Mon Sep 17 00:00:00 2001 From: Aaron Po Date: Tue, 23 Jun 2026 01:39:57 -0400 Subject: [PATCH] remove password field --- .../includes/data_model/generated_models.h | 5 ++--- .../database/sqlite_statement_helpers.h | 7 ++----- .../generate_users.cc | 17 ----------------- .../src/services/sqlite/process_user_record.cc | 6 ------ 4 files changed, 4 insertions(+), 31 deletions(-) diff --git a/tooling/pipeline/includes/data_model/generated_models.h b/tooling/pipeline/includes/data_model/generated_models.h index ee9a8b9..84a5fcf 100644 --- a/tooling/pipeline/includes/data_model/generated_models.h +++ b/tooling/pipeline/includes/data_model/generated_models.h @@ -102,8 +102,8 @@ struct BreweryRecord { /** * @brief Helper struct to store generated user data. * - * `email`, `date_of_birth`, and `password` are programmatically generated by - * the orchestrator (never LLM-authored) so a downstream auth-account seeding + * `email` and `date_of_birth` are programmatically generated by the + * orchestrator (never LLM-authored) so a downstream auth-account seeding * consumer can register real accounts from the pipeline's SQLite export. */ struct UserRecord { @@ -111,7 +111,6 @@ struct UserRecord { UserResult user; std::string email{}; std::string date_of_birth{}; - std::string password{}; }; #endif // BIERGARTEN_PIPELINE_INCLUDES_DATA_MODEL_GENERATED_MODELS_H_ diff --git a/tooling/pipeline/includes/services/database/sqlite_statement_helpers.h b/tooling/pipeline/includes/services/database/sqlite_statement_helpers.h index 2025d41..1e7b874 100644 --- a/tooling/pipeline/includes/services/database/sqlite_statement_helpers.h +++ b/tooling/pipeline/includes/services/database/sqlite_statement_helpers.h @@ -63,7 +63,6 @@ CREATE TABLE IF NOT EXISTS users ( activity_weight REAL NOT NULL, email TEXT NOT NULL UNIQUE, date_of_birth TEXT NOT NULL, - password TEXT NOT NULL, FOREIGN KEY(location_id) REFERENCES locations(id) ON DELETE CASCADE ); @@ -104,9 +103,8 @@ INSERT INTO users ( bio, activity_weight, email, - date_of_birth, - password -) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?); + date_of_birth +) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?); )sql"; // sqlite3_bind_*() parameter indices are 1-based, matching the "?" @@ -135,7 +133,6 @@ inline constexpr int kUserBioBindIndex = 6; inline constexpr int kUserActivityWeightBindIndex = 7; inline constexpr int kUserEmailBindIndex = 8; inline constexpr int kUserDateOfBirthBindIndex = 9; -inline constexpr int kUserPasswordBindIndex = 10; SqliteStatementHandle PrepareStatement(const SqliteDatabaseHandle& db_handle, std::string_view sql, diff --git a/tooling/pipeline/src/biergarten_pipeline_orchestrator/generate_users.cc b/tooling/pipeline/src/biergarten_pipeline_orchestrator/generate_users.cc index e72eb03..8a562c3 100644 --- a/tooling/pipeline/src/biergarten_pipeline_orchestrator/generate_users.cc +++ b/tooling/pipeline/src/biergarten_pipeline_orchestrator/generate_users.cc @@ -71,22 +71,6 @@ std::string GenerateDateOfBirth(std::mt19937& rng) { static_cast(birth_ymd.day())); } -std::string GenerateRandomPassword(std::mt19937& rng) { - constexpr size_t k_password_length = 32; - constexpr std::string_view k_charset = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&" - "*"; - - std::uniform_int_distribution char_dist(0, k_charset.size() - 1); - - std::string password; - password.reserve(k_password_length); - for (size_t i = 0; i < k_password_length; ++i) { - password.push_back(k_charset[char_dist(rng)]); - } - return password; -} - } // namespace void BiergartenPipelineOrchestrator::GenerateUsers( @@ -128,7 +112,6 @@ void BiergartenPipelineOrchestrator::GenerateUsers( .user = user, .email = BuildEmail(sampled_name, used_email_local_parts), .date_of_birth = GenerateDateOfBirth(rng), - .password = GenerateRandomPassword(rng), }; } catch (const std::exception& e) { ++skipped_count; diff --git a/tooling/pipeline/src/services/sqlite/process_user_record.cc b/tooling/pipeline/src/services/sqlite/process_user_record.cc index 840cc2c..ec2a762 100644 --- a/tooling/pipeline/src/services/sqlite/process_user_record.cc +++ b/tooling/pipeline/src/services/sqlite/process_user_record.cc @@ -69,12 +69,6 @@ uint64_t SqliteExportService::ProcessRecord(const UserRecord& user) { .index = sqlite_export_service_internal::kUserDateOfBirthBindIndex, .value = user.date_of_birth, .action = "Failed to bind SQLite user date of birth"}); - sqlite_export_service_internal::Bind( - insert_user_stmt_, - sqlite_export_service_internal::BindParam{ - .index = sqlite_export_service_internal::kUserPasswordBindIndex, - .value = user.password, - .action = "Failed to bind SQLite user password"}); sqlite_export_service_internal::StepStatement( db_handle_, insert_user_stmt_, "Failed to insert SQLite user row");