diff --git a/services/idp/pkg/backends/cs3/identifier/cs3.go b/services/idp/pkg/backends/cs3/identifier/cs3.go index 0ccf74d902..6e5e93125c 100644 --- a/services/idp/pkg/backends/cs3/identifier/cs3.go +++ b/services/idp/pkg/backends/cs3/identifier/cs3.go @@ -95,7 +95,7 @@ func (b *CS3Backend) Logon(ctx context.Context, audience, username, password str return false, nil, nil, nil, fmt.Errorf("cs3 backend basic authenticate failed with code %s: %s", res.GetStatus().GetCode().String(), res.GetStatus().GetMessage()) } - session := createSession(ctx, res.GetUser()) + session := createSession(res.GetUser()) user, err := newCS3User(res.GetUser()) if err != nil { @@ -155,7 +155,7 @@ func (b *CS3Backend) GetUser(ctx context.Context, userEntryID string, sessionRef } // cache session - session = createSession(ctx, res.GetUser()) + session = createSession(res.GetUser()) b.sessions.Set(*sessionRef, session) user, err := newCS3User(res.GetUser()) diff --git a/services/idp/pkg/backends/cs3/identifier/session.go b/services/idp/pkg/backends/cs3/identifier/session.go index 12ec61812e..e1d894afd6 100644 --- a/services/idp/pkg/backends/cs3/identifier/session.go +++ b/services/idp/pkg/backends/cs3/identifier/session.go @@ -1,7 +1,6 @@ package cs3 import ( - "context" "time" cs3user "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1" @@ -9,17 +8,9 @@ import ( // createSession creates a new Session without the server using the provided // data. -func createSession(ctx context.Context, u *cs3user.User) *cs3Session { - - if ctx == nil { - ctx = context.Background() - } - - sessionCtx, cancel := context.WithCancel(ctx) +func createSession(u *cs3user.User) *cs3Session { s := &cs3Session{ - ctx: sessionCtx, - u: u, - ctxCancel: cancel, + u: u, } s.when = time.Now() @@ -28,10 +19,8 @@ func createSession(ctx context.Context, u *cs3user.User) *cs3Session { } type cs3Session struct { - ctx context.Context - ctxCancel context.CancelFunc - u *cs3user.User - when time.Time + u *cs3user.User + when time.Time } // User returns the cs3 user of the session