Skip to content

Commit

Permalink
cleanup unused functions (#4101)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgalsaleh authored Oct 22, 2023
1 parent 4b0e75b commit 4e53a6c
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions pkg/session/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import (
"context"
"net/http"

apptypes "github.com/replicatedhq/kots/pkg/app/types"
"github.com/replicatedhq/kots/pkg/session/types"
"github.com/replicatedhq/kotskinds/apis/kots/v1beta1"
)

type sessionKey struct{}
Expand All @@ -20,21 +18,3 @@ func ContextGetSession(r *http.Request) *types.Session {
sess, _ := val.(*types.Session)
return sess
}

func ContextSetLicense(r *http.Request, license *v1beta1.License) *http.Request {
return r.WithContext(context.WithValue(r.Context(), "kotsLicense", license))
}

func ContextGetLicense(r *http.Request) *v1beta1.License {
val := r.Context().Value("kotsLicense")
return val.(*v1beta1.License)
}

func ContextSetApp(r *http.Request, app *apptypes.App) *http.Request {
return r.WithContext(context.WithValue(r.Context(), "kotsApp", app))
}

func ContextGetApp(r *http.Request) *apptypes.App {
val := r.Context().Value("kotsApp")
return val.(*apptypes.App)
}

0 comments on commit 4e53a6c

Please sign in to comment.