Skip to content

Commit

Permalink
adding information about the unsafe endpoints.
Browse files Browse the repository at this point in the history
Dashboard locations should be added to settings table.
  • Loading branch information
AnalogJ committed Aug 22, 2023
1 parent 97f15d5 commit 3db12ee
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
3 changes: 3 additions & 0 deletions backend/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
9 changes: 9 additions & 0 deletions backend/pkg/web/handler/dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,16 @@ <h6>Connect Source</h6>
<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>
Expand Down

0 comments on commit 3db12ee

Please sign in to comment.