Skip to content

Commit

Permalink
reestructured code to work as library
Browse files Browse the repository at this point in the history
  • Loading branch information
sredxny committed Dec 26, 2019
1 parent 1a1a808 commit e772436
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions http_handlers.go
Expand Up @@ -62,7 +62,7 @@ func HandleAuth(w http.ResponseWriter, r *http.Request) {
return
}

thisIdentityProvider, err := providers.GetTapProfile(w, r, AuthConfigStore, IdentityKeyStore, thisId, TykAPIHandler)
thisIdentityProvider, err := providers.GetTapProfile( AuthConfigStore, IdentityKeyStore, thisId, TykAPIHandler)
if err != nil {
return
}
Expand All @@ -80,7 +80,7 @@ func HandleAuthCallback(w http.ResponseWriter, r *http.Request) {
return
}

thisIdentityProvider, err := providers.GetTapProfile(w, r, AuthConfigStore, IdentityKeyStore, thisId, TykAPIHandler)
thisIdentityProvider, err := providers.GetTapProfile( AuthConfigStore, IdentityKeyStore, thisId, TykAPIHandler)
if err != nil {
HandleError(constants.HandlerLogTag, err.Message, err.Error, err.Code, w, r)
return
Expand Down
3 changes: 1 addition & 2 deletions providers/tapProvider.go
Expand Up @@ -8,7 +8,6 @@ import (
"github.com/TykTechnologies/tyk-identity-broker/tap"
identityHandlers "github.com/TykTechnologies/tyk-identity-broker/tap/identity-handlers"
"github.com/TykTechnologies/tyk-identity-broker/tyk-api"
"net/http"
)

// return a provider based on the name of the provider type, add new providers here
Expand Down Expand Up @@ -48,7 +47,7 @@ func getIdentityHandler(name tap.Action,handler tyk.TykAPI, identityKeyStore tap
return thisIdentityHandler
}

func GetTapProfile(w http.ResponseWriter, r *http.Request, AuthConfigStore, identityKeyStore tap.AuthRegisterBackend, id string,tykHandler tyk.TykAPI) (tap.TAProvider, *tap.HttpError) {
func GetTapProfile(AuthConfigStore, identityKeyStore tap.AuthRegisterBackend, id string,tykHandler tyk.TykAPI) (tap.TAProvider, *tap.HttpError) {

thisProfile := tap.Profile{}
log.WithField("prefix", constants.HandlerLogTag).Debug("--> Looking up profile ID: ", id)
Expand Down

0 comments on commit e772436

Please sign in to comment.