Skip to content

Commit

Permalink
URLSpec status now before key check, purge delay of 0 will stop analy…
Browse files Browse the repository at this point in the history
…tics purge and raise warning (ref: alexwhitman/disable-purge) TODO: update master.
  • Loading branch information
Martin Buhr committed Nov 4, 2014
1 parent e7dcb47 commit d7b0806
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Changes v1.1.1
==============

- Path allowances (Ignored / Blacklist / Whitelist) on a version will now happen before an auth check, meaning ignored paths will allow anyone through
- Setting purge_delay to 0 will cause the service to not ever purge the redis DB of analytics data - handy for tyk clusters that only require one node to do the purging
12 changes: 8 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const (
// Display introductory details
func intro() {
fmt.Print("\n\n")
fmt.Println(goterm.Bold(goterm.Color("Tyk.io Gateway API v1.0", goterm.GREEN)))
fmt.Println(goterm.Bold(goterm.Color("Tyk.io Gateway API v1.1.1", goterm.GREEN)))
fmt.Println(goterm.Bold(goterm.Color("=======================", goterm.GREEN)))
fmt.Print("Copyright Jively Ltd. 2014")
fmt.Print("\nhttp://www.tyk.io\n\n")
Expand Down Expand Up @@ -88,7 +88,11 @@ func setupGlobals() {
}

analytics.Store.Connect()
go analytics.Clean.StartPurgeLoop(config.AnalyticsConfig.PurgeDelay)
if config.AnalyticsConfig.PurgeDelay >= 0 {
go analytics.Clean.StartPurgeLoop(config.AnalyticsConfig.PurgeDelay)
} else {
log.Warn("Cache purge turned off, you are responsible for Redis storage maintenance.")
}
}

genericOsinStorage = MakeNewOsinServer()
Expand Down Expand Up @@ -208,9 +212,9 @@ func loadApps(APISpecs []APISpec, Muxer *http.ServeMux) {

// Use CreateMiddleware(&ModifiedMiddleware{tykMiddleware}, tykMiddleware) to run custom middleware
chain := alice.New(
CreateMiddleware(&VersionCheck{tykMiddleware}, tykMiddleware),
keyCheck,
CreateMiddleware(&KeyExpired{tykMiddleware}, tykMiddleware),
CreateMiddleware(&VersionCheck{tykMiddleware}, tykMiddleware),
CreateMiddleware(&AccessRightsCheck{tykMiddleware}, tykMiddleware),
CreateMiddleware(&RateLimitAndQuotaCheck{tykMiddleware}, tykMiddleware)).Then(proxyHandler)

Expand Down Expand Up @@ -250,7 +254,7 @@ func init() {
`

arguments, err := docopt.Parse(usage, nil, true, "v1.0", false)
arguments, err := docopt.Parse(usage, nil, true, "v1.1.1", false)
if err != nil {
log.Println("Error while parsing arguments.")
log.Fatal(err)
Expand Down

0 comments on commit d7b0806

Please sign in to comment.