Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion Core/Resgrid.Config/RecordsConnectorConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ namespace Resgrid.Config
/// switch is on and a credential passphrase is set: a connector holds an outbound credential encrypted under
/// the passphrase, so without one no connector can be created. Environment keys:
/// RESGRID:RecordsConnectorConfig:Enabled, :CredentialPassphrase, :TimeoutSeconds, :MaxFeedBytes,
/// :MinPollIntervalMinutes, :DefaultMaxRequestsPerHour, :AllowHttp.
/// :MinPollIntervalMinutes, :DefaultMaxRequestsPerHour, :AllowHttp, :AllowedFeedHosts,
/// :AllowPrivateNetworkFeeds.
/// </summary>
public static class RecordsConnectorConfig
{
Expand All @@ -28,6 +29,20 @@ public static class RecordsConnectorConfig
/// <summary>http feed roots are refused unless this is on (local development only).</summary>
public static bool AllowHttp = false;

/// <summary>
/// Hosts a connector may be pointed at, comma separated. A leading dot matches the domain and its
/// subdomains ("example.org, .ciffc.ca"). Empty allows any public host: the address checks below still
/// apply, so an empty list is not the same as no restriction.
/// </summary>
public static string AllowedFeedHosts = "";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

kody code-review Kody Rules high

Mutable configuration state in Core/Resgrid.Config/RecordsConnectorConfig.cs: AllowedFeedHosts appears to be configuration metadata initialized once but remains reassignable. Mark it readonly to communicate immutability and prevent accidental mutation.

Kody rule violation: Use `readonly` or `const` for Immutable Data

public static readonly string AllowedFeedHosts = string.Empty;
Prompt for LLM

File Core/Resgrid.Config/RecordsConnectorConfig.cs:

Line 37:

Mutable configuration state in Core/Resgrid.Config/RecordsConnectorConfig.cs: AllowedFeedHosts appears to be configuration metadata initialized once but remains reassignable. Mark it readonly to communicate immutability and prevent accidental mutation.

Suggested Code:

public static readonly string AllowedFeedHosts = string.Empty;

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.


/// <summary>
/// Whether a connector may address a loopback, link-local, private or otherwise internal address. Off in
/// every deployment: without it a department administrator can aim a connector at services the worker can
/// reach and read the answer back. On only for local development against a feed on the same machine.
/// </summary>
public static bool AllowPrivateNetworkFeeds = false;

/// <summary>Consecutive failures after which a connector is switched off until an administrator looks.</summary>
public static int DisableAfterConsecutiveFailures = 10;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -483,4 +483,10 @@
<data name="EditContact" xml:space="preserve">
<value>تعديل جهة الاتصال</value>
</data>
<data name="PreplanRecordsOwnedNotice" xml:space="preserve">
<value>أصبحت الخطط المسبقة لهذه الإدارة تُدار الآن كمبانٍ في السجلات. هذه الصفحة للقراءة فقط؛ عدّل المبنى من السجلات.</value>
</data>
<data name="PreplanOpenOccupancy" xml:space="preserve">
<value>فتح المبنى</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -434,4 +434,10 @@
<data name="EditContact" xml:space="preserve">
<value>Edit Contact</value>
</data>
<data name="PreplanRecordsOwnedNotice" xml:space="preserve">
<value>Einsatzpläne dieser Organisation werden jetzt als Objekte in den Berichten gepflegt. Diese Seite ist schreibgeschützt; bearbeiten Sie das Objekt unter Berichte.</value>
</data>
<data name="PreplanOpenOccupancy" xml:space="preserve">
<value>Objekt öffnen</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -504,4 +504,10 @@
<data name="PriorityOptional" xml:space="preserve">
<value>Προαιρετική</value>
</data>
<data name="PreplanRecordsOwnedNotice" xml:space="preserve">
<value>Τα προσχέδια αυτής της υπηρεσίας διατηρούνται πλέον ως κτίρια στα Αρχεία. Η σελίδα είναι μόνο για ανάγνωση· επεξεργαστείτε το κτίριο στα Αρχεία.</value>
</data>
<data name="PreplanOpenOccupancy" xml:space="preserve">
<value>Άνοιγμα κτιρίου</value>
</data>
</root>
251 changes: 250 additions & 1 deletion Core/Resgrid.Localization/Areas/User/Contacts/Contacts.en.resx
Original file line number Diff line number Diff line change
Expand Up @@ -504,4 +504,253 @@
<data name="PriorityOptional" xml:space="preserve">
<value>Optional</value>
</data>
</root>
<data name="PreplanTitle" xml:space="preserve">
<value>Pre-Incident Plan</value>
</data>
<data name="PreplanTab" xml:space="preserve">
<value>Pre-Plan</value>
</data>
<data name="SiteFiles" xml:space="preserve">
<value>Site Files</value>
</data>
<data name="ManageFiles" xml:space="preserve">
<value>Manage Files</value>
</data>
<data name="PreplanOccupancySection" xml:space="preserve">
<value>Construction &amp; Occupancy</value>
</data>
<data name="ConstructionType" xml:space="preserve">
<value>Construction Type</value>
</data>
<data name="RoofType" xml:space="preserve">
<value>Roof Type</value>
</data>
<data name="OccupancyType" xml:space="preserve">
<value>Occupancy Type</value>
</data>
<data name="OccupancyHours" xml:space="preserve">
<value>Hours of Occupancy</value>
</data>
<data name="OccupancyHoursPlaceholder" xml:space="preserve">
<value>e.g. Mon-Fri 08:00-17:00, staffed overnight</value>
</data>
<data name="OccupantLoad" xml:space="preserve">
<value>Occupant Load</value>
</data>
<data name="OccupantsNeedingAssistance" xml:space="preserve">
<value>Occupants Needing Assistance</value>
</data>
<data name="OccupantsNeedingAssistanceYes" xml:space="preserve">
<value>Occupants on site may need evacuation assistance</value>
</data>
<data name="OccupantsNeedingAssistanceNotes" xml:space="preserve">
<value>Who, where and what assistance is needed</value>
</data>
<data name="OccupancyNotes" xml:space="preserve">
<value>Occupancy Notes</value>
</data>
<data name="PreplanUtilitiesSection" xml:space="preserve">
<value>Utility Shutoffs</value>
</data>
<data name="GasShutoff" xml:space="preserve">
<value>Gas Shutoff</value>
</data>
<data name="ElectricShutoff" xml:space="preserve">
<value>Electric Shutoff</value>
</data>
<data name="WaterShutoff" xml:space="preserve">
<value>Water Shutoff</value>
</data>
<data name="UtilityNotes" xml:space="preserve">
<value>Utility Notes</value>
</data>
<data name="PreplanWaterSection" xml:space="preserve">
<value>Water Supply</value>
</data>
<data name="NearestHydrant" xml:space="preserve">
<value>Nearest Hydrant</value>
</data>
<data name="RequiredFireFlow" xml:space="preserve">
<value>Required Fire Flow (GPM)</value>
</data>
<data name="WaterSupplyNotes" xml:space="preserve">
<value>Water Supply Notes</value>
</data>
<data name="PreplanAccessSection" xml:space="preserve">
<value>Access</value>
</data>
<data name="KnoxBox" xml:space="preserve">
<value>Knox Box Location</value>
</data>
<data name="GateCode" xml:space="preserve">
<value>Gate Code</value>
</data>
<data name="GateCodeInfo" xml:space="preserve">
<value>Stored encrypted. Shown to members who can view this contact and to responders on linked calls.</value>
</data>
<data name="AlarmPanel" xml:space="preserve">
<value>Alarm Panel Location</value>
</data>
<data name="AlarmCompany" xml:space="preserve">
<value>Alarm Company</value>
</data>
<data name="Phone" xml:space="preserve">
<value>Phone</value>
</data>
<data name="AccessNotes" xml:space="preserve">
<value>Access Notes</value>
</data>
<data name="PreplanContactsSection" xml:space="preserve">
<value>On-Site Contacts</value>
</data>
<data name="EmergencyContact" xml:space="preserve">
<value>Emergency Contact</value>
</data>
<data name="SecondaryContact" xml:space="preserve">
<value>Secondary Contact</value>
</data>
<data name="PreplanTacticalSection" xml:space="preserve">
<value>Hazards &amp; Tactics</value>
</data>
<data name="HazmatOnSite" xml:space="preserve">
<value>Hazmat On Site</value>
</data>
<data name="HazmatOnSiteYes" xml:space="preserve">
<value>Hazardous materials are stored or used on site</value>
</data>
<data name="GeneralHazardNotes" xml:space="preserve">
<value>General Hazard Notes</value>
</data>
<data name="TacticalSummary" xml:space="preserve">
<value>Tactical Summary</value>
</data>
<data name="PreplanReviewSection" xml:space="preserve">
<value>Review Cycle</value>
</data>
<data name="LastReviewed" xml:space="preserve">
<value>Last Reviewed</value>
</data>
<data name="NeverReviewed" xml:space="preserve">
<value>Never reviewed</value>
</data>
<data name="MarkReviewedNow" xml:space="preserve">
<value>Mark this pre-plan as reviewed now</value>
</data>
<data name="NextReviewDue" xml:space="preserve">
<value>Next Review Due</value>
</data>
<data name="SavePreplan" xml:space="preserve">
<value>Save Pre-Plan</value>
</data>
<data name="PremiseHazards" xml:space="preserve">
<value>Premise Hazards</value>
</data>
<data name="PremiseHazardsInfo" xml:space="preserve">
<value>Typed hazards with a severity. Hazards marked as alerts are shown to dispatchers when this contact is added to a call.</value>
</data>
<data name="AddHazard" xml:space="preserve">
<value>Add Hazard</value>
</data>
<data name="EditHazard" xml:space="preserve">
<value>Edit Hazard</value>
</data>
<data name="SaveHazard" xml:space="preserve">
<value>Save Hazard</value>
</data>
<data name="DeleteHazardConfirm" xml:space="preserve">
<value>Remove this hazard?</value>
</data>
<data name="HazardSaveError" xml:space="preserve">
<value>The hazard could not be saved.</value>
</data>
<data name="HazardTitleRequired" xml:space="preserve">
<value>A hazard needs a title.</value>
</data>
<data name="HazardShouldAlert" xml:space="preserve">
<value>Alert dispatchers when this contact is added to a call</value>
</data>
<data name="Severity" xml:space="preserve">
<value>Severity</value>
</data>
<data name="Title" xml:space="preserve">
<value>Title</value>
</data>
<data name="Location" xml:space="preserve">
<value>Location</value>
</data>
<data name="Alert" xml:space="preserve">
<value>Alert</value>
</data>
<data name="NoHazards" xml:space="preserve">
<value>No premise hazards recorded.</value>
</data>
<data name="GpsCoordinates" xml:space="preserve">
<value>GPS Coordinates</value>
</data>
<data name="PreplanReviewOverdue" xml:space="preserve">
<value>The pre-plan review date has passed.</value>
</data>
<data name="PreplanReviewDue" xml:space="preserve">
<value>Pre-Plan Review Due</value>
</data>
<data name="PreplanRecordsOwnedNotice" xml:space="preserve">
<value>Pre-plans for this department are now maintained as Records occupancies. This page is read-only; edit the occupancy under Records.</value>
</data>
<data name="PreplanOpenOccupancy" xml:space="preserve">
<value>Open occupancy</value>
</data>
<data name="CreatePreplan" xml:space="preserve">
<value>Create Pre-Plan</value>
</data>
<data name="EditPreplan" xml:space="preserve">
<value>Edit Pre-Plan</value>
</data>
<data name="NoPreplan" xml:space="preserve">
<value>No pre-incident plan has been recorded for this contact.</value>
</data>
<data name="NoFiles" xml:space="preserve">
<value>No files have been attached to this contact.</value>
</data>
<data name="UploadFile" xml:space="preserve">
<value>Upload File</value>
</data>
<data name="UploadFileInfo" xml:space="preserve">
<value>Images, PDF, Office documents, text, CSV, DWG or DXF up to 30MB.</value>
</data>
<data name="FileType" xml:space="preserve">
<value>File Type</value>
</data>
<data name="FileTitle" xml:space="preserve">
<value>Title</value>
</data>
<data name="FileTitlePlaceholder" xml:space="preserve">
<value>Optional title (defaults to the file name)</value>
</data>
<data name="FileName" xml:space="preserve">
<value>File Name</value>
</data>
<data name="Upload" xml:space="preserve">
<value>Upload</value>
</data>
<data name="DeleteFileConfirm" xml:space="preserve">
<value>Remove this file?</value>
</data>
<data name="Download" xml:space="preserve">
<value>Download</value>
</data>
<data name="Size" xml:space="preserve">
<value>Size</value>
</data>
<data name="AddedOn" xml:space="preserve">
<value>Added On</value>
</data>
<data name="No" xml:space="preserve">
<value>No</value>
</data>
<data name="Calls" xml:space="preserve">
<value>Calls</value>
</data>
<data name="Notes" xml:space="preserve">
<value>Notes</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -434,4 +434,10 @@
<data name="EditContact" xml:space="preserve">
<value>Editar contacto</value>
</data>
<data name="PreplanRecordsOwnedNotice" xml:space="preserve">
<value>Los planes previos de este departamento ahora se mantienen como ocupaciones en Registros. Esta página es de solo lectura; edite la ocupación en Registros.</value>
</data>
<data name="PreplanOpenOccupancy" xml:space="preserve">
<value>Abrir ocupación</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -434,4 +434,10 @@
<data name="EditContact" xml:space="preserve">
<value>Edit Contact</value>
</data>
<data name="PreplanRecordsOwnedNotice" xml:space="preserve">
<value>Les plans d'intervention de ce service sont désormais gérés comme des occupations dans les Dossiers. Cette page est en lecture seule ; modifiez l'occupation dans les Dossiers.</value>
</data>
<data name="PreplanOpenOccupancy" xml:space="preserve">
<value>Ouvrir l'occupation</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -434,4 +434,10 @@
<data name="EditContact" xml:space="preserve">
<value>Edit Contact</value>
</data>
<data name="PreplanRecordsOwnedNotice" xml:space="preserve">
<value>I piani preventivi di questo dipartimento sono ora gestiti come occupazioni nei Registri. Questa pagina è di sola lettura; modifica l'occupazione nei Registri.</value>
</data>
<data name="PreplanOpenOccupancy" xml:space="preserve">
<value>Apri occupazione</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -434,4 +434,10 @@
<data name="EditContact" xml:space="preserve">
<value>Edit Contact</value>
</data>
<data name="PreplanRecordsOwnedNotice" xml:space="preserve">
<value>Plany operacyjne tej jednostki są teraz prowadzone jako obiekty w Rejestrach. Ta strona jest tylko do odczytu; edytuj obiekt w Rejestrach.</value>
</data>
<data name="PreplanOpenOccupancy" xml:space="preserve">
<value>Otwórz obiekt</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -434,4 +434,10 @@
<data name="EditContact" xml:space="preserve">
<value>Edit Contact</value>
</data>
<data name="PreplanRecordsOwnedNotice" xml:space="preserve">
<value>Insatsplaner för den här organisationen underhålls nu som objekt i Register. Sidan är skrivskyddad; redigera objektet under Register.</value>
</data>
<data name="PreplanOpenOccupancy" xml:space="preserve">
<value>Öppna objekt</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -434,4 +434,10 @@
<data name="EditContact" xml:space="preserve">
<value>Edit Contact</value>
</data>
<data name="PreplanRecordsOwnedNotice" xml:space="preserve">
<value>Плани реагування цього підрозділу тепер ведуться як об'єкти в Записах. Ця сторінка лише для читання; редагуйте об'єкт у Записах.</value>
</data>
<data name="PreplanOpenOccupancy" xml:space="preserve">
<value>Відкрити об'єкт</value>
</data>
</root>
Loading
Loading