Skip to content

Rename shared airtable secret#2813

Merged
joshestein merged 2 commits into
masterfrom
josh/2808-rename-shared-airtable-secret
Jul 20, 2026
Merged

Rename shared airtable secret#2813
joshestein merged 2 commits into
masterfrom
josh/2808-rename-shared-airtable-secret

Conversation

@joshestein

Copy link
Copy Markdown
Collaborator

Description

Make a follow-up PR to delete the same passphrase from Pulumi.

Issue

Fixes #2808

Developer checklist

@Will-Howard
Will-Howard temporarily deployed to josh/2808-rename-shared-airtable-secret - bluedot-preview PR #2813 July 20, 2026 13:22 — with Render Destroyed
@Will-Howard
Will-Howard temporarily deployed to josh/2808-rename-shared-airtable-secret - bluedot-storybook-preview PR #2813 July 20, 2026 13:23 — with Render Destroyed
@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Renames CERTIFICATE_CREATION_TOKEN to AIRTABLE_AUTOMATION_TOKEN across Pulumi production configuration, Kubernetes secret mappings, staging and production website services, website environment validation, token verification, and related test fixtures. The verification logic continues to validate token length and equality, while tests now configure and clear the renamed environment variable.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately captures the main change: renaming the shared secret to AIRTABLE_AUTOMATION_TOKEN.
Description check ✅ Passed The description includes the required Description, Issue, and checklist sections, and omits the screenshot section appropriately.
Linked Issues check ✅ Passed The code updates rename CERTIFICATE_CREATION_TOKEN to AIRTABLE_AUTOMATION_TOKEN across app and infra paths, matching issue #2808's core requirement.
Out of Scope Changes check ✅ Passed The edits stay focused on the secret rename and related config/test updates, with no obvious unrelated changes.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch josh/2808-rename-shared-airtable-secret

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Checkov (3.3.8)
apps/infra/Pulumi.prod.yaml

Traceback (most recent call last):
File "/usr/local/bin/checkov", line 2, in
from checkov.main import Checkov
ModuleNotFoundError: No module named 'checkov'

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install timed out. The project may have too many dependencies for the sandbox.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR renames the shared Airtable automation secret from CERTIFICATE_CREATION_TOKEN / certificateCreationToken to AIRTABLE_AUTOMATION_TOKEN / airtableAutomationToken across infra and website app code. The old Pulumi config entry is intentionally left in place and will be removed in a follow-up PR.

  • Infra: Adds airtableAutomationToken to the Pulumi secrets list and K8s toK8s array, removes certificateCreationToken from both, and updates serviceDefinitions.ts to inject the new env var name in both staging and prod service definitions.
  • Website: Updates env.ts, utils.ts, .env.test, and both test files to use the new AIRTABLE_AUTOMATION_TOKEN name throughout — the verifyPublicToken helper and the certificates router tests are fully aligned with the rename.

Confidence Score: 5/5

This is a mechanical rename with no logic changes — safe to merge.

Every reference to the old token name has been updated consistently across infra config, K8s secret definitions, service env var injections, the website env validation, the verifyPublicToken helper, and all associated tests. A codebase-wide search confirms no stale references remain in application code. The only leftover is the encrypted certificateCreationToken entry in Pulumi.prod.yaml, which the PR description explicitly flags for a follow-up cleanup and has no runtime impact since the Pulumi program no longer reads it.

No files require special attention.

Important Files Changed

