Skip to content

[config] validate gateway mode - #277

Open
capcom6 wants to merge 2 commits into
masterfrom
config/validate-gateway-mode
Open

capcom6 wants to merge 2 commits into
masterfrom
config/validate-gateway-mode

Conversation

@capcom6

@capcom6 capcom6 commented Sep 21, 2026

Copy link
Copy Markdown
Member

RetriggerConfidence Score: 5/5

The PR appears safe to merge; invalid and explicitly empty gateway modes now fail startup instead of producing inconsistent behavior.

Summary

Validates gateway.mode while constructing push configuration so only public and private are accepted and invalid values fail startup.

  • Maps public mode to FCM and private mode to the upstream push provider.
  • Adds a reusable invalid-configuration sentinel error.
  • Documents the gateway-mode validation and updates example environment settings.
  • The prior empty-mode finding is resolved because the default switch branch now rejects empty values.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Load gateway mode] --> B{Mode}
    B -->|public| C[Use FCM push]
    B -->|private| D[Use upstream push]
    B -->|empty or unsupported| E[Return invalid config error]
    E --> F[Fail application startup]
Loading

Reviews (4) · Last reviewed commit: "[docs] cleanup readme"

Comment thread internal/config/module.go Outdated
@github-actions

github-actions Bot commented Sep 21, 2026

Copy link
Copy Markdown

🤖 Pull request artifacts

Platform File
🐳 Docker GitHub Container Registry
🍎 Darwin arm64 server_Darwin_arm64.tar.gz
🍎 Darwin x86_64 server_Darwin_x86_64.tar.gz
🐧 Linux arm64 server_Linux_arm64.tar.gz
🐧 Linux i386 server_Linux_i386.tar.gz
🐧 Linux x86_64 server_Linux_x86_64.tar.gz
🪟 Windows arm64 server_Windows_arm64.zip
🪟 Windows i386 server_Windows_i386.zip
🪟 Windows x86_64 server_Windows_x86_64.zip

@capcom6
capcom6 force-pushed the config/validate-gateway-mode branch from 7eb2f00 to 2fbc877 Compare September 23, 2026 04:24

This branch has not been deployed

No deployments
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.

1 participant