Skip to content

Conversation

@capcom6
Copy link
Member

@capcom6 capcom6 commented Aug 13, 2025

Summary by CodeRabbit

  • New Features

    • Added validation that prevents users from setting an encryption passphrase or webhook signing key when using Cloud Server, giving immediate feedback if attempted.
  • Documentation

    • Clarified docs and comments to state that encryption passphrases and webhook signing keys are not supported on Cloud Server.

@codecov
Copy link

codecov bot commented Aug 13, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
smsgateway/domain_settings.go 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@coderabbitai
Copy link

coderabbitai bot commented Aug 13, 2025

Walkthrough

Added validation tags and updated comments for two fields in smsgateway/domain_settings.go. SettingsEncryption.Passphrase and SettingsWebhooks.SigningKey now include validate:"omitempty,isdefault" and comments noting they must not be used with Cloud Server. No data type or control flow changes.

Changes

Cohort / File(s) Summary
Validation tag additions and comment updates
smsgateway/domain_settings.go
Added validate:"omitempty,isdefault" to SettingsEncryption.Passphrase and SettingsWebhooks.SigningKey; updated comments to state these fields are disallowed with Cloud Server. No type or structural changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 83f1755 and f8134e7.

📒 Files selected for processing (1)
  • smsgateway/domain_settings.go (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • smsgateway/domain_settings.go
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch client/restrict-cloud-sensitive-settings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

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

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4d2394e and 83f1755.

📒 Files selected for processing (1)
  • smsgateway/domain_settings.go (2 hunks)
🔇 Additional comments (1)
smsgateway/domain_settings.go (1)

121-123: Refine SigningKey comment for clarity and confirm Cloud‐only usage

The validate:"omitempty,isdefault" tag on *string forces SigningKey to be nil (an empty string still fails), which aligns with “must not be used with Cloud Server.” Let’s update the comment to be more precise and ensure this restriction only applies in Cloud builds.

• File: smsgateway/domain_settings.go
Lines: 121–122

- // SigningKey is the secret key used for signing webhook payloads. Must not be used with Cloud Server.
+ // SigningKey is the secret used to sign webhook payloads.
+ // Cloud Server: must be omitted (nil). Self-hosted: optional.

If this struct (and its validation) is shared by both Cloud and self-hosted flows, please confirm or consider one of:

  • Splitting into separate Cloud vs. self-hosted DTOs
  • Registering a custom forbidden validator tag only in Cloud builds
  • Using Go build tags to apply Cloud-only validations

Let me know once you’ve verified that this change won’t break self-hosted usage.

@capcom6 capcom6 force-pushed the client/restrict-cloud-sensitive-settings branch from 83f1755 to f8134e7 Compare August 13, 2025 10:55
@capcom6 capcom6 merged commit 84b2c1d into master Aug 13, 2025
7 checks passed
@capcom6 capcom6 deleted the client/restrict-cloud-sensitive-settings branch August 13, 2025 23:17
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.

2 participants