Migrate controllers and helper code from pkg

This commit is contained in:
Marton Soos
2022-04-11 10:06:24 +02:00
parent 21111fec90
commit 1a085562e4
23 changed files with 2982 additions and 25 deletions

20
pkg/onepassword/uuid.go Normal file
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
}