Skip to content

Commit

Permalink
ocm: fixed default behavior if shareType is not present in the payload
Browse files Browse the repository at this point in the history
  • Loading branch information
glpatcern committed Sep 9, 2024
1 parent 9e5d0b3 commit a29d8c7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions internal/http/services/opencloudmesh/ocmd/shares.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,15 @@ func getResourceTypeFromOCMRequest(t string) providerpb.ResourceType {
}

func getOCMShareType(t string) ocm.ShareType {
if t == "user" {
switch t {
case "user":
return ocm.ShareType_SHARE_TYPE_USER
case "group":
return ocm.ShareType_SHARE_TYPE_GROUP
default:
// for now assume user share if not provided
return ocm.ShareType_SHARE_TYPE_USER
}
return ocm.ShareType_SHARE_TYPE_GROUP
}

func getAndResolveProtocols(p Protocols, r *http.Request) ([]*ocm.Protocol, error) {
Expand Down

0 comments on commit a29d8c7

Please sign in to comment.