From 274686d10d3386a41f8fb6bc3363269a734afe0e Mon Sep 17 00:00:00 2001 From: Ophestra Date: Wed, 29 Oct 2025 03:40:09 +0900 Subject: 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 --- internal/app/spaccount.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'internal/app/spaccount.go') 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 -- cgit v1.3.1