Skip to content

Commit

Permalink
drop uuid regexp for cs3 ids
Browse files Browse the repository at this point in the history
  • Loading branch information
refs committed Aug 2, 2021
1 parent 4f0f0d5 commit d872117
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions pkg/storage/utils/decomposedfs/xattrs/xattrs.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
package xattrs

import (
"fmt"
"regexp"
"strings"

provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
Expand Down Expand Up @@ -83,19 +81,10 @@ const (
GroupAcePrefix string = "g:"
)

// TODO this does not belong here
var uuidRegexp = "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"

// ReferenceFromAttr returns a CS3 reference from xattr of a node.
// Supported formats are: "cs3:storageid/nodeid"
func ReferenceFromAttr(b []byte) (*provider.Reference, error) {
CS3 := regexp.MustCompile(fmt.Sprintf("^%s:%s/%s", "cs3", uuidRegexp, uuidRegexp))

if CS3.Match(b) {
return refFromCS3(b)
}

return nil, fmt.Errorf("invalid reference")
return refFromCS3(b)
}

// refFromCS3 creates a CS3 reference from a set of bytes. This method should remain private
Expand Down

0 comments on commit d872117

Please sign in to comment.