Add packages

- Add the packages that help the operator work as expected.
- Update `go.mod` by running `go mod tidy`.
This commit is contained in:
Eddy Filip
2022-09-13 15:40:39 +03:00
parent 96b78795af
commit 622fcd64b8
22 changed files with 2726 additions and 59 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
}