Skip to content

Commit

Permalink
Merge branch 'fix/web-identity-check' into cmd-develop
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlHembrough committed Apr 6, 2018
2 parents f71d2c9 + 8453c10 commit 21dd18a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,14 @@ func CreateDatasetAPI(cfg config.Configuration, dataStore store.DataStore, urlBu
router := mux.NewRouter()
routes(cfg, router, dataStore, urlBuilder, downloadsGenerator)

alice := alice.New(identity.Handler(true, cfg.ZebedeeURL)).Then(router)
httpServer = server.New(cfg.BindAddr, alice)
// Only add the identity middleware when running in publishing.
if cfg.EnablePrivateEnpoints {
alice := alice.New(identity.Handler(true, cfg.ZebedeeURL)).Then(router)
httpServer = server.New(cfg.BindAddr, alice)
} else {
httpServer = server.New(cfg.BindAddr, router)
}

// Disable this here to allow main to manage graceful shutdown of the entire app.
httpServer.HandleOSSignals = false

Expand Down

0 comments on commit 21dd18a

Please sign in to comment.