Skip to content

Commit

Permalink
Merge pull request #23 from delta10/feat/add-allow-always
Browse files Browse the repository at this point in the history
feat: add allowAlways setting for plain proxy capability
  • Loading branch information
bartjkdp authored Nov 21, 2023
2 parents 3d08750 + 45f5578 commit 7dc15b4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/filter-proxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,10 @@ func main() {
}

func authorizeRequestWithService(config *config.Config, path config.Path, r *http.Request) (int, *AuthorizationResponse) {
if path.AllowAlways {
return http.StatusOK, nil
}

if config.AuthorizationServiceURL == "" {
log.Print("returned unauthenticated as there is no authorization service URL configured.")
return http.StatusInternalServerError, nil
Expand Down
1 change: 1 addition & 0 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type Backend struct {
type Path struct {
Path string `yaml:"path"`
AllowedMethods []string `yaml:"allowedMethods"`
AllowAlways bool `yaml:"allowAlways"`
Backend struct {
Slug string `yaml:"slug"`
Path string `yaml:"path"`
Expand Down

0 comments on commit 7dc15b4

Please sign in to comment.