Merge branch 'master' into no-additional-init
This commit is contained in:
@@ -46,7 +46,9 @@ func Server(opts ...Option) (http.Service, error) {
|
||||
handle = svc.NewTracing(handle)
|
||||
}
|
||||
|
||||
micro.RegisterHandler(service.Server(), handle)
|
||||
if err := micro.RegisterHandler(service.Server(), handle); err != nil {
|
||||
return http.Service{}, err
|
||||
}
|
||||
|
||||
return service, nil
|
||||
}
|
||||
|
||||
@@ -11,13 +11,13 @@ import (
|
||||
"net/http/httptest"
|
||||
"net/url"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"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"
|
||||
@@ -35,9 +35,8 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
ocsV1 string = "v1.php"
|
||||
ocsV2 string = "v2.php"
|
||||
adminBasicAuth string = "admin:admin"
|
||||
ocsV1 string = "v1.php"
|
||||
ocsV2 string = "v2.php"
|
||||
)
|
||||
|
||||
const unsuccessfulResponseText string = "The response was expected to be successful but was not"
|
||||
@@ -604,7 +603,9 @@ func cleanUp(t *testing.T) {
|
||||
}
|
||||
|
||||
if !found {
|
||||
deleteAccount(t, f.Name())
|
||||
if _, err := deleteAccount(t, f.Name()); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -625,7 +626,9 @@ func cleanUp(t *testing.T) {
|
||||
}
|
||||
|
||||
if !found {
|
||||
deleteGroup(t, f.Name())
|
||||
if _, err := deleteGroup(t, f.Name()); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -639,25 +642,20 @@ func mintToken(ctx context.Context, su *User, roleIds []string) (token string, e
|
||||
Id: &user.UserId{
|
||||
OpaqueId: su.ID,
|
||||
},
|
||||
Groups: []string{},
|
||||
Opaque: &types.Opaque{
|
||||
Map: map[string]*types.OpaqueEntry{
|
||||
"uid": {
|
||||
Decoder: "plain",
|
||||
Value: []byte(strconv.Itoa(su.UIDNumber)),
|
||||
},
|
||||
"gid": {
|
||||
Decoder: "plain",
|
||||
Value: []byte(strconv.Itoa(su.GIDNumber)),
|
||||
},
|
||||
"roles": {
|
||||
Decoder: "json",
|
||||
Value: roleIDsJSON,
|
||||
},
|
||||
},
|
||||
},
|
||||
Groups: []string{},
|
||||
UidNumber: int64(su.UIDNumber),
|
||||
GidNumber: int64(su.GIDNumber),
|
||||
}
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user