Skip to content

Conversation

@michaelbarnes
Copy link
Contributor

Summary
Updates the CloudCode for MongoDB doc to match the current template, add a full static IP setup flow, and improve production/auth sections.

Changes

  • Static IP Addresses (MongoDB Atlas)
    New section that walks through:

    • Converting the MongoDB SRV record to replica connection URIs with @journeyapps/https-proxy-socket.
    • Requesting an egress token from PowerSync support (what to include: replicas URI, Oxide Project URL, and multi-deployment/region details when needed).
    • Configuring allowed IPs in MongoDB Atlas (Database & Network Access → IP Access List).
    • Updating the upload CloudCode task to use the proxy helper, including:
      • Note for the latest template (uncomment proxy snippets and set CLOUDCODE_EGRESS_TOKEN).
      • Steps for older templates: add @journeyapps/https-proxy-socket, update MongoDBStorage and closeConnection as shown.
    • A reference table of static IPs by Region (EU/US) and Group (A/B/C) for use when requesting the egress token and configuring Atlas.
  • Production considerations

    • New HTTP Endpoint Authentication subsection: default behavior vs production, plus full authenticate examples using jsonwebtoken (secret) and jose (JWKS).
    • Other considerations tightened around schema validation and MongoDB Schema Validation.
  • Template and wording

    • Aligned steps and code with the current CloudCode task template.
    • Consistently use “group” (instead of “zone”) for the static IP groups provided by support.
    • Minor heading and example tweaks from the refactor pass.
  • Fix

    • Resolved MDX parse error caused by <uri_1,uri_2,etc.> being interpreted as JSX by escaping/wrapping in code.

… template and clearer instructions which IP addresses to use based on the group that's configured by the support team
@michaelbarnes
Copy link
Contributor Author

This PR is pending a merge of the updated CloudCode CRUD & Auth template CC task. Once that's done I'll change the PR status.

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