Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mux #13

Merged
merged 7 commits into from
Feb 7, 2019
Merged

Mux #13

merged 7 commits into from
Feb 7, 2019

Conversation

foxcool
Copy link
Contributor

@foxcool foxcool commented Jan 29, 2019

No description provided.

@foxcool
Copy link
Contributor Author

foxcool commented Jan 29, 2019


// NewHandlerFactory returns a HandlerFactory
func NewHandlerFactory(logger logging.Logger, rejecter jose.Rejecter) mux.HandlerFactory {
	handlerFactory := mux.CustomEndpointHandler(mux.NewRequestBuilder(httptreemux.ParamsExtractor))
	handlerFactory = muxjose.HandlerFactory(handlerFactory, httptreemux.ParamsExtractor, logger, rejecter)

	return handlerFactory
}

works fine on KrakenD with httptreemux router

@kpacha
Copy link
Member

kpacha commented Feb 5, 2019

please, @foxcool, check the merging conflicts.

thxs!

@foxcool
Copy link
Contributor Author

foxcool commented Feb 5, 2019

done!

@taik0
Copy link
Member

taik0 commented Feb 5, 2019

Hi @foxcool
You need to update the Gopkg using dep 0.5 (you are using an older version).

@foxcool
Copy link
Contributor Author

foxcool commented Feb 5, 2019

Can't ensure here and on master branch

dep ensure -v
Root project is "github.com/devopsfaith/krakend-jose"
 3 transitively valid internal packages
 9 external packages imported from 4 projects
(0)   ✓ select (root)
(1)     ? attempt github.com/auth0-community/go-auth0 with 1 pkgs; 4 versions to try
(1)         try github.com/auth0-community/go-auth0@v1.0.0
(1)     ✓ select github.com/auth0-community/go-auth0@v1.0.0 w/1 pkgs
(2)     ? attempt github.com/devopsfaith/krakend with 5 pkgs; 13 versions to try
(2)         try github.com/devopsfaith/krakend@0.7.0
(2)     ✓ select github.com/devopsfaith/krakend@0.7.0 w/13 pkgs
(3)     ? attempt github.com/gin-gonic/gin with 1 pkgs; 21 versions to try
(3)         try github.com/gin-gonic/gin@v1.3.0
(3)     ✓ select github.com/gin-gonic/gin@v1.3.0 w/4 pkgs
(4)     ? attempt github.com/gin-contrib/sse with 1 pkgs; 1 versions to try
(4)         try github.com/gin-contrib/sse@master
(4)     ✓ select github.com/gin-contrib/sse@master w/1 pkgs
(5)     ? attempt github.com/ugorji/go with 1 pkgs; 5 versions to try
(5)         try github.com/ugorji/go@v1.1.2
(5)     ✓ select github.com/ugorji/go@v1.1.2 w/1 pkgs
(6)     ? attempt github.com/golang/protobuf with 1 pkgs; 7 versions to try
(6)         try github.com/golang/protobuf@v1.2.0
(6)     ✓ select github.com/golang/protobuf@v1.2.0 w/1 pkgs
(7)     ? attempt github.com/mattn/go-isatty with 1 pkgs; 6 versions to try
(7)         try github.com/mattn/go-isatty@v0.0.4
(7)     ✓ select github.com/mattn/go-isatty@v0.0.4 w/1 pkgs
(8)       ← no more versions of golang.org/x/sys to try; begin backtrack
(7)     ← backtrack: no more versions of github.com/mattn/go-isatty to try
(6)     ← backtrack: no more versions of github.com/golang/protobuf to try
(5)     ← backtrack: no more versions of github.com/ugorji/go to try
(4)     ← backtrack: no more versions of github.com/gin-contrib/sse to try
(3)     ← backtrack: no more versions of github.com/gin-gonic/gin to try
(2)     ← backtrack: no more versions of github.com/devopsfaith/krakend to try
(1)     ← backtrack: no more versions of github.com/auth0-community/go-auth0 to try
  ✗ solving failed



@kpacha
Copy link
Member

kpacha commented Feb 5, 2019