Filename Overview
apps/infra/Pulumi.prod.yaml Adds new infra:airtableAutomationToken encrypted secret; old infra:certificateCreationToken entry remains (intentional — to be removed in follow-up PR)
apps/infra/src/k8s/secrets.ts Adds airtableAutomationToken to toK8s, removes certificateCreationToken; envVarSources is derived from this array so the downstream references are valid
apps/infra/src/k8s/serviceDefinitions.ts Replaces CERTIFICATE_CREATION_TOKEN / certificateCreationToken env var injection with AIRTABLE_AUTOMATION_TOKEN / airtableAutomationToken in both staging and prod service definitions
apps/website/src/lib/api/env.ts Renames CERTIFICATE_CREATION_TOKEN to AIRTABLE_AUTOMATION_TOKEN in the optional env var list; no functional change
apps/website/src/lib/api/utils.ts Updates verifyPublicToken to read from AIRTABLE_AUTOMATION_TOKEN; timing-safe comparison logic is unchanged
apps/website/src/lib/api/utils.test.ts Test updated to temporarily clear and restore AIRTABLE_AUTOMATION_TOKEN instead of the old name; logic is identical
apps/website/src/server/routers/certificates.test.ts Mocked env object updated to use AIRTABLE_AUTOMATION_TOKEN; no logic changes
apps/website/.env.test Test env file updated to use AIRTABLE_AUTOMATION_TOKEN=test-token-secret

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Airtable Automation] -->|HTTP request + token| B[tRPC Endpoint]
    B --> C[verifyPublicToken]
    C --> D{AIRTABLE_AUTOMATION_TOKEN\nconfigured?}
    D -- No --> E[INTERNAL_SERVER_ERROR]
    D -- Yes --> F{timingSafeEqual\npublicToken == secret?}
    F -- No --> G[UNAUTHORIZED]
    F -- Yes --> H[Proceed with handler]

    subgraph Infra
        I[Pulumi.prod.yaml\nairtableAutomationToken] -->|config.requireSecret| J[K8s Secret\nairtableautomationtoken-secret]
        J -->|envVarSources| K[Pod env var\nAIRTABLE_AUTOMATION_TOKEN]
    end

    K --> C
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[Airtable Automation] -->|HTTP request + token| B[tRPC Endpoint]
    B --> C[verifyPublicToken]
    C --> D{AIRTABLE_AUTOMATION_TOKEN\nconfigured?}
    D -- No --> E[INTERNAL_SERVER_ERROR]
    D -- Yes --> F{timingSafeEqual\npublicToken == secret?}
    F -- No --> G[UNAUTHORIZED]
    F -- Yes --> H[Proceed with handler]

    subgraph Infra
        I[Pulumi.prod.yaml\nairtableAutomationToken] -->|config.requireSecret| J[K8s Secret\nairtableautomationtoken-secret]
        J -->|envVarSources| K[Pod env var\nAIRTABLE_AUTOMATION_TOKEN]
    end

    K --> C
Loading

Reviews (1): Last reviewed commit: "Update Pulumi with new secret" | Re-trigger Greptile

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/infra/Pulumi.prod.yaml`:
- Around line 57-58: Remove the superseded infra:airtableAutomationToken entry
from the Pulumi production configuration, while preserving
infra:certificateCreationToken and all other settings. Only retain the old
secret if a documented migration-retention requirement applies.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 767c9c12-f0ce-42fb-aefd-cc66cae88c66

📥 Commits

Reviewing files that changed from the base of the PR and between 6e7c6b1 and 13c834f.

📒 Files selected for processing (8)
  • apps/infra/Pulumi.prod.yaml
  • apps/infra/src/k8s/secrets.ts
  • apps/infra/src/k8s/serviceDefinitions.ts
  • apps/website/.env.test
  • apps/website/src/lib/api/env.ts
  • apps/website/src/lib/api/utils.test.ts
  • apps/website/src/lib/api/utils.ts
  • apps/website/src/server/routers/certificates.test.ts

Comment on lines +57 to +58
infra:airtableAutomationToken:
secure: v1:6tP/YKX2E+Gb4R26:Wrz1cPwU10jp4aydNBZG89RZRHcKEhUkDHlh+XiYebdh69+RWWRaaZpBrdlSD4O1

@coderabbitai coderabbitai Bot Jul 20, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win

Remove the superseded Pulumi secret entry.

Adding infra:airtableAutomationToken while retaining infra:certificateCreationToken at Lines 31-32 leaves the old credential stored in Pulumi configuration. Delete the obsolete entry, unless a documented migration-retention window is required.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/infra/Pulumi.prod.yaml` around lines 57 - 58, Remove the superseded
infra:airtableAutomationToken entry from the Pulumi production configuration,
while preserving infra:certificateCreationToken and all other settings. Only
retain the old secret if a documented migration-retention requirement applies.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doing as a follow-up task

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joshestein, acknowledged—this can remain as a follow-up. Would you like me to open a GitHub issue to track removal of infra:certificateCreationToken after the migration?

@joshestein
joshestein merged commit cc3cd0e into master Jul 20, 2026
14 checks passed
@joshestein
joshestein deleted the josh/2808-rename-shared-airtable-secret branch July 20, 2026 13:29
joshestein added a commit that referenced this pull request Jul 20, 2026
…et (#2814)

Follow-up to #2813, which renamed the shared Airtable-automation secret
to airtableAutomationToken. All code now references the new secret; the
old certificateCreationToken value is unused and safe to delete.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rename CERTIFICATE_CREATION_TOKEN -> AIRTABLE_AUTOMATION_TOKEN

2 participants