update invocations of MintToken and DismantleToken
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user