adding information about the unsafe endpoints.

Dashboard locations should be added to settings table.
This commit is contained in:
Jason Kulatunga 2023-08-21 17:20:17 -07:00
parent 97f15d52b3
commit 3db12ee4b8
No known key found for this signature in database
3 changed files with 22 additions and 0 deletions

View File

@ -24,6 +24,9 @@ func (c *configuration) Init() error {
c.SetDefault("web.listen.port", "8080")
c.SetDefault("web.listen.host", "0.0.0.0")
c.SetDefault("web.listen.basepath", "")
// allow unsafe endpoints should never be enabled in Production.
// It enables direct API access to healthcare providers without authentication.
c.SetDefault("web.allow_unsafe_endpoints", false)
c.SetDefault("web.src.frontend.path", "/opt/fasten/web")

View File

@ -29,6 +29,15 @@ func GetDashboard(c *gin.Context) {
if dashboardLocations := appConfig.GetStringSlice("dashboard.location"); dashboardLocations != nil && len(dashboardLocations) > 0 {
logger.Infof("Loading dashboard(s) from %v", dashboardLocations)
// TODO: these should be populated from the user settings table (each user can have their own dashboards).
// TODO: when enabled, used the following algorithm:
//- validate that the url is to a github gist, no other locations are supported
//- download the gist metadata
//- if more than 1 file found, look for a dashboard.json
//- check if the file sha exists on the file system (content-addressible file system)
//- if it doesnt,
for _, dashboardLocation := range dashboardLocations {
if strings.HasPrefix(dashboardLocation, "http") {
c.JSON(http.StatusOK, gin.H{"success": false, "error": fmt.Sprintf("Remote Dashboard URL's are not supported yet: %v", dashboardLocations)})

View File

@ -121,6 +121,16 @@
<h6>About this Source</h6>
<p >{{modalSelectedSourceListItem?.metadata?.patient_access_description}}</p>
</ng-container>
<ng-container *ngIf="modalSelectedSourceListItem?.metadata.aliases?.length > 0">
<h6>Aliases</h6>
<ul>
<li *ngFor="let alias of modalSelectedSourceListItem?.metadata?.aliases">{{alias}}</li>
</ul>
</ng-container>
<ng-container *ngIf="modalSelectedSourceListItem?.metadata.platform_type">
<h6>Platform Type</h6>
<p>{{modalSelectedSourceListItem?.metadata.platform_type}}</p>
</ng-container>
<ng-container *ngIf="modalSelectedSourceListItem?.metadata?.category?.length > 0">
<h6>Categories</h6>
<ul>