Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename 'transfer' to 'datatx' #3859

Merged
merged 4 commits into from
May 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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