Moving operator code to a designated folder so that webhook work can also be included in this repo

This commit is contained in:
jillianwilson
2021-09-28 15:07:19 -03:00
parent d807e92c36
commit f974d3f398
50 changed files with 283 additions and 288 deletions

View File

@@ -0,0 +1,20 @@
package onepassword
// UUIDLength defines the required length of UUIDs
const UUIDLength = 26
// IsValidClientUUID returns true if the given client uuid is valid.
func IsValidClientUUID(uuid string) bool {
if len(uuid) != UUIDLength {
return false
}
for _, c := range uuid {
valid := (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9')
if !valid {
return false
}
}
return true
}