Skip to content

Commit

Permalink
Merge branch 'release/1.10.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
daiLlew committed Sep 22, 2020
2 parents f912017 + 5baa926 commit c2e75ee
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion middleware/audit.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"context"
"io"
"net/http"
"strings"
"time"

"github.com/ONSdigital/dp-api-clients-go/headers"
Expand All @@ -20,17 +21,19 @@ import (
var pathsToIgnore = []string{
"/ping",
"/clickEventLog",
"/health",
}

// paths that will skip retrieveIdentity, and will be audited without identity
var pathsSkipIdentity = []string{
"/login",
"/password",
"/v1/hierarchies",
}

func shallSkipIdentity(path string) bool {
for _, pathSkipIdentity := range pathsSkipIdentity {
if path == pathSkipIdentity {
if strings.HasPrefix(path, pathSkipIdentity) {
return true
}
}
Expand Down

0 comments on commit c2e75ee

Please sign in to comment.