update invocations of MintToken and DismantleToken

This commit is contained in:
David Christofas
2021-05-11 14:18:43 +02:00
parent 8b195e95b6
commit f6ac50244b
6 changed files with 31 additions and 6 deletions
+3 -1
View File
@@ -18,6 +18,7 @@ import (
"github.com/asim/go-micro/v3/client"
user "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1"
types "github.com/cs3org/go-cs3apis/cs3/types/v1beta1"
"github.com/cs3org/reva/pkg/auth/scope"
"github.com/cs3org/reva/pkg/token"
"github.com/cs3org/reva/pkg/token/manager/jwt"
"github.com/golang/protobuf/ptypes/empty"
@@ -660,7 +661,8 @@ func mintToken(ctx context.Context, su *User, roleIds []string) (token string, e
},
},
}
return tokenManager.MintToken(ctx, u)
s, _ := scope.GetOwnerScope()
return tokenManager.MintToken(ctx, u, s)
}
func sendRequest(method, endpoint, body string, u *User, roleIds []string) (*httptest.ResponseRecorder, error) {
+6 -1
View File
@@ -5,6 +5,7 @@ import (
"crypto/rand"
"encoding/hex"
"fmt"
"github.com/cs3org/reva/pkg/auth/scope"
"net/http"
"strconv"
"strings"
@@ -507,7 +508,11 @@ func (o Ocs) mintTokenForUser(ctx context.Context, account *accounts.Account) (s
},
},
}
return tm.MintToken(ctx, u)
s, err := scope.GetOwnerScope()
if err != nil {
return "", err
}
return tm.MintToken(ctx, u, s)
}
// EnableUser enables a user