2.2 KiB
2.2 KiB
AGENTS.md
This document provides context for AI agents operating on the user_creation infrastructure.
Architecture & Tooling
- This directory contains a standalone Google Apps Script project managed via
@google/clasp. - Do NOT use TypeScript. We use vanilla
.js(src/Code.js) to bypass local transpilation complexity. - Authentication: We use
ScriptApp.getOAuthToken()directly to authenticate against the Google Identity Toolkit REST API. DO NOT implement Web API Keys or Service Accounts in the code. The script relies on its link to the underlying GCP project to inherit the trigger owner's permissions.
Rules & Safeguards (CRITICAL)
- Never physically delete users.
- The declarative logic must use Soft Deletes. If an email is removed from the Google Sheet, the script must issue an API update to set
disableUser: truein Firebase. This preserves historical records and prevents data corruption.
- The declarative logic must use Soft Deletes. If an email is removed from the Google Sheet, the script must issue an API update to set
- Respect
DRY_RUN.- When
CONFIG.DRY_RUNis true, the script must only evaluate state and log its intended API calls. It must completely bypass anyUrlFetchApp.fetchcalls that mutate Firebase state.
- When
- Trigger Handling (
setup).- The script uses dual triggers (
onFormSubmitandonChange). Ensure both are cleared and re-created wheneversetup()is called. clasp pushdoes not update triggers. Always instruct the human user to runsetup()manually in the IDE after a push.
- The script uses dual triggers (
- Conditional Email Logging.
- Only dispatch the admin summary email (to
CONFIG.ADMIN_EMAIL) if a mutation occurred. If the target state and current state are perfectly synchronized, exit silently to prevent inbox pollution.
- Only dispatch the admin summary email (to
Implementation Details
- Email/Password Strategy: We generate a highly secure random password locally during the
accountscreation request.CONFIG.SEND_EMAIL_ON_CREATIONcontrols whether password reset emails are sent automatically. - Custom Action URL: The Firebase Password Reset templates have been modified via the Console to point to the Vue.js app (
https://haumdaucher.de/). The frontendApp.vueintercepts?mode=resetPasswordand displaysPasswordReset.vue. Do NOT change this logic without considering the UI impact.