It's weird because it worked on travis just a week ago: https://travis-ci.org/devopsfaith/krakend-jose/builds/485104773

I've created a build locally with just the change at the Gopkg.toml and it worked:

$ make deps test
dep ensure -v
# Gopkg.lock is out of sync with Gopkg.toml and project imports:
github.com/devopsfaith/krakend@0.6.0: not allowed by constraint ^0.7.0

Root project is "github.com/devopsfaith/krakend-jose"
 1 transitively valid internal packages
 8 external packages imported from 4 projects
(0)   ✓ select (root)
(1)	? attempt github.com/auth0-community/go-auth0 with 1 pkgs; at least 1 versions to try
(1)	    try github.com/auth0-community/go-auth0@v1.0.0
(1)	✓ select github.com/auth0-community/go-auth0@v1.0.0 w/1 pkgs
(2)	? attempt github.com/devopsfaith/krakend with 4 pkgs; at least 1 versions to try
(2)	    try github.com/devopsfaith/krakend@0.6.0
(3)	✗   github.com/devopsfaith/krakend@0.6.0 not allowed by constraint ^0.7.0:
(3)	    ^0.7.0 from (root)
(2)	    try github.com/devopsfaith/krakend@0.7.0
(2)	✓ select github.com/devopsfaith/krakend@0.7.0 w/12 pkgs
(3)	? attempt github.com/gin-gonic/gin with 1 pkgs; at least 1 versions to try
(3)	    try github.com/gin-gonic/gin@v1.2
(3)	✓ select github.com/gin-gonic/gin@v1.2 w/3 pkgs
(4)	? attempt github.com/gin-contrib/sse with 1 pkgs; at least 1 versions to try
(4)	    try github.com/gin-contrib/sse@master
(4)	✓ select github.com/gin-contrib/sse@master w/1 pkgs
(5)	? attempt github.com/ugorji/go with 1 pkgs; at least 1 versions to try
(5)	    try github.com/ugorji/go@c88ee250d0221a57af388746f5cf03768c21d6e2
(5)	✓ select github.com/ugorji/go@c88ee250d0221a57af388746f5cf03768c21d6e2 w/1 pkgs
(6)	? attempt github.com/golang/protobuf with 1 pkgs; at least 1 versions to try
(6)	    try github.com/golang/protobuf@5a0f697c9ed9d68fef0116532c6e05cfeae00e55
(6)	✓ select github.com/golang/protobuf@5a0f697c9ed9d68fef0116532c6e05cfeae00e55 w/1 pkgs
(7)	? attempt gopkg.in/yaml.v2 with 1 pkgs; at least 1 versions to try
(7)	    try gopkg.in/yaml.v2@a5b47d31c556af34a302ce5d659e6fea44d90de0
(7)	✓ select gopkg.in/yaml.v2@a5b47d31c556af34a302ce5d659e6fea44d90de0 w/1 pkgs
(8)	? attempt gopkg.in/square/go-jose.v2 with 2 pkgs; at least 1 versions to try
(8)	    try gopkg.in/square/go-jose.v2@v2.1.7
(8)	✓ select gopkg.in/square/go-jose.v2@v2.1.7 w/4 pkgs
(9)	? attempt golang.org/x/crypto with 1 pkgs; at least 1 versions to try
(9)	    try golang.org/x/crypto@master
(9)	✓ select golang.org/x/crypto@master w/2 pkgs
(10)  ? attempt github.com/mattn/go-isatty with 1 pkgs; at least 1 versions to try
(10)      try github.com/mattn/go-isatty@57fdcb988a5c543893cc61bce354a6e24ab70022
(10)  ✓ select github.com/mattn/go-isatty@57fdcb988a5c543893cc61bce354a6e24ab70022 w/1 pkgs
(11)  ? attempt golang.org/x/sys with 1 pkgs; at least 1 versions to try
(11)      try golang.org/x/sys@master
(11)  ✓ select golang.org/x/sys@master w/1 pkgs
(12)  ? attempt gopkg.in/go-playground/validator.v8 with 1 pkgs; at least 1 versions to try
(12)      try gopkg.in/go-playground/validator.v8@v8.18.1
(12)  ✓ select gopkg.in/go-playground/validator.v8@v8.18.1 w/1 pkgs
  ✓ found solution with 29 packages from 12 projects

