Compare commits

2 Commits

Author SHA1 Message Date
5cad97c9ac Move more constant texts in a constant string 2024-09-10 20:20:45 -07:00
cc61b02959 Update README for extensbility hints. 2024-02-27 21:14:37 -08:00
2 changed files with 11 additions and 7 deletions

View File

@@ -9,6 +9,8 @@ namespace AS1024.GeoFeed.Core.WebLogic
public class GeoFeedReturn public class GeoFeedReturn
{ {
private const string GeoFeedCacheKey = "GeoFeedData"; private const string GeoFeedCacheKey = "GeoFeedData";
private const string GeoFeedMimeTypeReturn = "text/csv";
private const string GeoFeedFileName = "geofeed.csv";
private readonly IGeoFeedProvider provider; private readonly IGeoFeedProvider provider;
private readonly ILogger<GeoFeedReturn> logger; private readonly ILogger<GeoFeedReturn> logger;
private readonly IGeoFeedPersistentCacheProvider cacheProvider; private readonly IGeoFeedPersistentCacheProvider cacheProvider;
@@ -46,8 +48,8 @@ namespace AS1024.GeoFeed.Core.WebLogic
} }
return Results.File(Encoding.UTF8.GetBytes(feed.ToGeoFeedCsv(true, isCached)), return Results.File(Encoding.UTF8.GetBytes(feed.ToGeoFeedCsv(true, isCached)),
"text/csv", GeoFeedMimeTypeReturn,
"geofeed.csv"); GeoFeedFileName);
} }
catch (HttpRequestException ex) catch (HttpRequestException ex)
@@ -56,8 +58,8 @@ namespace AS1024.GeoFeed.Core.WebLogic
string geoFeedData = cacheProvider.GetGeoFeed(); string geoFeedData = cacheProvider.GetGeoFeed();
return Results.File(Encoding.UTF8.GetBytes(geoFeedData), return Results.File(Encoding.UTF8.GetBytes(geoFeedData),
"text/csv", GeoFeedMimeTypeReturn,
"geofeed.csv"); GeoFeedFileName);
} }
catch (Exception ex) catch (Exception ex)
{ {

View File

@@ -107,8 +107,10 @@ The application provides the following key endpoints:
## Security and Compliance ## Security and Compliance
This application is designed to always communicate over HTTPS with NetBox, ensuring that the data transfer is encrypted and secure. This application is designed to always communicate over HTTPS with NetBox, ensuring that the data transfer is encrypted and secure.
--- ## Extending Beyond NetBox
For more information about configuring and using this application, please refer to the official .NET documentation and the NetBox API guide. If your current IPAM solution is not netbox and wish to extend this web application to use the desired IPAM solution of choice, the interface `IGeoFeedProvider` is available for extensibility. To use your custom IPAM backend ensure that `NetboxAoTGeoFeedProvider` and `NetboxGeoFeedProvider` are not registered in the dependency injection container in the Web Apps. Once unregistered, register your custom IPAM communication backend provider to your needs and the web app should work in both AOT and MVC mode.
Currently the Minimal API implementation of this web application only supports code that does not require reflection. This is a known limitation of native AOT deployments. If your code utilizes reflection or is not properly adapted for source generation, the minimal API version will **not work**.