Skip to content

Commit

Permalink
Rename 'transfer' to 'datatx' (#3859)
Browse files Browse the repository at this point in the history
* Rename 'transfer' to 'datatx'

* Add #PR

* Add PR

* Corrected

---------

Co-authored-by: Antoon P <antoon@redblom.com>
  • Loading branch information
redblom and antoonp authored May 8, 2023
1 parent 73ae358 commit 507e96e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions changelog/unreleased/rename-transfer-to-datatx.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Bugfix: Fix inconsistency between data transfer protocol naming

https://github.com/cs3org/reva/pull/3859
https://github.com/cs3org/reva/issues/3858
12 changes: 6 additions & 6 deletions cmd/reva/ocm-share-create.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ func ocmShareCreateCommand() *command {

webdav := cmd.Bool("webdav", false, "create a share with webdav access")
webapp := cmd.Bool("webapp", false, "create a share for app access")
transfer := cmd.Bool("transfer", false, "create a share for a data transfer")
datatx := cmd.Bool("datatx", false, "create a share for a data transfer")

rol := cmd.String("rol", "viewer", "the permission for the share (viewer or editor) / applies to webdav and webapp")

cmd.ResetFlags = func() {
*grantType, *grantee, *idp, *rol, *userType, *webdav, *webapp, *transfer = "user", "", "", "viewer", "primary", false, false, false
*grantType, *grantee, *idp, *rol, *userType, *webdav, *webapp, *datatx = "user", "", "", "viewer", "primary", false, false, false
}

cmd.Action = func(w ...io.Writer) error {
Expand All @@ -70,7 +70,7 @@ func ocmShareCreateCommand() *command {
return errors.New("IdP cannot be empty: use -idp flag\n" + cmd.Usage())
}

if !*webdav && !*webapp && !*transfer {
if !*webdav && !*webapp && !*datatx {
*webdav = true
}

Expand Down Expand Up @@ -111,7 +111,7 @@ func ocmShareCreateCommand() *command {
}

gt := getGrantType(*grantType)
am, err := getAccessMethods(*webdav, *webapp, *transfer, *rol)
am, err := getAccessMethods(*webdav, *webapp, *datatx, *rol)
if err != nil {
return err
}
Expand Down Expand Up @@ -155,7 +155,7 @@ func ocmShareCreateCommand() *command {
return cmd
}

func getAccessMethods(webdav, webapp, transfer bool, rol string) ([]*ocm.AccessMethod, error) {
func getAccessMethods(webdav, webapp, datatx bool, rol string) ([]*ocm.AccessMethod, error) {
var m []*ocm.AccessMethod
if webdav {
perm, err := getOCMSharePerm(rol)
Expand All @@ -171,7 +171,7 @@ func getAccessMethods(webdav, webapp, transfer bool, rol string) ([]*ocm.AccessM
}
m = append(m, ocmshare.NewWebappAccessMethod(v))
}
if transfer {
if datatx {
m = append(m, ocmshare.NewTransferAccessMethod())
}
return m, nil
Expand Down

0 comments on commit 507e96e

Please sign in to comment.