aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/app/spaccount.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-10-29 03:40:09 +0900
committerOphestra <cat@gensokyo.uk>2025-10-29 03:40:09 +0900
commit274686d10d3386a41f8fb6bc3363269a734afe0e (patch)
tree59ce81d5617cf5e1f67b819dab49b83b71d8ff93 /internal/app/spaccount.go
parent65342d588ff061d2130e6379d86a26be90c908ae (diff)
internal/validate: relocate from app
These are free of the dispatcher from internal/app. This change relocates them into their own package. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/app/spaccount.go')
-rw-r--r--internal/app/spaccount.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/internal/app/spaccount.go b/internal/app/spaccount.go
index 7da54366..c9f08fe9 100644
--- a/internal/app/spaccount.go
+++ b/internal/app/spaccount.go
@@ -6,6 +6,7 @@ import (
"syscall"
"hakurei.app/container/fhs"
+ "hakurei.app/internal/validate"
)
func init() { gob.Register(spAccountOp{}) }
@@ -21,7 +22,7 @@ func (s spAccountOp) toSystem(state *outcomeStateSys) error {
}
// default is applied in toContainer
- if state.Container.Username != "" && !isValidUsername(state.Container.Username) {
+ if state.Container.Username != "" && !validate.IsValidUsername(state.Container.Username) {
return newWithMessage(fmt.Sprintf("invalid user name %q", state.Container.Username))
}
return nil