From bdd1ca8a5d59b6ed7584bc19fb63dbcae68f7b08 Mon Sep 17 00:00:00 2001 From: hackerman <3372410+aeneasr@users.noreply.github.com> Date: Wed, 29 Jul 2020 12:07:20 +0200 Subject: [PATCH] feat: refactor decisions API and add traefik (#486) Refactors the decisions API location from `/decisions` to `/decisions/traefik`. Additionally, an endpoint `/decisions/traefik` has been added for integration with the Traefik proxy. Closes #263 BREAKING CHANGE: Please update `/decisions` to `/decisions/generic` in all applications that use the ORY Oathkeeper Decisions API. Co-authored-by: Michiel Vanderlee --- .gitignore | 3 +- .schema/api.swagger.json | 149 ++++++- api/{decision.go => decision_generic.go} | 20 +- api/decision_test.go | 168 +++++--- api/decision_traefik.go | 130 ++++++ cmd/server/server.go | 4 +- docs/docs/index.md | 8 +- driver/registry.go | 3 +- driver/registry_memory.go | 28 +- go.mod | 22 +- go.sum | 133 ++++++ internal/httpclient/client/api/api_client.go | 122 ++++-- .../client/api/decisions_parameters.go | 112 ----- .../client/api/decisions_responses.go | 400 ------------------ .../api/make_generic_decision_parameters.go | 112 +++++ .../api/make_generic_decision_responses.go | 400 ++++++++++++++++++ .../api/make_traefik_decision_parameters.go | 112 +++++ .../api/make_traefik_decision_responses.go | 400 ++++++++++++++++++ test/e2e/okclient/main.go | 2 +- 19 files changed, 1676 insertions(+), 652 deletions(-) rename api/{decision.go => decision_generic.go} (84%) create mode 100644 api/decision_traefik.go delete mode 100644 internal/httpclient/client/api/decisions_parameters.go delete mode 100644 internal/httpclient/client/api/decisions_responses.go create mode 100644 internal/httpclient/client/api/make_generic_decision_parameters.go create mode 100644 internal/httpclient/client/api/make_generic_decision_responses.go create mode 100644 internal/httpclient/client/api/make_traefik_decision_parameters.go create mode 100644 internal/httpclient/client/api/make_traefik_decision_responses.go diff --git a/.gitignore b/.gitignore index b281e6b866..a256f7d1af 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ _book node_modules/ LICENSE.txt *-packr.go -dev \ No newline at end of file +dev +.bin/ diff --git a/.schema/api.swagger.json b/.schema/api.swagger.json index 9d772fb459..7ff82a5cc3 100755 --- a/.schema/api.swagger.json +++ b/.schema/api.swagger.json @@ -78,7 +78,7 @@ } } }, - "/decisions": { + "/decisions/generic": { "get": { "description": "\u003e This endpoint works with all HTTP Methods (GET, POST, PUT, ...) and matches every path prefixed with /decision.\n\nThis endpoint mirrors the proxy capability of ORY Oathkeeper's proxy functionality but instead of forwarding the\nrequest to the upstream server, returns 200 (request should be allowed), 401 (unauthorized), or 403 (forbidden)\nstatus codes. This endpoint can be used to integrate with other API Proxies like Ambassador, Kong, Envoy, and many more.", "schemes": [ @@ -88,8 +88,151 @@ "tags": [ "api" ], - "summary": "Access Control Decision API", - "operationId": "decisions", + "summary": "Access Control Generic Decision API", + "operationId": "makeGenericDecision", + "responses": { + "200": { + "description": "An empty response" + }, + "401": { + "description": "The standard error format", + "schema": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int64" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + "message": { + "type": "string" + }, + "reason": { + "type": "string" + }, + "request": { + "type": "string" + }, + "status": { + "type": "string" + } + } + } + }, + "403": { + "description": "The standard error format", + "schema": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int64" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + "message": { + "type": "string" + }, + "reason": { + "type": "string" + }, + "request": { + "type": "string" + }, + "status": { + "type": "string" + } + } + } + }, + "404": { + "description": "The standard error format", + "schema": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int64" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + "message": { + "type": "string" + }, + "reason": { + "type": "string" + }, + "request": { + "type": "string" + }, + "status": { + "type": "string" + } + } + } + }, + "500": { + "description": "The standard error format", + "schema": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int64" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + "message": { + "type": "string" + }, + "reason": { + "type": "string" + }, + "request": { + "type": "string" + }, + "status": { + "type": "string" + } + } + } + } + } + } + }, + "/decisions/traefik": { + "get": { + "description": "This endpoint mirrors the proxy capability of ORY Oathkeeper's proxy functionality but instead of forwarding the\nrequest to the upstream server, returns 200 (request should be allowed), 401 (unauthorized), or 403 (forbidden)\nstatus codes. This endpoint can be used to integrate with the Traefik proxy.", + "schemes": [ + "http", + "https" + ], + "tags": [ + "api" + ], + "summary": "Access Control Decision Traefik API", + "operationId": "makeTraefikDecision", "responses": { "200": { "description": "An empty response" diff --git a/api/decision.go b/api/decision_generic.go similarity index 84% rename from api/decision.go rename to api/decision_generic.go index aca3dfcf31..49b7c454d4 100644 --- a/api/decision.go +++ b/api/decision_generic.go @@ -31,10 +31,10 @@ import ( ) const ( - DecisionPath = "/decisions" + DecisionPath = "/decisions/generic" ) -type decisionHandlerRegistry interface { +type decisionGenericHandlerDependencies interface { x.RegistryWriter x.RegistryLogger @@ -42,15 +42,15 @@ type decisionHandlerRegistry interface { ProxyRequestHandler() *proxy.RequestHandler } -type DecisionHandler struct { - r decisionHandlerRegistry +type DecisionGenericHandler struct { + r decisionGenericHandlerDependencies } -func NewJudgeHandler(r decisionHandlerRegistry) *DecisionHandler { - return &DecisionHandler{r: r} +func NewDecisionGenericHandler(r decisionGenericHandlerDependencies) *DecisionGenericHandler { + return &DecisionGenericHandler{r: r} } -func (h *DecisionHandler) ServeHTTP(w http.ResponseWriter, r *http.Request, next http.HandlerFunc) { +func (h *DecisionGenericHandler) ServeHTTP(w http.ResponseWriter, r *http.Request, next http.HandlerFunc) { if len(r.URL.Path) >= len(DecisionPath) && r.URL.Path[:len(DecisionPath)] == DecisionPath { r.URL.Scheme = "http" r.URL.Host = r.Host @@ -65,9 +65,9 @@ func (h *DecisionHandler) ServeHTTP(w http.ResponseWriter, r *http.Request, next } } -// swagger:route GET /decisions api decisions +// swagger:route GET /decisions/generic api makeGenericDecision // -// Access Control Decision API +// Access Control Generic Decision API // // > This endpoint works with all HTTP Methods (GET, POST, PUT, ...) and matches every path prefixed with /decision. // @@ -83,7 +83,7 @@ func (h *DecisionHandler) ServeHTTP(w http.ResponseWriter, r *http.Request, next // 403: genericError // 404: genericError // 500: genericError -func (h *DecisionHandler) decisions(w http.ResponseWriter, r *http.Request) { +func (h *DecisionGenericHandler) decisions(w http.ResponseWriter, r *http.Request) { fields := map[string]interface{}{ "http_method": r.Method, "http_url": r.URL.String(), diff --git a/api/decision_test.go b/api/decision_test.go index 18f2282582..a20720d07b 100644 --- a/api/decision_test.go +++ b/api/decision_test.go @@ -33,6 +33,7 @@ import ( "github.com/urfave/negroni" + "github.com/ory/oathkeeper/api" "github.com/ory/oathkeeper/driver/configuration" "github.com/ory/oathkeeper/internal" @@ -54,9 +55,9 @@ func TestDecisionAPI(t *testing.T) { viper.Set(configuration.ViperKeyErrorsWWWAuthenticateIsEnabled, true) reg := internal.NewRegistry(conf).WithBrokenPipelineMutator() - d := reg.DecisionHandler() - - n := negroni.New(d) + n := negroni.New() + n.Use(reg.DecisionHandler()) + n.Use(reg.DecisionTraefikHandler()) n.UseHandler(httprouter.New()) ts := httptest.NewServer(n) @@ -92,55 +93,83 @@ func TestDecisionAPI(t *testing.T) { Upstream: rule.Upstream{URL: "", StripPath: "/strip-path/", PreserveHost: true}, } + deciders := []string{ + // "generic", + "traefik", + } + defaultTransformers := map[string]func(r *http.Request){ + "traefik": func(r *http.Request) { + r.Header.Set(api.TraefikProto, r.URL.Scheme) + r.Header.Set(api.TraefikHost, r.URL.Host) + r.Header.Set(api.TraefikMethod, r.Method) + r.Header.Set(api.TraefikURI, r.URL.Path[len(api.DecisionTraefikPath):]) // This would not be in a real request either. + + r.URL.Path = "/decisions/traefik" + r.Method = "GET" + }, + } + for k, tc := range []struct { - url string - code int - messages []string - rulesRegexp []rule.Rule - rulesGlob []rule.Rule - transform func(r *http.Request) - authz string - d string + url string + code int + messages []string + rulesRegexp []rule.Rule + rulesGlob []rule.Rule + transformers map[string]func(r *http.Request) + authz string + d string }{ { d: "should fail because url does not exist in rule set", - url: ts.URL + "/decisions" + "/invalid", + url: "/invalid", rulesRegexp: []rule.Rule{}, rulesGlob: []rule.Rule{}, code: http.StatusNotFound, }, { d: "should fail because url does exist but is matched by two rulesRegexp", - url: ts.URL + "/decisions" + "/authn-noop/1234", + url: "/authn-noop/1234", rulesRegexp: []rule.Rule{ruleNoOpAuthenticator, ruleNoOpAuthenticator}, rulesGlob: []rule.Rule{ruleNoOpAuthenticatorGLOB, ruleNoOpAuthenticatorGLOB}, code: http.StatusInternalServerError, }, { d: "should pass", - url: ts.URL + "/decisions" + "/authn-noop/1234", + url: "/authn-noop/1234", rulesRegexp: []rule.Rule{ruleNoOpAuthenticator}, rulesGlob: []rule.Rule{ruleNoOpAuthenticatorGLOB}, code: http.StatusOK, - transform: func(r *http.Request) { - r.Header.Add("Authorization", "bearer token") + transformers: map[string]func(r *http.Request){ + "generic": func(r *http.Request) { + r.Header.Add("Authorization", "bearer token") + }, + "traefik": func(r *http.Request) { + r.Header.Add("Authorization", "bearer token") + defaultTransformers["traefik"](r) + }, }, authz: "bearer token", }, { d: "should pass", - url: ts.URL + "/decisions" + "/strip-path/authn-noop/1234", + url: "/strip-path/authn-noop/1234", rulesRegexp: []rule.Rule{ruleNoOpAuthenticatorModifyUpstream}, rulesGlob: []rule.Rule{ruleNoOpAuthenticatorModifyUpstreamGLOB}, code: http.StatusOK, - transform: func(r *http.Request) { - r.Header.Add("Authorization", "bearer token") + transformers: map[string]func(r *http.Request){ + "generic": func(r *http.Request) { + r.Header.Add("Authorization", "bearer token") + }, + "traefik": func(r *http.Request) { + r.Header.Add("Authorization", "bearer token") + defaultTransformers["traefik"](r) + }, }, authz: "bearer token", }, { d: "should fail because no authorizer was configured", - url: ts.URL + "/decisions" + "/authn-anon/authz-none/cred-none/1234", + url: "/authn-anon/authz-none/cred-none/1234", rulesRegexp: []rule.Rule{{ Match: &rule.Match{Methods: []string{"GET"}, URL: ts.URL + "/authn-anon/authz-none/cred-none/<[0-9]+>"}, Authenticators: []rule.Handler{{Handler: "anonymous"}}, @@ -151,14 +180,20 @@ func TestDecisionAPI(t *testing.T) { Authenticators: []rule.Handler{{Handler: "anonymous"}}, Upstream: rule.Upstream{URL: ""}, }}, - transform: func(r *http.Request) { - r.Header.Add("Authorization", "bearer token") + transformers: map[string]func(r *http.Request){ + "generic": func(r *http.Request) { + r.Header.Add("Authorization", "bearer token") + }, + "traefik": func(r *http.Request) { + r.Header.Add("Authorization", "bearer token") + defaultTransformers["traefik"](r) + }, }, code: http.StatusUnauthorized, }, { d: "should fail because no mutator was configured", - url: ts.URL + "/decisions" + "/authn-anon/authz-allow/cred-none/1234", + url: "/authn-anon/authz-allow/cred-none/1234", rulesRegexp: []rule.Rule{{ Match: &rule.Match{Methods: []string{"GET"}, URL: ts.URL + "/authn-anon/authz-allow/cred-none/<[0-9]+>"}, Authenticators: []rule.Handler{{Handler: "anonymous"}}, @@ -175,7 +210,7 @@ func TestDecisionAPI(t *testing.T) { }, { d: "should pass with anonymous and everything else set to noop", - url: ts.URL + "/decisions" + "/authn-anon/authz-allow/cred-noop/1234", + url: "/authn-anon/authz-allow/cred-noop/1234", rulesRegexp: []rule.Rule{{ Match: &rule.Match{Methods: []string{"GET"}, URL: ts.URL + "/authn-anon/authz-allow/cred-noop/<[0-9]+>"}, Authenticators: []rule.Handler{{Handler: "anonymous"}}, @@ -195,7 +230,7 @@ func TestDecisionAPI(t *testing.T) { }, { d: "should fail when authorizer fails", - url: ts.URL + "/decisions" + "/authn-anon/authz-deny/cred-noop/1234", + url: "/authn-anon/authz-deny/cred-noop/1234", rulesRegexp: []rule.Rule{{ Match: &rule.Match{Methods: []string{"GET"}, URL: ts.URL + "/authn-anon/authz-deny/cred-noop/<[0-9]+>"}, Authenticators: []rule.Handler{{Handler: "anonymous"}}, @@ -214,7 +249,7 @@ func TestDecisionAPI(t *testing.T) { }, { d: "should fail when authenticator fails", - url: ts.URL + "/decisions" + "/authn-broken/authz-none/cred-none/1234", + url: "/authn-broken/authz-none/cred-none/1234", rulesRegexp: []rule.Rule{{ Match: &rule.Match{Methods: []string{"GET"}, URL: ts.URL + "/authn-broken/authz-none/cred-none/<[0-9]+>"}, Authenticators: []rule.Handler{{Handler: "unauthorized"}}, @@ -229,7 +264,7 @@ func TestDecisionAPI(t *testing.T) { }, { d: "should fail when mutator fails", - url: ts.URL + "/decisions" + "/authn-anonymous/authz-allow/cred-broken/1234", + url: "/authn-anonymous/authz-allow/cred-broken/1234", rulesRegexp: []rule.Rule{{ Match: &rule.Match{Methods: []string{"GET"}, URL: ts.URL + "/authn-anonymous/authz-allow/cred-broken/<[0-9]+>"}, Authenticators: []rule.Handler{{Handler: "anonymous"}}, @@ -248,7 +283,7 @@ func TestDecisionAPI(t *testing.T) { }, { d: "should fail when one of the mutators fails", - url: ts.URL + "/decisions" + "/authn-anonymous/authz-allow/cred-broken/1234", + url: "/authn-anonymous/authz-allow/cred-broken/1234", rulesRegexp: []rule.Rule{{ Match: &rule.Match{Methods: []string{"GET"}, URL: ts.URL + "/authn-anonymous/authz-allow/cred-broken/<[0-9]+>"}, Authenticators: []rule.Handler{{Handler: "anonymous"}}, @@ -267,7 +302,7 @@ func TestDecisionAPI(t *testing.T) { }, { d: "should fail when authorizer fails and send www_authenticate as defined in the rule", - url: ts.URL + "/decisions" + "/authn-anon/authz-deny/cred-noop/1234", + url: "/authn-anon/authz-deny/cred-noop/1234", rulesRegexp: []rule.Rule{{ Match: &rule.Match{Methods: []string{"GET"}, URL: ts.URL + "/authn-anon/authz-deny/cred-noop/<[0-9]+>"}, Authenticators: []rule.Handler{{Handler: "anonymous"}}, @@ -288,7 +323,7 @@ func TestDecisionAPI(t *testing.T) { }, { d: "should not pass Content-Length from client", - url: ts.URL + "/decisions" + "/authn-anon/authz-allow/cred-noop/1234", + url: "/authn-anon/authz-allow/cred-noop/1234", rulesRegexp: []rule.Rule{{ Match: &rule.Match{Methods: []string{"GET"}, URL: ts.URL + "/authn-anon/authz-allow/cred-noop/<[0-9]+>"}, Authenticators: []rule.Handler{{Handler: "anonymous"}}, @@ -303,41 +338,60 @@ func TestDecisionAPI(t *testing.T) { Mutators: []rule.Handler{{Handler: "noop"}}, Upstream: rule.Upstream{URL: ""}, }}, - transform: func(r *http.Request) { - r.Header.Add("Content-Length", "1337") + transformers: map[string]func(r *http.Request){ + "generic": func(r *http.Request) { + r.Header.Add("Content-Length", "1337") + }, + "traefik": func(r *http.Request) { + r.Header.Add("Content-Length", "1337") + defaultTransformers["traefik"](r) + }, }, code: http.StatusOK, authz: "", }, } { - t.Run(fmt.Sprintf("case=%d/description=%s", k, tc.d), func(t *testing.T) { - testFunc := func(strategy configuration.MatchingStrategy) { - require.NoError(t, reg.RuleRepository().SetMatchingStrategy(context.Background(), strategy)) - req, err := http.NewRequest("GET", tc.url, nil) - require.NoError(t, err) - if tc.transform != nil { - tc.transform(req) - } + testFunc := func(t *testing.T, strategy configuration.MatchingStrategy, decider string) { + require.NoError(t, reg.RuleRepository().SetMatchingStrategy(context.Background(), strategy)) + req, err := http.NewRequest("GET", ts.URL+"/decisions/"+decider+tc.url, nil) + require.NoError(t, err) - res, err := http.DefaultClient.Do(req) - require.NoError(t, err) - - entireBody, err := ioutil.ReadAll(res.Body) - require.NoError(t, err) - defer res.Body.Close() + var transformer func(*http.Request) + if tc.transformers != nil { + transformer, _ = tc.transformers[decider] + } + if transformer == nil { + transformer, _ = defaultTransformers[decider] + } - assert.Equal(t, tc.authz, res.Header.Get("Authorization")) - assert.Equal(t, tc.code, res.StatusCode) - assert.Equal(t, strconv.Itoa(len(entireBody)), res.Header.Get("Content-Length")) + if transformer != nil { + transformer(req) } - t.Run("regexp", func(t *testing.T) { - reg.RuleRepository().(*rule.RepositoryMemory).WithRules(tc.rulesRegexp) - testFunc(configuration.Regexp) - }) - t.Run("glob", func(t *testing.T) { - reg.RuleRepository().(*rule.RepositoryMemory).WithRules(tc.rulesRegexp) - testFunc(configuration.Glob) + + res, err := http.DefaultClient.Do(req) + require.NoError(t, err) + + entireBody, err := ioutil.ReadAll(res.Body) + require.NoError(t, err) + defer res.Body.Close() + + assert.Equal(t, tc.authz, res.Header.Get("Authorization")) + assert.Equal(t, tc.code, res.StatusCode) + assert.Equal(t, strconv.Itoa(len(entireBody)), res.Header.Get("Content-Length")) + } + + for _, decider := range deciders { + t.Run(fmt.Sprintf("decider=%s/case=%d/description=%s", decider, k, tc.d), func(t *testing.T) { + t.Run("regexp", func(t *testing.T) { + reg.RuleRepository().(*rule.RepositoryMemory).WithRules(tc.rulesRegexp) + testFunc(t, configuration.Regexp, decider) + }) + + t.Run("glob", func(t *testing.T) { + reg.RuleRepository().(*rule.RepositoryMemory).WithRules(tc.rulesRegexp) + testFunc(t, configuration.Glob, decider) + }) }) - }) + } } } diff --git a/api/decision_traefik.go b/api/decision_traefik.go new file mode 100644 index 0000000000..9e6565e642 --- /dev/null +++ b/api/decision_traefik.go @@ -0,0 +1,130 @@ +/* + * Copyright © 2017-2018 Aeneas Rekkas + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @author Aeneas Rekkas + * @copyright 2017-2018 Aeneas Rekkas + * @license Apache-2.0 + */ + +package api + +import ( + "net/http" + "net/url" + + "github.com/ory/oathkeeper/x" + + "github.com/ory/oathkeeper/proxy" + "github.com/ory/oathkeeper/rule" +) + +const ( + DecisionTraefikPath = "/decisions/traefik" + TraefikProto = "X-Forwarded-Proto" + TraefikHost = "X-Forwarded-Host" + TraefikURI = "X-Forwarded-Uri" + TraefikMethod = "X-Forwarded-Method" +) + +type decisionTraefikHandlerRegistry interface { + x.RegistryWriter + x.RegistryLogger + + RuleMatcher() rule.Matcher + ProxyRequestHandler() *proxy.RequestHandler +} + +type DecisionTraefikHandler struct { + r decisionTraefikHandlerRegistry +} + +func NewDecisionTraefikerHandler(r decisionTraefikHandlerRegistry) *DecisionTraefikHandler { + return &DecisionTraefikHandler{r: r} +} + +func (h *DecisionTraefikHandler) ServeHTTP(w http.ResponseWriter, r *http.Request, next http.HandlerFunc) { + if r.Method == "GET" && len(r.URL.Path) >= len(DecisionTraefikPath) && r.URL.Path[:len(DecisionTraefikPath)] == DecisionTraefikPath { + r.URL.Scheme = "http" + r.URL.Host = r.Host + if r.TLS != nil { + r.URL.Scheme = "https" + } + + h.decisionTraefik(w, r) + } else { + next(w, r) + } +} + +// swagger:route GET /decisions/traefik api makeTraefikDecision +// +// Access Control Decision Traefik API +// +// This endpoint mirrors the proxy capability of ORY Oathkeeper's proxy functionality but instead of forwarding the +// request to the upstream server, returns 200 (request should be allowed), 401 (unauthorized), or 403 (forbidden) +// status codes. This endpoint can be used to integrate with the Traefik proxy. +// +// Schemes: http, https +// +// Responses: +// 200: emptyResponse +// 401: genericError +// 403: genericError +// 404: genericError +// 500: genericError +func (h *DecisionTraefikHandler) decisionTraefik(w http.ResponseWriter, r *http.Request) { + urlToMatch := url.URL{ + Scheme: r.Header.Get(TraefikProto), + Host: r.Header.Get(TraefikHost), + Path: r.Header.Get(TraefikURI), + } + methodToMatch := r.Header.Get(TraefikMethod) + + rl, err := h.r.RuleMatcher().Match(r.Context(), methodToMatch, &urlToMatch) + if err != nil { + h.r.Logger().WithError(err). + WithField("granted", false). + WithField("access_url", urlToMatch.String()). + Warn("Access request denied") + h.r.ProxyRequestHandler().HandleError(w, r, rl, err) + return + } + + s, err := h.r.ProxyRequestHandler().HandleRequest(r, rl) + if err != nil { + h.r.Logger().WithError(err). + WithField("granted", false). + WithField("access_url", urlToMatch.String()). + Warn("Access request denied") + h.r.ProxyRequestHandler().HandleError(w, r, rl, err) + return + } + + h.r.Logger(). + WithField("granted", true). + WithField("access_url", urlToMatch.String()). + Warn("Access request granted") + + for k := range s.Header { + // Avoid copying the original Content-Length header from the client + if k == "content-length" { + continue + } + + w.Header().Set(k, s.Header.Get(k)) + } + + w.WriteHeader(http.StatusOK) +} diff --git a/cmd/server/server.go b/cmd/server/server.go index 07e78da7d6..7873771160 100644 --- a/cmd/server/server.go +++ b/cmd/server/server.go @@ -87,6 +87,7 @@ func runAPI(d driver.Driver, n *negroni.Negroni, logger *logrusx.Logger, prom *m n.Use(metrics.NewMiddleware(prom, "oathkeeper-api").ExcludePaths(healthx.ReadyCheckPath, healthx.AliveCheckPath).CollapsePaths(promCollapsePaths)) n.Use(reqlog.NewMiddlewareFromLogger(logger, "oathkeeper-api").ExcludePaths(healthx.ReadyCheckPath, healthx.AliveCheckPath)) + n.Use(d.Registry().DecisionTraefikHandler()) n.Use(d.Registry().DecisionHandler()) // This needs to be the last entry, otherwise the judge API won't work n.UseHandler(router) @@ -199,8 +200,9 @@ func RunServe(version, build, date string) func(cmd *cobra.Command, args []strin WriteKey: "xRVRP48SAKw6ViJEnvB0u2PY8bVlsO6O", WhitelistedPaths: []string{ "/", - api.CredentialsPath, + api.DecisionTraefikPath, api.DecisionPath, + api.CredentialsPath, api.RulesPath, healthx.VersionPath, healthx.AliveCheckPath, diff --git a/docs/docs/index.md b/docs/docs/index.md index 956ceb4ada..66d520027d 100644 --- a/docs/docs/index.md +++ b/docs/docs/index.md @@ -104,12 +104,12 @@ request to ORY Oathkeeper. The ORY Oathkeeper Access Control Decision API follows best-practices and works with most (if not all) modern API gateways and reverse proxies. To verify a -request, send it to the `decisions` endpoint located at the Ory Authkeeper API +request, send it to the `decisions` endpoint located at the Ory Oathkeeper API port. It matches every sub-path and HTTP Method: -- `GET /decisions/v1/api` -- `PUT /decisions/my/other/api` -- `DELETE /decisions/users?foo=?bar` +- `GET /decisions/generic/v1/api` +- `PUT /decisions/generic/my/other/api` +- `DELETE /decisions/generic/users?foo=?bar` When matching a rule, the `/decision` prefix is stripped from the matching path. diff --git a/driver/registry.go b/driver/registry.go index 2fd92cb182..fa6f520e5c 100644 --- a/driver/registry.go +++ b/driver/registry.go @@ -32,7 +32,8 @@ type Registry interface { ProxyRequestHandler() *proxy.RequestHandler HealthHandler() *healthx.Handler RuleHandler() *api.RuleHandler - DecisionHandler() *api.DecisionHandler + DecisionHandler() *api.DecisionGenericHandler + DecisionTraefikHandler() *api.DecisionTraefikHandler CredentialHandler() *api.CredentialsHandler Proxy() *proxy.Proxy diff --git a/driver/registry_memory.go b/driver/registry_memory.go index f21bf6f00b..b0ab69bf0a 100644 --- a/driver/registry_memory.go +++ b/driver/registry_memory.go @@ -43,14 +43,15 @@ type RegistryMemory struct { ch *api.CredentialsHandler - credentialsFetcher credentials.Fetcher - credentialsVerifier credentials.Verifier - credentialsSigner credentials.Signer - ruleValidator rule.Validator - ruleRepository *rule.RepositoryMemory - apiRuleHandler *api.RuleHandler - apiJudgeHandler *api.DecisionHandler - healthxHandler *healthx.Handler + credentialsFetcher credentials.Fetcher + credentialsVerifier credentials.Verifier + credentialsSigner credentials.Signer + ruleValidator rule.Validator + ruleRepository *rule.RepositoryMemory + apiRuleHandler *api.RuleHandler + apiJudgeHandler *api.DecisionGenericHandler + apiDecisionTraefikerHandler *api.DecisionTraefikHandler + healthxHandler *healthx.Handler proxyRequestHandler *proxy.RequestHandler proxyProxy *proxy.Proxy @@ -175,13 +176,20 @@ func (r *RegistryMemory) RuleHandler() *api.RuleHandler { return r.apiRuleHandler } -func (r *RegistryMemory) DecisionHandler() *api.DecisionHandler { +func (r *RegistryMemory) DecisionHandler() *api.DecisionGenericHandler { if r.apiJudgeHandler == nil { - r.apiJudgeHandler = api.NewJudgeHandler(r) + r.apiJudgeHandler = api.NewDecisionGenericHandler(r) } return r.apiJudgeHandler } +func (r *RegistryMemory) DecisionTraefikHandler() *api.DecisionTraefikHandler { + if r.apiDecisionTraefikerHandler == nil { + r.apiDecisionTraefikerHandler = api.NewDecisionTraefikerHandler(r) + } + return r.apiDecisionTraefikerHandler +} + func (r *RegistryMemory) CredentialsFetcher() credentials.Fetcher { if r.credentialsFetcher == nil { r.credentialsFetcher = credentials.NewFetcherDefault(r.Logger(), time.Second, time.Second*30) diff --git a/go.mod b/go.mod index 35d58a94ee..33ad27cdfc 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/ory/oathkeeper require ( github.com/Masterminds/goutils v1.1.0 // indirect github.com/Masterminds/sprig v2.20.0+incompatible - github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a + github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535 github.com/auth0/go-jwt-middleware v0.0.0-20170425171159-5493cabe49f7 github.com/blang/semver v3.5.1+incompatible github.com/bxcodec/faker v2.0.1+incompatible @@ -12,12 +12,12 @@ require ( github.com/dlclark/regexp2 v1.2.0 github.com/fsnotify/fsnotify v1.4.9 github.com/ghodss/yaml v1.0.0 - github.com/go-openapi/errors v0.19.2 - github.com/go-openapi/runtime v0.19.5 - github.com/go-openapi/strfmt v0.19.3 - github.com/go-openapi/swag v0.19.5 + github.com/go-openapi/errors v0.19.6 + github.com/go-openapi/runtime v0.19.20 + github.com/go-openapi/strfmt v0.19.5 + github.com/go-openapi/swag v0.19.9 github.com/go-sql-driver/mysql v1.5.0 - github.com/go-swagger/go-swagger v0.21.1-0.20200107003254-1c98855b472d + github.com/go-swagger/go-swagger v0.25.0 github.com/gobuffalo/httptest v1.0.2 github.com/gobuffalo/packr/v2 v2.7.1 github.com/gobwas/glob v0.2.3 @@ -54,17 +54,17 @@ require ( github.com/spf13/viper v1.7.0 // indirect github.com/sqs/goreturns v0.0.0-20181028201513-538ac6014518 github.com/square/go-jose v2.3.1+incompatible - github.com/stretchr/testify v1.5.1 + github.com/stretchr/testify v1.6.1 github.com/tidwall/gjson v1.6.0 github.com/tidwall/sjson v1.1.1 github.com/tomasen/realip v0.0.0-20180522021738-f0c99a92ddce github.com/urfave/negroni v1.0.0 github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect - golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37 - golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 - golang.org/x/tools v0.0.0-20200325203130-f53864d0dba1 + golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899 + golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d + golang.org/x/tools v0.0.0-20200717024301-6ddee64345a6 google.golang.org/grpc v1.29.1 // indirect - gopkg.in/square/go-jose.v2 v2.3.1 + gopkg.in/square/go-jose.v2 v2.5.1 ) go 1.14 diff --git a/go.sum b/go.sum index 726cb5a022..65d7f99962 100644 --- a/go.sum +++ b/go.sum @@ -55,6 +55,9 @@ github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= +github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= +github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535 h1:4daAzAu0S6Vi7/lbWECcX0j45yZReDZ56BQsrVBOEEY= +github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= github.com/auth0/go-jwt-middleware v0.0.0-20170425171159-5493cabe49f7 h1:irR1cO6eek3n5uquIVaRAsQmZnlsfPuHNz31cXo4eyk= github.com/auth0/go-jwt-middleware v0.0.0-20170425171159-5493cabe49f7/go.mod h1:LWMyo4iOLWXHGdBki7NIht1kHru/0wM179h+d3g8ATM= github.com/aws/aws-sdk-go v1.23.19/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= @@ -107,6 +110,7 @@ github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= +github.com/coreos/go-oidc v2.2.1+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= @@ -115,6 +119,7 @@ github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfc github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -173,10 +178,15 @@ github.com/go-openapi/analysis v0.19.4/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9sn github.com/go-openapi/analysis v0.19.5/go.mod h1:hkEAkxagaIvIP7VTn8ygJNkd4kAYON2rCu0v0ObL0AU= github.com/go-openapi/analysis v0.19.6 h1:5Z7zgx/EAmE9bf7cuTU1hkGQlZGzGDf9a1m57xRfNZk= github.com/go-openapi/analysis v0.19.6/go.mod h1:hkEAkxagaIvIP7VTn8ygJNkd4kAYON2rCu0v0ObL0AU= +github.com/go-openapi/analysis v0.19.10 h1:5BHISBAXOc/aJK25irLZnx2D3s6WyYaY9D4gmuz9fdE= +github.com/go-openapi/analysis v0.19.10/go.mod h1:qmhS3VNFxBlquFJ0RGoDtylO9y4pgTAUNE9AEEMdlJQ= github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= github.com/go-openapi/errors v0.18.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= github.com/go-openapi/errors v0.19.2 h1:a2kIyV3w+OS3S97zxUndRVD46+FhGOUBDFY7nmu4CsY= github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= +github.com/go-openapi/errors v0.19.3/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= +github.com/go-openapi/errors v0.19.6 h1:xZMThgv5SQ7SMbWtKFkCf9bBdvR2iEyw9k3zGZONuys= +github.com/go-openapi/errors v0.19.6/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= github.com/go-openapi/inflect v0.19.0 h1:9jCH9scKIbHeV9m12SmPilScz6krDxKRasNNSNPXu/4= github.com/go-openapi/inflect v0.19.0/go.mod h1:lHpZVlpIQqLyKwJ4N+YSc9hchQy/i12fJykb83CRBH4= github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= @@ -188,37 +198,56 @@ github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3Hfo github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= github.com/go-openapi/jsonreference v0.19.2 h1:o20suLFB4Ri0tuzpWtyHlh7E7HnkqTNLq6aR6WVNS1w= github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= +github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= +github.com/go-openapi/jsonreference v0.19.4 h1:3Vw+rh13uq2JFNxgnMTGE1rnoieU9FmyE1gvnyylsYg= +github.com/go-openapi/jsonreference v0.19.4/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= github.com/go-openapi/loads v0.19.2/go.mod h1:QAskZPMX5V0C2gvfkGZzJlINuP7Hx/4+ix5jWFxsNPs= github.com/go-openapi/loads v0.19.3 h1:jwIoahqCmaA5OBoc/B+1+Mu2L0Gr8xYQnbeyQEo/7b0= github.com/go-openapi/loads v0.19.3/go.mod h1:YVfqhUCdahYwR3f3iiwQLhicVRvLlU/WO5WPaZvcvSI= +github.com/go-openapi/loads v0.19.5 h1:jZVYWawIQiA1NBnHla28ktg6hrcfTHsCE+3QLVRBIls= +github.com/go-openapi/loads v0.19.5/go.mod h1:dswLCAdonkRufe/gSUC3gN8nTSaB9uaS2es0x5/IbjY= github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9/go.mod h1:6v9a6LTXWQCdL8k1AO3cvqx5OtZY/Y9wKTgaoP6YRfA= github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt4sK4FXt0O64= github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4= github.com/go-openapi/runtime v0.19.5 h1:h4Zk7oTfB3ZYM2oMNliQvL+3BrDstTIX8lqP7yaYCuI= github.com/go-openapi/runtime v0.19.5/go.mod h1:WIH6IYPXOrtgTClTV8xzdrD20jBlrK25D0aQbdSlqp8= +github.com/go-openapi/runtime v0.19.15/go.mod h1:dhGWCTKRXlAfGnQG0ONViOZpjfg0m2gUt9nTQPQZuoo= +github.com/go-openapi/runtime v0.19.20 h1:J/t+QIjbcoq8WJvjGxRKiFBhqUE8slS9SbmD0Oi/raQ= +github.com/go-openapi/runtime v0.19.20/go.mod h1:Lm9YGCeecBnUUkFTxPC4s1+lwrkJ0pthx8YvyjCfkgk= github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY= github.com/go-openapi/spec v0.19.3 h1:0XRyw8kguri6Yw4SxhsQA/atC88yqrk0+G4YhI2wabc= github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= +github.com/go-openapi/spec v0.19.6/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= +github.com/go-openapi/spec v0.19.8 h1:qAdZLh1r6QF/hI/gTq+TJTvsQUodZsM7KLqkAJdiJNg= +github.com/go-openapi/spec v0.19.8/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= github.com/go-openapi/strfmt v0.19.0/go.mod h1:+uW+93UVvGGq2qGaZxdDeJqSAqBqBdl+ZPMF/cC8nDY= github.com/go-openapi/strfmt v0.19.2/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= github.com/go-openapi/strfmt v0.19.3 h1:eRfyY5SkaNJCAwmmMcADjY31ow9+N7MCLW7oRkbsINA= github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= +github.com/go-openapi/strfmt v0.19.4/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= +github.com/go-openapi/strfmt v0.19.5 h1:0utjKrw+BAh8s57XE9Xz8DUBsVvPmRUB6styvl9wWIM= +github.com/go-openapi/strfmt v0.19.5/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/swag v0.19.7/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY= +github.com/go-openapi/swag v0.19.9 h1:1IxuqvBUU3S2Bi4YC7tlP9SJF1gVpCvqN0T2Qof4azE= +github.com/go-openapi/swag v0.19.9/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY= github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA= github.com/go-openapi/validate v0.19.3 h1:PAH/2DylwWcIU1s0Y7k3yNmeAgWOcKrNE2Q7Ww/kCg4= github.com/go-openapi/validate v0.19.3/go.mod h1:90Vh6jjkTn+OT1Eefm0ZixWNFjhtOH7vS9k0lo6zwJo= +github.com/go-openapi/validate v0.19.10 h1:tG3SZ5DC5KF4cyt7nqLVcQXGj5A7mpaYkAcNPlDK+Yk= +github.com/go-openapi/validate v0.19.10/go.mod h1:RKEZTUWDkxKQxN2jDT7ZnZi2bhZlbNMAuKvKB+IaGx8= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.4.1 h1:g24URVg0OFbNUTx9qqY1IRZ9D9z3iPyi5zKhQZpNwpA= github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= @@ -228,8 +257,11 @@ github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-swagger/go-swagger v0.21.1-0.20200107003254-1c98855b472d h1:x6bMs6miV7mzMbdArYk/APT4+TyySD94rot1au2ku60= github.com/go-swagger/go-swagger v0.21.1-0.20200107003254-1c98855b472d/go.mod h1:20SBEAunNzw1wD1ZPvWy5xQAxTcCB0UVDVOPeReIayA= +github.com/go-swagger/go-swagger v0.25.0 h1:FxhyrWWV8V/A9P6GtI5szWordAdbb6Y0nqdY/y9So2w= +github.com/go-swagger/go-swagger v0.25.0/go.mod h1:9639ioXrPX9E6BbnbaDklGXjNz7upAXoNBwL4Ok11Vk= github.com/go-swagger/scan-repo-boundary v0.0.0-20180623220736-973b3573c013 h1:l9rI6sNaZgNC0LnF3MiE+qTmyBA/tZAg1rtyrGbUMK0= github.com/go-swagger/scan-repo-boundary v0.0.0-20180623220736-973b3573c013/go.mod h1:b65mBPzqzZWxOZGxSWrqs4GInLIn+u99Q9q7p+GKni0= +github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= github.com/gobuffalo/attrs v0.1.0/go.mod h1:fmNpaWyHM0tRm8gCZWKx8yY9fvaNLo2PyzBNSrBZ5Hw= github.com/gobuffalo/buffalo v0.12.8-0.20181004233540-fac9bb505aa8/go.mod h1:sLyT7/dceRXJUxSsE813JTQtA3Eb1vjxWfo/N//vXIY= github.com/gobuffalo/buffalo v0.13.0/go.mod h1:Mjn1Ba9wpIbpbrD+lIDMy99pQ0H0LiddMIIDGse7qT4= @@ -250,6 +282,8 @@ github.com/gobuffalo/buffalo-plugins v1.11.0 h1:yZ6USaSdAKpogRS8DZJgeG7/CTPGmyhp github.com/gobuffalo/buffalo-plugins v1.11.0/go.mod h1:rtIvAYRjYibgmWhnjKmo7OadtnxuMG5ZQLr25ozAzjg= github.com/gobuffalo/buffalo-plugins v1.15.0/go.mod h1:BqSx01nwgKUQr/MArXzFkSD0QvdJidiky1OKgyfgrK8= github.com/gobuffalo/buffalo-pop v1.0.5/go.mod h1:Fw/LfFDnSmB/vvQXPvcXEjzP98Tc+AudyNWUBWKCwQ8= +github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY= +github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg= github.com/gobuffalo/envy v1.6.4/go.mod h1:Abh+Jfw475/NWtYMEt+hnJWRiC8INKWibIMyNt1w2Mc= github.com/gobuffalo/envy v1.6.5/go.mod h1:N+GkhhZ/93bGZc6ZKhJLP6+m+tCNPKwgSpH9kaifseQ= github.com/gobuffalo/envy v1.6.6/go.mod h1:N+GkhhZ/93bGZc6ZKhJLP6+m+tCNPKwgSpH9kaifseQ= @@ -293,6 +327,9 @@ github.com/gobuffalo/flect v0.0.0-20181210151238-24a2b68e0316/go.mod h1:en58vff7 github.com/gobuffalo/flect v0.0.0-20190104192022-4af577e09bf2/go.mod h1:en58vff74S9b99Eg42Dr+/9yPu437QjlNsO/hBYPuOk= github.com/gobuffalo/flect v0.0.0-20190117212819-a62e61d96794 h1:HZOs07hF3AmoaUj4HJQHV5RqfOuGnPZI7aFcireIrww= github.com/gobuffalo/flect v0.0.0-20190117212819-a62e61d96794/go.mod h1:397QT6v05LkZkn07oJXXT6y9FCfwC8Pug0WA2/2mE9k= +github.com/gobuffalo/flect v0.1.0/go.mod h1:d2ehjJqGOH/Kjqcoz+F7jHTBbmDb38yXA598Hb50EGs= +github.com/gobuffalo/flect v0.1.1/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= +github.com/gobuffalo/flect v0.1.3/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= github.com/gobuffalo/flect v0.1.5/go.mod h1:W3K3X9ksuZfir8f/LrfVtWmCDQFfayuylOJ7sz/Fj80= github.com/gobuffalo/flect v0.2.0/go.mod h1:W3K3X9ksuZfir8f/LrfVtWmCDQFfayuylOJ7sz/Fj80= github.com/gobuffalo/flect v0.2.1 h1:GPoRjEN0QObosV4XwuoWvSd5uSiL0N3e91/xqyY4crQ= @@ -321,6 +358,10 @@ github.com/gobuffalo/genny v0.0.0-20181211165820-e26c8466f14d/go.mod h1:sHnK+ZSU github.com/gobuffalo/genny v0.0.0-20190104222617-a71664fc38e7/go.mod h1:QPsQ1FnhEsiU8f+O0qKWXz2RE4TiDqLVChWkBuh1WaY= github.com/gobuffalo/genny v0.0.0-20190112155932-f31a84fcacf5 h1:boQS3dA9PxhyufJEWIILrG6pJQbDnpwP2rFyvWacdoY= github.com/gobuffalo/genny v0.0.0-20190112155932-f31a84fcacf5/go.mod h1:CIaHCrSIuJ4il6ka3Hub4DR4adDrGoXGEEt2FbBxoIo= +github.com/gobuffalo/genny v0.0.0-20190329151137-27723ad26ef9/go.mod h1:rWs4Z12d1Zbf19rlsn0nurr75KqhYp52EAGGxTbBhNk= +github.com/gobuffalo/genny v0.0.0-20190403191548-3ca520ef0d9e/go.mod h1:80lIj3kVJWwOrXWWMRzzdhW3DsrdjILVil/SFKBzF28= +github.com/gobuffalo/genny v0.1.0/go.mod h1:XidbUqzak3lHdS//TPu2OgiFB+51Ur5f7CSnXZ/JDvo= +github.com/gobuffalo/genny v0.1.1/go.mod h1:5TExbEyY48pfunL4QSXxlDOmdsD44RRq4mVZ0Ex28Xk= github.com/gobuffalo/genny v0.2.0/go.mod h1:rWs4Z12d1Zbf19rlsn0nurr75KqhYp52EAGGxTbBhNk= github.com/gobuffalo/genny v0.3.0/go.mod h1:ywJ2CoXrTZj7rbS8HTbzv7uybnLKlsNSBhEQ+yFI3E8= github.com/gobuffalo/genny v0.6.0/go.mod h1:Vigx9VDiNscYpa/LwrURqGXLSIbzTfapt9+K6gF1kTA= @@ -331,6 +372,9 @@ github.com/gobuffalo/github_flavored_markdown v1.0.5/go.mod h1:U0643QShPF+OF2tJv github.com/gobuffalo/github_flavored_markdown v1.0.7/go.mod h1:w93Pd9Lz6LvyQXEG6DktTPHkOtCbr+arAD5mkwMzXLI= github.com/gobuffalo/github_flavored_markdown v1.1.0 h1:8Zzj4fTRl/OP2R7sGerzSf6g2nEJnaBEJe7UAOiEvbQ= github.com/gobuffalo/github_flavored_markdown v1.1.0/go.mod h1:TSpTKWcRTI0+v7W3x8dkSKMLJSUpuVitlptCkpeY8ic= +github.com/gobuffalo/gogen v0.0.0-20190315121717-8f38393713f5/go.mod h1:V9QVDIxsgKNZs6L2IYiGR8datgMhB577vzTDqypH360= +github.com/gobuffalo/gogen v0.1.0/go.mod h1:8NTelM5qd8RZ15VjQTFkAW6qOMx5wBbW4dSCS3BY8gg= +github.com/gobuffalo/gogen v0.1.1/go.mod h1:y8iBtmHmGc4qa3urIyo1shvOD8JftTtfcKi+71xfDNE= github.com/gobuffalo/gogen v0.2.0/go.mod h1:V9QVDIxsgKNZs6L2IYiGR8datgMhB577vzTDqypH360= github.com/gobuffalo/helpers v0.2.2/go.mod h1:xYbzUdCUpVzLwLnqV8HIjT6hmG0Cs7YIBCJkNM597jw= github.com/gobuffalo/helpers v0.2.4/go.mod h1:NX7v27yxPDOPTgUFYmJ5ow37EbxdoLraucOGvMNawyk= @@ -399,6 +443,7 @@ github.com/gobuffalo/packd v0.0.0-20181124090624-311c6248e5fb/go.mod h1:Foenia9Z github.com/gobuffalo/packd v0.0.0-20181207120301-c49825f8f6f4/go.mod h1:LYc0TGKFBBFTRC9dg2pcRcMqGCTMD7T2BIMP7OBuQAA= github.com/gobuffalo/packd v0.0.0-20181212173646-eca3b8fd6687 h1:uZ+G4JprR0UEq0aHZs+6eP7TEZuFfrIkmQWejIBV/QQ= github.com/gobuffalo/packd v0.0.0-20181212173646-eca3b8fd6687/go.mod h1:LYc0TGKFBBFTRC9dg2pcRcMqGCTMD7T2BIMP7OBuQAA= +github.com/gobuffalo/packd v0.0.0-20190315124812-a385830c7fc0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= github.com/gobuffalo/packd v0.2.0/go.mod h1:k2CkHP3bjbqL2GwxwhxUy1DgnlbW644hkLC9iIUvZwY= github.com/gobuffalo/packd v0.3.0/go.mod h1:zC7QkmNkYVGKPw4tHpBQ+ml7W/3tIebgeo1b36chA3Q= @@ -421,6 +466,8 @@ github.com/gobuffalo/packr/v2 v2.0.0-rc.13/go.mod h1:2Mp7GhBFMdJlOK8vGfl7SYtfMP3 github.com/gobuffalo/packr/v2 v2.0.0-rc.14/go.mod h1:06otbrNvDKO1eNQ3b8hst+1010UooI2MFg+B2Ze4MV8= github.com/gobuffalo/packr/v2 v2.0.0-rc.15 h1:vSmYcMO6CtuNQvMSbEJeIJlaeZzz2zoxGLTy8HrDh80= github.com/gobuffalo/packr/v2 v2.0.0-rc.15/go.mod h1:IMe7H2nJvcKXSF90y4X1rjYIRlNMJYCxEhssBXNZwWs= +github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= +github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= github.com/gobuffalo/packr/v2 v2.4.0/go.mod h1:ra341gygw9/61nSjAbfwcwh8IrYL4WmR4IsPkPBhQiY= github.com/gobuffalo/packr/v2 v2.5.2/go.mod h1:sgEE1xNZ6G0FNN5xn9pevVu4nywaxHvgup67xisti08= github.com/gobuffalo/packr/v2 v2.7.1 h1:n3CIW5T17T8v4GGK5sWXLVWJhCz7b5aNLSxW6gYim4o= @@ -516,6 +563,15 @@ github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/gomarkdown/markdown v0.0.0-20200609195525-3f9352745725 h1:X6sZdr+t2E2jwajTy/FfXbmAKPFTYxEq9hiFgzMiuPQ= github.com/gomarkdown/markdown v0.0.0-20200609195525-3f9352745725/go.mod h1:aii0r/K0ZnHv7G0KF7xy1v0A7s2Ljrb5byB7MO5p6TU= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -526,6 +582,8 @@ github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0 h1:/QaMHBdZ26BB3SSst0Iwl10Epc+xhTquomWX0oZEB6w= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= @@ -662,6 +720,7 @@ github.com/karrick/godirwalk v1.7.5/go.mod h1:2c9FRhkDxdIbgkOnCEvnSWs71Bhugbl46s github.com/karrick/godirwalk v1.7.7/go.mod h1:2c9FRhkDxdIbgkOnCEvnSWs71Bhugbl46shStcFDJ34= github.com/karrick/godirwalk v1.7.8 h1:VfG72pyIxgtC7+3X9CMHI0AOl4LwyRAg98WAgsvffi8= github.com/karrick/godirwalk v1.7.8/go.mod h1:2c9FRhkDxdIbgkOnCEvnSWs71Bhugbl46shStcFDJ34= +github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= github.com/karrick/godirwalk v1.10.9/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= github.com/karrick/godirwalk v1.10.12/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= @@ -670,13 +729,16 @@ github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNU github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/kevinburke/go-bindata v3.16.0+incompatible/go.mod h1:/pEEZ72flUW2p0yi30bslSp9YqD9pysLxunQDdb2CPM= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/konsorten/go-windows-terminal-sequences v0.0.0-20180402223658-b729f2633dfe/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= @@ -688,6 +750,8 @@ github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/lib/pq v0.0.0-20180327071824-d34b9ff171c2/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.0.0 h1:X5PMW56eZitiTeO7tKzZxFCSpbFZJtkMMooicw2us9A= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= @@ -707,6 +771,8 @@ github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e h1:hB2xlXdHp/pmPZq0y3QnmWAArdw9PqbmotexnWx/FU8= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.7.1 h1:mdxE1MF9o53iCb2Ghj1VfWvh7ZOwHpnVG/xwXrV90U8= +github.com/mailru/easyjson v0.7.1/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= github.com/markbates/deplist v1.0.4/go.mod h1:gRRbPbbuA8TmMiRvaOzUlRfzfjeCCBqX2A6arxN01MM= github.com/markbates/deplist v1.0.5/go.mod h1:gRRbPbbuA8TmMiRvaOzUlRfzfjeCCBqX2A6arxN01MM= github.com/markbates/deplist v1.1.3/go.mod h1:BF7ioVzAJYEtzQN/os4rt8H8Ti3h0T7EoN+7eyALktE= @@ -788,9 +854,12 @@ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3Rllmb github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= github.com/monoculum/formam v0.0.0-20180901015400-4e68be1d79ba/go.mod h1:RKgILGEJq24YyJ2ban8EO0RUVSJlF1pGsEvoLEACr/Q= +github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/moul/http2curl v0.0.0-20170919181001-9ac6cf4d929b/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nicksnyder/go-i18n v1.10.0/go.mod h1:HrK7VCrbOvQoUAQ7Vpy7i87N7JZZZ7R2xBGjv0j365Q= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/oleiade/reflections v1.0.0 h1:0ir4pc6v8/PJ0yw5AEtMddfXpWBXg9cnG7SgSoJuCgY= github.com/oleiade/reflections v1.0.0/go.mod h1:RbATFBbKYkVdqmSFtx13Bb/tVhR0lgOBXunWTZKeL4w= @@ -890,6 +959,7 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1 h1:F++O52m40owAmADcojzM+9gyjmMOY/T4oYJkgFDH8RE= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= +github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= @@ -971,6 +1041,7 @@ github.com/sirupsen/logrus v1.1.0/go.mod h1:zrgwTnHtNr00buQ1vSptGe8m1f/BbgsPukg8 github.com/sirupsen/logrus v1.1.1/go.mod h1:zrgwTnHtNr00buQ1vSptGe8m1f/BbgsPukg8qsT7A+A= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.3.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= @@ -994,6 +1065,8 @@ github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B github.com/spf13/afero v1.2.0/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= +github.com/spf13/afero v1.3.2 h1:GDarE4TJQI52kYSbSAmLiId1Elfj+xgSDqrUZxFhxlU= +github.com/spf13/afero v1.3.2/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= github.com/spf13/cast v1.2.0/go.mod h1:r2rcYCSwa1IExKTDiTfzaxqT2FNHs8hODu4LnUfgKEg= github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= @@ -1034,6 +1107,8 @@ github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJy github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/subosito/gotenv v1.1.1/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= @@ -1068,6 +1143,8 @@ github.com/unrolled/secure v0.0.0-20180918153822-f340ee86eb8b/go.mod h1:mnPT77IA github.com/unrolled/secure v0.0.0-20181005190816-ff9db2ff917f/go.mod h1:mnPT77IAdsi/kV7+Es7y+pXALeV3h7G6dQF6mNYjcLA= github.com/urfave/negroni v1.0.0 h1:kIimOitoypq34K7TG7DUaJ9kq/N4Ofuwi1sjz0KipXc= github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= +github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= +github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo= github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= @@ -1076,12 +1153,17 @@ github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1: github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c h1:3lbZUMbMiGUW/LMkfsEABsc5zNT9+b1CvsJx47JzJ8g= github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c/go.mod h1:UrdRz5enIKZ63MEE3IF9l2/ebyx59GyGgPi+tICQdmM= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.1.1 h1:Sq1fR+0c58RME5EoqKdjkiQAmPjmfHlZOoRI6fTUOcs= go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= +go.mongodb.org/mongo-driver v1.3.0/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= +go.mongodb.org/mongo-driver v1.3.4/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= +go.mongodb.org/mongo-driver v1.3.5 h1:S0ZOruh4YGHjD7JoN7mIsTrNjnQbOjrmgrx6l6pZN7I= +go.mongodb.org/mongo-driver v1.3.5/go.mod h1:Ual6Gkco7ZGQw8wE1t4tLnvBsf6yVSM60qW6TgOeJ5c= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.1/go.mod h1:Ap50jQcDJrx6rB6VgeeFPtuPIf3wMRvRfrfYDO6+BmA= @@ -1117,6 +1199,7 @@ golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -1134,6 +1217,9 @@ golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59 h1:3zb4D3T4G8jdExgVU/95+v golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37 h1:cg5LA/zNPRzIXIWSCxQW10Rvpy94aQh3LT/ShoCpkHw= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899 h1:DZhuSZLsGlFL4CmhA8BcRA0mnthyA/nZ00AqCUo7vHg= +golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1163,6 +1249,8 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee h1:WG0RUwxtNT4qqaXX3DPA8zH golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0 h1:KU7oHjnv3XNWfa5COkzUifxZmxp1TyI7ImMXqFxLwvQ= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180816102801-aaf60122140d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1202,21 +1290,30 @@ golang.org/x/net v0.0.0-20200226121028-0de0cce0169b h1:0mm1VjtFUOIlE1SbDlwjYaDxZ golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e h1:3G+cUijn7XD+S4eJFddp53Pv7+slrESplyjG25HgL+k= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381 h1:VXak5I6aEWmAXeQjA+QSZzlgNrpq9mjcfDemuexIKsU= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181003184128-c57b0facaced/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a h1:WXEvlFVvvGxCJLG6REjsT03iWnKLEWinaScsxF2Vm2o= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 h1:qwRHBd0NqMbJxfbotnDhm2ByMI1Shq4Y6oRJo21SGJA= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180816055513-1c9583448a9c/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1246,10 +1343,12 @@ golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190515120540-06a5c4944438/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1271,10 +1370,14 @@ golang.org/x/sys v0.0.0-20200331124033-c3d80250170d h1:nc5K6ox/4lTFbMVSL9WRR81ix golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980 h1:OjiUf46hAmXblsZdnoSXsEUSKU8r1UEzcL5RVZ4gO9Y= golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae h1:Ih9Yo4hSPImZOpfGuA4bR/ORKTAbhZo2AbWNRCnevdo= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1287,6 +1390,7 @@ golang.org/x/tools v0.0.0-20181013182035-5e66757b835f/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20181017214349-06f26fdaaa28/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181024171208-a2dc47679d30/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181026183834-f60e5f99f081/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181105230042-78dc5bac0cac/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181107215632-34b416bd17b3/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181114190951-94339b83286c/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1309,10 +1413,14 @@ golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3 golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190420181800-aa740d480789/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190613204242-ed0dc450797f/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= @@ -1338,6 +1446,8 @@ golang.org/x/tools v0.0.0-20200203215610-ab391d50b528 h1:iINh7uA444sE+iZXG/dsGMW golang.org/x/tools v0.0.0-20200203215610-ab391d50b528/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200325203130-f53864d0dba1 h1:odiryKYJy7CjdrZxhrcE1Z8L9+kGyGZOnfpuauvdCeU= golang.org/x/tools v0.0.0-20200325203130-f53864d0dba1/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200717024301-6ddee64345a6 h1:nULzSsKgihxFGLnQFv2T7lE5vIhOtg8ZPpJHapEt7o0= +golang.org/x/tools v0.0.0-20200717024301-6ddee64345a6/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1365,6 +1475,8 @@ google.golang.org/appengine v1.6.2 h1:j8RI1yW0SkI+paT6uGwMlrMI/6zwYA6/CFil8rxOzG google.golang.org/appengine v1.6.2/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5 h1:tycE03LOZYQNhDpS27tcQdAzLCVMaj7QT2SXxebnpCM= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -1378,6 +1490,8 @@ google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBr google.golang.org/genproto v0.0.0-20191009194640-548a555dbc03/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a h1:Ob5/580gVHBJZgXnff1cZDbG+xLtMVE5mDRTe+nIsX4= google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -1385,10 +1499,21 @@ google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ij google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.1 h1:zvIju4sqAGvwKspUQOhwnpcqSbzi7/H6QomNNjTL4sk= google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.29.1 h1:EC2SB8S04d2r73uptxphDSUG+kTKVgjRPF+N3xpxRB4= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc/go.mod h1:m7x9LTH6d71AHyAX77c9yqWCCa3UKHcVEj9y7hAtKDk= @@ -1397,6 +1522,8 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= @@ -1417,6 +1544,8 @@ gopkg.in/square/go-jose.v2 v2.1.9/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76 gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/square/go-jose.v2 v2.3.1 h1:SK5KegNXmKmqE342YYN2qPHEnUYeoMiXXl1poUlI+o4= gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= +gopkg.in/square/go-jose.v2 v2.5.1 h1:7odma5RETjNHWJnR32wx8t+Io4djHE1PqxCFx3iiZ2w= +gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/validator.v2 v2.0.0-20180514200540-135c24b11c19/go.mod h1:o4V0GXN9/CAmCsvJ0oXYZvrZOe7syiDZSN1GWGZTGzc= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= @@ -1430,6 +1559,10 @@ gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ= +gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/internal/httpclient/client/api/api_client.go b/internal/httpclient/client/api/api_client.go index dc36169d54..d2636d26f5 100644 --- a/internal/httpclient/client/api/api_client.go +++ b/internal/httpclient/client/api/api_client.go @@ -27,55 +27,17 @@ type Client struct { // ClientService is the interface for Client methods type ClientService interface { - Decisions(params *DecisionsParams) (*DecisionsOK, error) - GetRule(params *GetRuleParams) (*GetRuleOK, error) GetWellKnownJSONWebKeys(params *GetWellKnownJSONWebKeysParams) (*GetWellKnownJSONWebKeysOK, error) ListRules(params *ListRulesParams) (*ListRulesOK, error) - SetTransport(transport runtime.ClientTransport) -} - -/* - Decisions accesses control decision API - - > This endpoint works with all HTTP Methods (GET, POST, PUT, ...) and matches every path prefixed with /decision. + MakeGenericDecision(params *MakeGenericDecisionParams) (*MakeGenericDecisionOK, error) -This endpoint mirrors the proxy capability of ORY Oathkeeper's proxy functionality but instead of forwarding the -request to the upstream server, returns 200 (request should be allowed), 401 (unauthorized), or 403 (forbidden) -status codes. This endpoint can be used to integrate with other API Proxies like Ambassador, Kong, Envoy, and many more. -*/ -func (a *Client) Decisions(params *DecisionsParams) (*DecisionsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDecisionsParams() - } + MakeTraefikDecision(params *MakeTraefikDecisionParams) (*MakeTraefikDecisionOK, error) - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "decisions", - Method: "GET", - PathPattern: "/decisions", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &DecisionsReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - success, ok := result.(*DecisionsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for decisions: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) + SetTransport(transport runtime.ClientTransport) } /* @@ -187,6 +149,84 @@ func (a *Client) ListRules(params *ListRulesParams) (*ListRulesOK, error) { panic(msg) } +/* + MakeGenericDecision accesses control generic decision API + + > This endpoint works with all HTTP Methods (GET, POST, PUT, ...) and matches every path prefixed with /decision. + +This endpoint mirrors the proxy capability of ORY Oathkeeper's proxy functionality but instead of forwarding the +request to the upstream server, returns 200 (request should be allowed), 401 (unauthorized), or 403 (forbidden) +status codes. This endpoint can be used to integrate with other API Proxies like Ambassador, Kong, Envoy, and many more. +*/ +func (a *Client) MakeGenericDecision(params *MakeGenericDecisionParams) (*MakeGenericDecisionOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewMakeGenericDecisionParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "makeGenericDecision", + Method: "GET", + PathPattern: "/decisions/generic", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &MakeGenericDecisionReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*MakeGenericDecisionOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for makeGenericDecision: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + MakeTraefikDecision accesses control decision traefik API + + This endpoint mirrors the proxy capability of ORY Oathkeeper's proxy functionality but instead of forwarding the +request to the upstream server, returns 200 (request should be allowed), 401 (unauthorized), or 403 (forbidden) +status codes. This endpoint can be used to integrate with the Traefik proxy. +*/ +func (a *Client) MakeTraefikDecision(params *MakeTraefikDecisionParams) (*MakeTraefikDecisionOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewMakeTraefikDecisionParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "makeTraefikDecision", + Method: "GET", + PathPattern: "/decisions/traefik", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &MakeTraefikDecisionReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*MakeTraefikDecisionOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for makeTraefikDecision: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + // SetTransport changes the transport on the client func (a *Client) SetTransport(transport runtime.ClientTransport) { a.transport = transport diff --git a/internal/httpclient/client/api/decisions_parameters.go b/internal/httpclient/client/api/decisions_parameters.go deleted file mode 100644 index 370e75873b..0000000000 --- a/internal/httpclient/client/api/decisions_parameters.go +++ /dev/null @@ -1,112 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package api - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDecisionsParams creates a new DecisionsParams object -// with the default values initialized. -func NewDecisionsParams() *DecisionsParams { - - return &DecisionsParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewDecisionsParamsWithTimeout creates a new DecisionsParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewDecisionsParamsWithTimeout(timeout time.Duration) *DecisionsParams { - - return &DecisionsParams{ - - timeout: timeout, - } -} - -// NewDecisionsParamsWithContext creates a new DecisionsParams object -// with the default values initialized, and the ability to set a context for a request -func NewDecisionsParamsWithContext(ctx context.Context) *DecisionsParams { - - return &DecisionsParams{ - - Context: ctx, - } -} - -// NewDecisionsParamsWithHTTPClient creates a new DecisionsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewDecisionsParamsWithHTTPClient(client *http.Client) *DecisionsParams { - - return &DecisionsParams{ - HTTPClient: client, - } -} - -/*DecisionsParams contains all the parameters to send to the API endpoint -for the decisions operation typically these are written to a http.Request -*/ -type DecisionsParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the decisions params -func (o *DecisionsParams) WithTimeout(timeout time.Duration) *DecisionsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the decisions params -func (o *DecisionsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the decisions params -func (o *DecisionsParams) WithContext(ctx context.Context) *DecisionsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the decisions params -func (o *DecisionsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the decisions params -func (o *DecisionsParams) WithHTTPClient(client *http.Client) *DecisionsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the decisions params -func (o *DecisionsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *DecisionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/internal/httpclient/client/api/decisions_responses.go b/internal/httpclient/client/api/decisions_responses.go deleted file mode 100644 index 394d8bde5d..0000000000 --- a/internal/httpclient/client/api/decisions_responses.go +++ /dev/null @@ -1,400 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package api - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// DecisionsReader is a Reader for the Decisions structure. -type DecisionsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DecisionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDecisionsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewDecisionsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewDecisionsForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDecisionsNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewDecisionsInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDecisionsOK creates a DecisionsOK with default headers values -func NewDecisionsOK() *DecisionsOK { - return &DecisionsOK{} -} - -/*DecisionsOK handles this case with default header values. - -An empty response -*/ -type DecisionsOK struct { -} - -func (o *DecisionsOK) Error() string { - return fmt.Sprintf("[GET /decisions][%d] decisionsOK ", 200) -} - -func (o *DecisionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewDecisionsUnauthorized creates a DecisionsUnauthorized with default headers values -func NewDecisionsUnauthorized() *DecisionsUnauthorized { - return &DecisionsUnauthorized{} -} - -/*DecisionsUnauthorized handles this case with default header values. - -The standard error format -*/ -type DecisionsUnauthorized struct { - Payload *DecisionsUnauthorizedBody -} - -func (o *DecisionsUnauthorized) Error() string { - return fmt.Sprintf("[GET /decisions][%d] decisionsUnauthorized %+v", 401, o.Payload) -} - -func (o *DecisionsUnauthorized) GetPayload() *DecisionsUnauthorizedBody { - return o.Payload -} - -func (o *DecisionsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(DecisionsUnauthorizedBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDecisionsForbidden creates a DecisionsForbidden with default headers values -func NewDecisionsForbidden() *DecisionsForbidden { - return &DecisionsForbidden{} -} - -/*DecisionsForbidden handles this case with default header values. - -The standard error format -*/ -type DecisionsForbidden struct { - Payload *DecisionsForbiddenBody -} - -func (o *DecisionsForbidden) Error() string { - return fmt.Sprintf("[GET /decisions][%d] decisionsForbidden %+v", 403, o.Payload) -} - -func (o *DecisionsForbidden) GetPayload() *DecisionsForbiddenBody { - return o.Payload -} - -func (o *DecisionsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(DecisionsForbiddenBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDecisionsNotFound creates a DecisionsNotFound with default headers values -func NewDecisionsNotFound() *DecisionsNotFound { - return &DecisionsNotFound{} -} - -/*DecisionsNotFound handles this case with default header values. - -The standard error format -*/ -type DecisionsNotFound struct { - Payload *DecisionsNotFoundBody -} - -func (o *DecisionsNotFound) Error() string { - return fmt.Sprintf("[GET /decisions][%d] decisionsNotFound %+v", 404, o.Payload) -} - -func (o *DecisionsNotFound) GetPayload() *DecisionsNotFoundBody { - return o.Payload -} - -func (o *DecisionsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(DecisionsNotFoundBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDecisionsInternalServerError creates a DecisionsInternalServerError with default headers values -func NewDecisionsInternalServerError() *DecisionsInternalServerError { - return &DecisionsInternalServerError{} -} - -/*DecisionsInternalServerError handles this case with default header values. - -The standard error format -*/ -type DecisionsInternalServerError struct { - Payload *DecisionsInternalServerErrorBody -} - -func (o *DecisionsInternalServerError) Error() string { - return fmt.Sprintf("[GET /decisions][%d] decisionsInternalServerError %+v", 500, o.Payload) -} - -func (o *DecisionsInternalServerError) GetPayload() *DecisionsInternalServerErrorBody { - return o.Payload -} - -func (o *DecisionsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(DecisionsInternalServerErrorBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/*DecisionsForbiddenBody decisions forbidden body -swagger:model DecisionsForbiddenBody -*/ -type DecisionsForbiddenBody struct { - - // code - Code int64 `json:"code,omitempty"` - - // details - Details []interface{} `json:"details"` - - // message - Message string `json:"message,omitempty"` - - // reason - Reason string `json:"reason,omitempty"` - - // request - Request string `json:"request,omitempty"` - - // status - Status string `json:"status,omitempty"` -} - -// Validate validates this decisions forbidden body -func (o *DecisionsForbiddenBody) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *DecisionsForbiddenBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *DecisionsForbiddenBody) UnmarshalBinary(b []byte) error { - var res DecisionsForbiddenBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/*DecisionsInternalServerErrorBody decisions internal server error body -swagger:model DecisionsInternalServerErrorBody -*/ -type DecisionsInternalServerErrorBody struct { - - // code - Code int64 `json:"code,omitempty"` - - // details - Details []interface{} `json:"details"` - - // message - Message string `json:"message,omitempty"` - - // reason - Reason string `json:"reason,omitempty"` - - // request - Request string `json:"request,omitempty"` - - // status - Status string `json:"status,omitempty"` -} - -// Validate validates this decisions internal server error body -func (o *DecisionsInternalServerErrorBody) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *DecisionsInternalServerErrorBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *DecisionsInternalServerErrorBody) UnmarshalBinary(b []byte) error { - var res DecisionsInternalServerErrorBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/*DecisionsNotFoundBody decisions not found body -swagger:model DecisionsNotFoundBody -*/ -type DecisionsNotFoundBody struct { - - // code - Code int64 `json:"code,omitempty"` - - // details - Details []interface{} `json:"details"` - - // message - Message string `json:"message,omitempty"` - - // reason - Reason string `json:"reason,omitempty"` - - // request - Request string `json:"request,omitempty"` - - // status - Status string `json:"status,omitempty"` -} - -// Validate validates this decisions not found body -func (o *DecisionsNotFoundBody) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *DecisionsNotFoundBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *DecisionsNotFoundBody) UnmarshalBinary(b []byte) error { - var res DecisionsNotFoundBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/*DecisionsUnauthorizedBody decisions unauthorized body -swagger:model DecisionsUnauthorizedBody -*/ -type DecisionsUnauthorizedBody struct { - - // code - Code int64 `json:"code,omitempty"` - - // details - Details []interface{} `json:"details"` - - // message - Message string `json:"message,omitempty"` - - // reason - Reason string `json:"reason,omitempty"` - - // request - Request string `json:"request,omitempty"` - - // status - Status string `json:"status,omitempty"` -} - -// Validate validates this decisions unauthorized body -func (o *DecisionsUnauthorizedBody) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *DecisionsUnauthorizedBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *DecisionsUnauthorizedBody) UnmarshalBinary(b []byte) error { - var res DecisionsUnauthorizedBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/internal/httpclient/client/api/make_generic_decision_parameters.go b/internal/httpclient/client/api/make_generic_decision_parameters.go new file mode 100644 index 0000000000..4cc7ccfcb2 --- /dev/null +++ b/internal/httpclient/client/api/make_generic_decision_parameters.go @@ -0,0 +1,112 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package api + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewMakeGenericDecisionParams creates a new MakeGenericDecisionParams object +// with the default values initialized. +func NewMakeGenericDecisionParams() *MakeGenericDecisionParams { + + return &MakeGenericDecisionParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewMakeGenericDecisionParamsWithTimeout creates a new MakeGenericDecisionParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewMakeGenericDecisionParamsWithTimeout(timeout time.Duration) *MakeGenericDecisionParams { + + return &MakeGenericDecisionParams{ + + timeout: timeout, + } +} + +// NewMakeGenericDecisionParamsWithContext creates a new MakeGenericDecisionParams object +// with the default values initialized, and the ability to set a context for a request +func NewMakeGenericDecisionParamsWithContext(ctx context.Context) *MakeGenericDecisionParams { + + return &MakeGenericDecisionParams{ + + Context: ctx, + } +} + +// NewMakeGenericDecisionParamsWithHTTPClient creates a new MakeGenericDecisionParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewMakeGenericDecisionParamsWithHTTPClient(client *http.Client) *MakeGenericDecisionParams { + + return &MakeGenericDecisionParams{ + HTTPClient: client, + } +} + +/*MakeGenericDecisionParams contains all the parameters to send to the API endpoint +for the make generic decision operation typically these are written to a http.Request +*/ +type MakeGenericDecisionParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the make generic decision params +func (o *MakeGenericDecisionParams) WithTimeout(timeout time.Duration) *MakeGenericDecisionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the make generic decision params +func (o *MakeGenericDecisionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the make generic decision params +func (o *MakeGenericDecisionParams) WithContext(ctx context.Context) *MakeGenericDecisionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the make generic decision params +func (o *MakeGenericDecisionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the make generic decision params +func (o *MakeGenericDecisionParams) WithHTTPClient(client *http.Client) *MakeGenericDecisionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the make generic decision params +func (o *MakeGenericDecisionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *MakeGenericDecisionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/internal/httpclient/client/api/make_generic_decision_responses.go b/internal/httpclient/client/api/make_generic_decision_responses.go new file mode 100644 index 0000000000..55d9e2d871 --- /dev/null +++ b/internal/httpclient/client/api/make_generic_decision_responses.go @@ -0,0 +1,400 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package api + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// MakeGenericDecisionReader is a Reader for the MakeGenericDecision structure. +type MakeGenericDecisionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *MakeGenericDecisionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewMakeGenericDecisionOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewMakeGenericDecisionUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewMakeGenericDecisionForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewMakeGenericDecisionNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewMakeGenericDecisionInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewMakeGenericDecisionOK creates a MakeGenericDecisionOK with default headers values +func NewMakeGenericDecisionOK() *MakeGenericDecisionOK { + return &MakeGenericDecisionOK{} +} + +/*MakeGenericDecisionOK handles this case with default header values. + +An empty response +*/ +type MakeGenericDecisionOK struct { +} + +func (o *MakeGenericDecisionOK) Error() string { + return fmt.Sprintf("[GET /decisions/generic][%d] makeGenericDecisionOK ", 200) +} + +func (o *MakeGenericDecisionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewMakeGenericDecisionUnauthorized creates a MakeGenericDecisionUnauthorized with default headers values +func NewMakeGenericDecisionUnauthorized() *MakeGenericDecisionUnauthorized { + return &MakeGenericDecisionUnauthorized{} +} + +/*MakeGenericDecisionUnauthorized handles this case with default header values. + +The standard error format +*/ +type MakeGenericDecisionUnauthorized struct { + Payload *MakeGenericDecisionUnauthorizedBody +} + +func (o *MakeGenericDecisionUnauthorized) Error() string { + return fmt.Sprintf("[GET /decisions/generic][%d] makeGenericDecisionUnauthorized %+v", 401, o.Payload) +} + +func (o *MakeGenericDecisionUnauthorized) GetPayload() *MakeGenericDecisionUnauthorizedBody { + return o.Payload +} + +func (o *MakeGenericDecisionUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(MakeGenericDecisionUnauthorizedBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewMakeGenericDecisionForbidden creates a MakeGenericDecisionForbidden with default headers values +func NewMakeGenericDecisionForbidden() *MakeGenericDecisionForbidden { + return &MakeGenericDecisionForbidden{} +} + +/*MakeGenericDecisionForbidden handles this case with default header values. + +The standard error format +*/ +type MakeGenericDecisionForbidden struct { + Payload *MakeGenericDecisionForbiddenBody +} + +func (o *MakeGenericDecisionForbidden) Error() string { + return fmt.Sprintf("[GET /decisions/generic][%d] makeGenericDecisionForbidden %+v", 403, o.Payload) +} + +func (o *MakeGenericDecisionForbidden) GetPayload() *MakeGenericDecisionForbiddenBody { + return o.Payload +} + +func (o *MakeGenericDecisionForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(MakeGenericDecisionForbiddenBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewMakeGenericDecisionNotFound creates a MakeGenericDecisionNotFound with default headers values +func NewMakeGenericDecisionNotFound() *MakeGenericDecisionNotFound { + return &MakeGenericDecisionNotFound{} +} + +/*MakeGenericDecisionNotFound handles this case with default header values. + +The standard error format +*/ +type MakeGenericDecisionNotFound struct { + Payload *MakeGenericDecisionNotFoundBody +} + +func (o *MakeGenericDecisionNotFound) Error() string { + return fmt.Sprintf("[GET /decisions/generic][%d] makeGenericDecisionNotFound %+v", 404, o.Payload) +} + +func (o *MakeGenericDecisionNotFound) GetPayload() *MakeGenericDecisionNotFoundBody { + return o.Payload +} + +func (o *MakeGenericDecisionNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(MakeGenericDecisionNotFoundBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewMakeGenericDecisionInternalServerError creates a MakeGenericDecisionInternalServerError with default headers values +func NewMakeGenericDecisionInternalServerError() *MakeGenericDecisionInternalServerError { + return &MakeGenericDecisionInternalServerError{} +} + +/*MakeGenericDecisionInternalServerError handles this case with default header values. + +The standard error format +*/ +type MakeGenericDecisionInternalServerError struct { + Payload *MakeGenericDecisionInternalServerErrorBody +} + +func (o *MakeGenericDecisionInternalServerError) Error() string { + return fmt.Sprintf("[GET /decisions/generic][%d] makeGenericDecisionInternalServerError %+v", 500, o.Payload) +} + +func (o *MakeGenericDecisionInternalServerError) GetPayload() *MakeGenericDecisionInternalServerErrorBody { + return o.Payload +} + +func (o *MakeGenericDecisionInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(MakeGenericDecisionInternalServerErrorBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +/*MakeGenericDecisionForbiddenBody make generic decision forbidden body +swagger:model MakeGenericDecisionForbiddenBody +*/ +type MakeGenericDecisionForbiddenBody struct { + + // code + Code int64 `json:"code,omitempty"` + + // details + Details []interface{} `json:"details"` + + // message + Message string `json:"message,omitempty"` + + // reason + Reason string `json:"reason,omitempty"` + + // request + Request string `json:"request,omitempty"` + + // status + Status string `json:"status,omitempty"` +} + +// Validate validates this make generic decision forbidden body +func (o *MakeGenericDecisionForbiddenBody) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *MakeGenericDecisionForbiddenBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *MakeGenericDecisionForbiddenBody) UnmarshalBinary(b []byte) error { + var res MakeGenericDecisionForbiddenBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*MakeGenericDecisionInternalServerErrorBody make generic decision internal server error body +swagger:model MakeGenericDecisionInternalServerErrorBody +*/ +type MakeGenericDecisionInternalServerErrorBody struct { + + // code + Code int64 `json:"code,omitempty"` + + // details + Details []interface{} `json:"details"` + + // message + Message string `json:"message,omitempty"` + + // reason + Reason string `json:"reason,omitempty"` + + // request + Request string `json:"request,omitempty"` + + // status + Status string `json:"status,omitempty"` +} + +// Validate validates this make generic decision internal server error body +func (o *MakeGenericDecisionInternalServerErrorBody) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *MakeGenericDecisionInternalServerErrorBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *MakeGenericDecisionInternalServerErrorBody) UnmarshalBinary(b []byte) error { + var res MakeGenericDecisionInternalServerErrorBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*MakeGenericDecisionNotFoundBody make generic decision not found body +swagger:model MakeGenericDecisionNotFoundBody +*/ +type MakeGenericDecisionNotFoundBody struct { + + // code + Code int64 `json:"code,omitempty"` + + // details + Details []interface{} `json:"details"` + + // message + Message string `json:"message,omitempty"` + + // reason + Reason string `json:"reason,omitempty"` + + // request + Request string `json:"request,omitempty"` + + // status + Status string `json:"status,omitempty"` +} + +// Validate validates this make generic decision not found body +func (o *MakeGenericDecisionNotFoundBody) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *MakeGenericDecisionNotFoundBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *MakeGenericDecisionNotFoundBody) UnmarshalBinary(b []byte) error { + var res MakeGenericDecisionNotFoundBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*MakeGenericDecisionUnauthorizedBody make generic decision unauthorized body +swagger:model MakeGenericDecisionUnauthorizedBody +*/ +type MakeGenericDecisionUnauthorizedBody struct { + + // code + Code int64 `json:"code,omitempty"` + + // details + Details []interface{} `json:"details"` + + // message + Message string `json:"message,omitempty"` + + // reason + Reason string `json:"reason,omitempty"` + + // request + Request string `json:"request,omitempty"` + + // status + Status string `json:"status,omitempty"` +} + +// Validate validates this make generic decision unauthorized body +func (o *MakeGenericDecisionUnauthorizedBody) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *MakeGenericDecisionUnauthorizedBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *MakeGenericDecisionUnauthorizedBody) UnmarshalBinary(b []byte) error { + var res MakeGenericDecisionUnauthorizedBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/internal/httpclient/client/api/make_traefik_decision_parameters.go b/internal/httpclient/client/api/make_traefik_decision_parameters.go new file mode 100644 index 0000000000..039eb4ab81 --- /dev/null +++ b/internal/httpclient/client/api/make_traefik_decision_parameters.go @@ -0,0 +1,112 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package api + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewMakeTraefikDecisionParams creates a new MakeTraefikDecisionParams object +// with the default values initialized. +func NewMakeTraefikDecisionParams() *MakeTraefikDecisionParams { + + return &MakeTraefikDecisionParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewMakeTraefikDecisionParamsWithTimeout creates a new MakeTraefikDecisionParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewMakeTraefikDecisionParamsWithTimeout(timeout time.Duration) *MakeTraefikDecisionParams { + + return &MakeTraefikDecisionParams{ + + timeout: timeout, + } +} + +// NewMakeTraefikDecisionParamsWithContext creates a new MakeTraefikDecisionParams object +// with the default values initialized, and the ability to set a context for a request +func NewMakeTraefikDecisionParamsWithContext(ctx context.Context) *MakeTraefikDecisionParams { + + return &MakeTraefikDecisionParams{ + + Context: ctx, + } +} + +// NewMakeTraefikDecisionParamsWithHTTPClient creates a new MakeTraefikDecisionParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewMakeTraefikDecisionParamsWithHTTPClient(client *http.Client) *MakeTraefikDecisionParams { + + return &MakeTraefikDecisionParams{ + HTTPClient: client, + } +} + +/*MakeTraefikDecisionParams contains all the parameters to send to the API endpoint +for the make traefik decision operation typically these are written to a http.Request +*/ +type MakeTraefikDecisionParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the make traefik decision params +func (o *MakeTraefikDecisionParams) WithTimeout(timeout time.Duration) *MakeTraefikDecisionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the make traefik decision params +func (o *MakeTraefikDecisionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the make traefik decision params +func (o *MakeTraefikDecisionParams) WithContext(ctx context.Context) *MakeTraefikDecisionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the make traefik decision params +func (o *MakeTraefikDecisionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the make traefik decision params +func (o *MakeTraefikDecisionParams) WithHTTPClient(client *http.Client) *MakeTraefikDecisionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the make traefik decision params +func (o *MakeTraefikDecisionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *MakeTraefikDecisionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/internal/httpclient/client/api/make_traefik_decision_responses.go b/internal/httpclient/client/api/make_traefik_decision_responses.go new file mode 100644 index 0000000000..3114d23478 --- /dev/null +++ b/internal/httpclient/client/api/make_traefik_decision_responses.go @@ -0,0 +1,400 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package api + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// MakeTraefikDecisionReader is a Reader for the MakeTraefikDecision structure. +type MakeTraefikDecisionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *MakeTraefikDecisionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewMakeTraefikDecisionOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewMakeTraefikDecisionUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewMakeTraefikDecisionForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewMakeTraefikDecisionNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewMakeTraefikDecisionInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewMakeTraefikDecisionOK creates a MakeTraefikDecisionOK with default headers values +func NewMakeTraefikDecisionOK() *MakeTraefikDecisionOK { + return &MakeTraefikDecisionOK{} +} + +/*MakeTraefikDecisionOK handles this case with default header values. + +An empty response +*/ +type MakeTraefikDecisionOK struct { +} + +func (o *MakeTraefikDecisionOK) Error() string { + return fmt.Sprintf("[GET /decisions/traefik][%d] makeTraefikDecisionOK ", 200) +} + +func (o *MakeTraefikDecisionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewMakeTraefikDecisionUnauthorized creates a MakeTraefikDecisionUnauthorized with default headers values +func NewMakeTraefikDecisionUnauthorized() *MakeTraefikDecisionUnauthorized { + return &MakeTraefikDecisionUnauthorized{} +} + +/*MakeTraefikDecisionUnauthorized handles this case with default header values. + +The standard error format +*/ +type MakeTraefikDecisionUnauthorized struct { + Payload *MakeTraefikDecisionUnauthorizedBody +} + +func (o *MakeTraefikDecisionUnauthorized) Error() string { + return fmt.Sprintf("[GET /decisions/traefik][%d] makeTraefikDecisionUnauthorized %+v", 401, o.Payload) +} + +func (o *MakeTraefikDecisionUnauthorized) GetPayload() *MakeTraefikDecisionUnauthorizedBody { + return o.Payload +} + +func (o *MakeTraefikDecisionUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(MakeTraefikDecisionUnauthorizedBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewMakeTraefikDecisionForbidden creates a MakeTraefikDecisionForbidden with default headers values +func NewMakeTraefikDecisionForbidden() *MakeTraefikDecisionForbidden { + return &MakeTraefikDecisionForbidden{} +} + +/*MakeTraefikDecisionForbidden handles this case with default header values. + +The standard error format +*/ +type MakeTraefikDecisionForbidden struct { + Payload *MakeTraefikDecisionForbiddenBody +} + +func (o *MakeTraefikDecisionForbidden) Error() string { + return fmt.Sprintf("[GET /decisions/traefik][%d] makeTraefikDecisionForbidden %+v", 403, o.Payload) +} + +func (o *MakeTraefikDecisionForbidden) GetPayload() *MakeTraefikDecisionForbiddenBody { + return o.Payload +} + +func (o *MakeTraefikDecisionForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(MakeTraefikDecisionForbiddenBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewMakeTraefikDecisionNotFound creates a MakeTraefikDecisionNotFound with default headers values +func NewMakeTraefikDecisionNotFound() *MakeTraefikDecisionNotFound { + return &MakeTraefikDecisionNotFound{} +} + +/*MakeTraefikDecisionNotFound handles this case with default header values. + +The standard error format +*/ +type MakeTraefikDecisionNotFound struct { + Payload *MakeTraefikDecisionNotFoundBody +} + +func (o *MakeTraefikDecisionNotFound) Error() string { + return fmt.Sprintf("[GET /decisions/traefik][%d] makeTraefikDecisionNotFound %+v", 404, o.Payload) +} + +func (o *MakeTraefikDecisionNotFound) GetPayload() *MakeTraefikDecisionNotFoundBody { + return o.Payload +} + +func (o *MakeTraefikDecisionNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(MakeTraefikDecisionNotFoundBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewMakeTraefikDecisionInternalServerError creates a MakeTraefikDecisionInternalServerError with default headers values +func NewMakeTraefikDecisionInternalServerError() *MakeTraefikDecisionInternalServerError { + return &MakeTraefikDecisionInternalServerError{} +} + +/*MakeTraefikDecisionInternalServerError handles this case with default header values. + +The standard error format +*/ +type MakeTraefikDecisionInternalServerError struct { + Payload *MakeTraefikDecisionInternalServerErrorBody +} + +func (o *MakeTraefikDecisionInternalServerError) Error() string { + return fmt.Sprintf("[GET /decisions/traefik][%d] makeTraefikDecisionInternalServerError %+v", 500, o.Payload) +} + +func (o *MakeTraefikDecisionInternalServerError) GetPayload() *MakeTraefikDecisionInternalServerErrorBody { + return o.Payload +} + +func (o *MakeTraefikDecisionInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(MakeTraefikDecisionInternalServerErrorBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +/*MakeTraefikDecisionForbiddenBody make traefik decision forbidden body +swagger:model MakeTraefikDecisionForbiddenBody +*/ +type MakeTraefikDecisionForbiddenBody struct { + + // code + Code int64 `json:"code,omitempty"` + + // details + Details []interface{} `json:"details"` + + // message + Message string `json:"message,omitempty"` + + // reason + Reason string `json:"reason,omitempty"` + + // request + Request string `json:"request,omitempty"` + + // status + Status string `json:"status,omitempty"` +} + +// Validate validates this make traefik decision forbidden body +func (o *MakeTraefikDecisionForbiddenBody) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *MakeTraefikDecisionForbiddenBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *MakeTraefikDecisionForbiddenBody) UnmarshalBinary(b []byte) error { + var res MakeTraefikDecisionForbiddenBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*MakeTraefikDecisionInternalServerErrorBody make traefik decision internal server error body +swagger:model MakeTraefikDecisionInternalServerErrorBody +*/ +type MakeTraefikDecisionInternalServerErrorBody struct { + + // code + Code int64 `json:"code,omitempty"` + + // details + Details []interface{} `json:"details"` + + // message + Message string `json:"message,omitempty"` + + // reason + Reason string `json:"reason,omitempty"` + + // request + Request string `json:"request,omitempty"` + + // status + Status string `json:"status,omitempty"` +} + +// Validate validates this make traefik decision internal server error body +func (o *MakeTraefikDecisionInternalServerErrorBody) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *MakeTraefikDecisionInternalServerErrorBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *MakeTraefikDecisionInternalServerErrorBody) UnmarshalBinary(b []byte) error { + var res MakeTraefikDecisionInternalServerErrorBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*MakeTraefikDecisionNotFoundBody make traefik decision not found body +swagger:model MakeTraefikDecisionNotFoundBody +*/ +type MakeTraefikDecisionNotFoundBody struct { + + // code + Code int64 `json:"code,omitempty"` + + // details + Details []interface{} `json:"details"` + + // message + Message string `json:"message,omitempty"` + + // reason + Reason string `json:"reason,omitempty"` + + // request + Request string `json:"request,omitempty"` + + // status + Status string `json:"status,omitempty"` +} + +// Validate validates this make traefik decision not found body +func (o *MakeTraefikDecisionNotFoundBody) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *MakeTraefikDecisionNotFoundBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *MakeTraefikDecisionNotFoundBody) UnmarshalBinary(b []byte) error { + var res MakeTraefikDecisionNotFoundBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*MakeTraefikDecisionUnauthorizedBody make traefik decision unauthorized body +swagger:model MakeTraefikDecisionUnauthorizedBody +*/ +type MakeTraefikDecisionUnauthorizedBody struct { + + // code + Code int64 `json:"code,omitempty"` + + // details + Details []interface{} `json:"details"` + + // message + Message string `json:"message,omitempty"` + + // reason + Reason string `json:"reason,omitempty"` + + // request + Request string `json:"request,omitempty"` + + // status + Status string `json:"status,omitempty"` +} + +// Validate validates this make traefik decision unauthorized body +func (o *MakeTraefikDecisionUnauthorizedBody) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *MakeTraefikDecisionUnauthorizedBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *MakeTraefikDecisionUnauthorizedBody) UnmarshalBinary(b []byte) error { + var res MakeTraefikDecisionUnauthorizedBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/test/e2e/okclient/main.go b/test/e2e/okclient/main.go index 744edac566..32a6a9b9d3 100644 --- a/test/e2e/okclient/main.go +++ b/test/e2e/okclient/main.go @@ -88,7 +88,7 @@ func requestWithJWT(token string) (*http.Response, string) { func decisionWithJWT(token string) (*http.Response, string) { pu := urlx.ParseOrPanic(os.Getenv("OATHKEEPER_API")) - req, err := http.NewRequest("GET", urlx.AppendPaths(pu, "decisions", "jwt").String(), nil) + req, err := http.NewRequest("GET", urlx.AppendPaths(pu, "decisions", "generic", "jwt").String(), nil) cmdx.Must(err, "%s", err) req.Header.Set("Authorization", "Bearer "+token) res, err := http.DefaultClient.Do(req)