Skip to content

Commit

Permalink
ResourceInfo.Ref -> ResourceInfo.Path
Browse files Browse the repository at this point in the history
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
  • Loading branch information
butonic committed May 26, 2021
1 parent 6805f8f commit f756df0
Show file tree
Hide file tree
Showing 32 changed files with 101 additions and 101 deletions.
2 changes: 1 addition & 1 deletion cmd/reva/arguments.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func (c *Completer) lsArgumentCompleter(onlyDirs bool) []prompt.Suggest {
suggests = append(suggests, prompt.Suggest{Text: "/home"})
for _, r := range info {
if !onlyDirs || r.Type == provider.ResourceType_RESOURCE_TYPE_CONTAINER {
suggests = append(suggests, prompt.Suggest{Text: r.Ref.Path})
suggests = append(suggests, prompt.Suggest{Text: r.Path.Path})
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/reva/ls.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func lsCommand() *command {

infos := res.Infos
for _, info := range infos {
p := info.Ref.Path
p := info.Path.Path
if !*fullFlag {
p = path.Base(p)
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/reva/ocm-share-create.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,14 @@ func ocmShareCreateCommand() *command {
},
"name": &types.OpaqueEntry{
Decoder: "plain",
Value: []byte(res.Info.Ref.Path), // TODO what reference should be used here?
Value: []byte(res.Info.Path.Path), // TODO what reference should be used here?
},
},
}

shareRequest := &ocm.CreateOCMShareRequest{
Opaque: opaqueObj,
Ref: res.Info.Ref,
Ref: res.Info.Path,
Grant: grant,
RecipientMeshProvider: providerInfo.ProviderInfo,
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/reva/transfer-create.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func transferCreateCommand() *command {
},
"name": &types.OpaqueEntry{
Decoder: "plain",
Value: []byte(statRes.Info.Ref.Path),
Value: []byte(statRes.Info.Path.Path),
},
"protocol": &types.OpaqueEntry{
Decoder: "plain",
Expand Down
2 changes: 1 addition & 1 deletion cmd/reva/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ func uploadCommand() *command {

info := res2.Info

fmt.Printf("File uploaded: %s:%s %d %s\n", info.Id.StorageId, info.Id.NodeId, info.Size, info.Ref.Path)
fmt.Printf("File uploaded: %s:%s %d %s\n", info.Id.StorageId, info.Id.NodeId, info.Size, info.Path.Path)

return nil
}
Expand Down
8 changes: 4 additions & 4 deletions examples/sdk/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func runActions(session *sdk.Session) {
act := action.MustNewUploadAction(session)
act.EnableTUS = true
if info, err := act.UploadBytes([]byte("HELLO WORLD!\n"), "/home/subdir/tests.txt"); err == nil {
log.Printf("Uploaded file: %s [%db] -- %s", info.Ref.Path, info.Size, info.Type)
log.Printf("Uploaded file: %s [%db] -- %s", info.Path.Path, info.Size, info.Type)
} else {
log.Printf("Can't upload file: %v", err)
}
Expand All @@ -77,14 +77,14 @@ func runActions(session *sdk.Session) {
act := action.MustNewEnumFilesAction(session)
if files, err := act.ListFiles("/home", true); err == nil {
for _, info := range files {
log.Printf("%s [%db] -- %s", info.Ref.Path, info.Size, info.Type)
log.Printf("%s [%db] -- %s", info.Path.Path, info.Size, info.Type)

// Download the file
actDl := action.MustNewDownloadAction(session)
if data, err := actDl.Download(info); err == nil {
log.Printf("Downloaded %d bytes for '%v'", len(data), info.Ref.Path)
log.Printf("Downloaded %d bytes for '%v'", len(data), info.Path.Path)
} else {
log.Printf("Unable to download data for '%v': %v", info.Ref.Path, err)
log.Printf("Unable to download data for '%v': %v", info.Path.Path, err)
}

log.Println("---")
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1036,8 +1036,8 @@ github.com/prometheus/statsd_exporter v0.20.0 h1:M0hQphnq2WyWKS5CefQL8PqWwBOBPhi
github.com/prometheus/statsd_exporter v0.20.0/go.mod h1:YL3FWCG8JBBtaUSxAg4Gz2ZYu22bS84XM89ZQXXTWmQ=
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/refs/go-cs3apis v0.0.0-20210520134557-97cdc479815b h1:EQM9QE2M63TQNy4p/iqQqZAsFjTO8SDBy9ZHWpqqu4w=
github.com/refs/go-cs3apis v0.0.0-20210520134557-97cdc479815b/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY=
github.com/refs/go-cs3apis v0.0.0-20210526140949-6696966c6248 h1:3mTgRQy5TjZ0tEV0n2ESGaSQIgrfbrHO/Ikg9iM7Ol8=
github.com/refs/go-cs3apis v0.0.0-20210526140949-6696966c6248/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY=
github.com/remyoudompheng/bigfft v0.0.0-20190728182440-6a916e37a237/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
github.com/rhnvrm/simples3 v0.5.0/go.mod h1:Y+3vYm2V7Y4VijFoJHHTrja6OgPrJ2cBti8dPGkC3sA=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
Expand Down
6 changes: 3 additions & 3 deletions internal/grpc/interceptors/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,9 @@ func dismantleToken(ctx context.Context, tkn string, req interface{}, mgr token.
return nil, err
}

if ref.StorageId == statResponse.Info.Ref.StorageId &&
ref.NodeId == statResponse.Info.Ref.NodeId &&
strings.HasPrefix(ref.GetPath(), statResponse.Info.Ref.Path) {
if ref.StorageId == statResponse.Info.Path.StorageId &&
ref.NodeId == statResponse.Info.Path.NodeId &&
strings.HasPrefix(ref.GetPath(), statResponse.Info.Path.Path) {
// The path corresponds to the resource to which the token has access.
// We allow access to it.
return u, nil
Expand Down
Loading

0 comments on commit f756df0

Please sign in to comment.