frostfs-node/internal/ape/util.go
Anton Nikiforov 483a67b170 [#937] ape: Validate chain resource name
Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
2024-01-31 11:34:35 +03:00

11 lines
435 B
Go

package ape
import "regexp"
var (
SubjectNameRegexp = regexp.MustCompile(`^[\w+=,.@-]{1,64}$`)
GroupNameRegexp = regexp.MustCompile(`^[\w+=,.@-]{1,128}$`)
// NamespaceNameRegexp similar to https://git.frostfs.info/TrueCloudLab/frostfs-contract/src/commit/f2a82aa635aa57d9b05092d8cf15b170b53cc324/nns/nns_contract.go#L690
NamespaceNameRegexp = regexp.MustCompile(`(^$)|(^[a-z0-9]{1,2}$)|(^[a-z0-9][a-z0-9-]{1,48}[a-z0-9]$)`)
)