Skip to content

Commit

Permalink
godocs
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffy-mathew committed Oct 25, 2024
1 parent 37b8971 commit 6d106df
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions ee/middleware/upstreambasicauth/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ func (m *Middleware) Init() {
m.Logger().Debug("Initializing Upstream basic auth Middleware")
}

// ProcessRequest will handle the streaming functionality.
func (m *Middleware) ProcessRequest(w http.ResponseWriter, r *http.Request, _ interface{}) (error, int) {
// ProcessRequest will handle upstream basic auth.
func (m *Middleware) ProcessRequest(_ http.ResponseWriter, r *http.Request, _ interface{}) (error, int) {
basicAuthConfig := m.Spec.UpstreamAuth.BasicAuth

upstreamBasicAuthProvider := Provider{
Expand Down
5 changes: 4 additions & 1 deletion gateway/mw_upstream_basic_auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ type noopUpstreamBasicAuth struct {
*BaseMiddleware
}

func (d *noopUpstreamBasicAuth) ProcessRequest(w http.ResponseWriter, r *http.Request, _ interface{}) (error, int) {
// ProcessRequest is noop implementation for upstream basic auth mw.
func (d *noopUpstreamBasicAuth) ProcessRequest(_ http.ResponseWriter, r *http.Request, _ interface{}) (error, int) {
return nil, http.StatusOK
}

// EnabledForSpec will always return false for noopUpstreamBasicAuth.
func (d *noopUpstreamBasicAuth) EnabledForSpec() bool {
if d.Spec.UpstreamAuth.BasicAuth.Enabled {
d.Logger().Error("Upstream basic auth is supported only in Tyk Enterprise Edition")
Expand All @@ -26,6 +28,7 @@ func (d *noopUpstreamBasicAuth) EnabledForSpec() bool {
return false
}

// Name returns the name of the mw.
func (d *noopUpstreamBasicAuth) Name() string {
return "NooPUpstreamBasicAuth"
}

0 comments on commit 6d106df

Please sign in to comment.