Solver wall times by segment:
              b-gmal: 4.248914517s
         b-list-pkgs: 2.174786133s
     b-list-versions: 641.316877ms
     b-source-exists:  85.883947ms
             satisfy:   2.795202ms
         select-atom:    2.59964ms
            new-atom:    531.849µs
         select-root:    139.334µs
  b-deduce-proj-root:    105.415µs
               other:    105.264µs

  TOTAL: 7.157178178s

(1/12) Wrote gopkg.in/go-playground/validator.v8@v8.18.1
(2/12) Wrote gopkg.in/yaml.v2@a5b47d31c556af34a302ce5d659e6fea44d90de0
(3/12) Wrote github.com/ugorji/go@c88ee250d0221a57af388746f5cf03768c21d6e2
(4/12) Wrote github.com/gin-contrib/sse@master
(5/12) Wrote github.com/mattn/go-isatty@57fdcb988a5c543893cc61bce354a6e24ab70022
(6/12) Wrote github.com/auth0-community/go-auth0@v1.0.0
(7/12) Wrote github.com/gin-gonic/gin@v1.2
(8/12) Wrote gopkg.in/square/go-jose.v2@v2.1.7
(9/12) Wrote github.com/golang/protobuf@5a0f697c9ed9d68fef0116532c6e05cfeae00e55
(10/12) Wrote github.com/devopsfaith/krakend@0.7.0
(11/12) Wrote golang.org/x/sys@master
(12/12) Wrote golang.org/x/crypto@master
dep status
PROJECT                              CONSTRAINT     VERSION        REVISION  LATEST   PKGS USED
github.com/auth0-community/go-auth0  ^1.0.0         v1.0.0         ddfdc88   v1.0.0   1
github.com/devopsfaith/krakend       ^0.7.0         0.7.0          f82f671   0.7.0    12
github.com/gin-contrib/sse           branch master  branch master  22d885f   a765881  1
github.com/gin-gonic/gin             ^1.2.0         v1.2           d459835   v1.3.0   3
github.com/golang/protobuf           *                             5a0f697            1
github.com/mattn/go-isatty           *                             57fdcb9            1
github.com/ugorji/go                 *                             c88ee25            1
golang.org/x/crypto                  branch master  branch master  56440b8   b8fe169  2
golang.org/x/sys                     branch master  branch master  34b17bd   41f3e65  1
gopkg.in/go-playground/validator.v8  v8.18.1        v8.18.1        5f57d22   v8.18.1  1
gopkg.in/square/go-jose.v2           ^2.1.6         v2.1.7         349dc03   v2.2.2   4
gopkg.in/yaml.v2                     *                             a5b47d3            1
go test -cover ./...
ok  	github.com/devopsfaith/krakend-jose	0.051s	coverage: 76.4% of statements

@foxcool
Copy link
Contributor Author

foxcool commented Feb 6, 2019

After drop dep cache it works. Good?

@kpacha
Copy link
Member

kpacha commented Feb 6, 2019

@foxcool I don't think exporting everything at the base package and having duplicated code between the gin and mux packages (like canAccess and newValidator) is the best option here...

@kpacha
Copy link
Member

kpacha commented Feb 6, 2019

please, check my suggestions at foxcool#1

common code moved to the root package
@foxcool
Copy link
Contributor Author

foxcool commented Feb 7, 2019

hi, tests passed. Merged

@kpacha kpacha merged commit 09f07ba into krakend:master Feb 7, 2019
@kpacha
Copy link
Member

kpacha commented Feb 7, 2019

thxs for the contribution!

@github-actions
Copy link

github-actions bot commented Apr 7, 2022

This pull request was marked as resolved a long time ago and now has been automatically locked as there has not been any recent activity after it. You can still open a new issue and reference this link.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants