internal/apikeys/validation.go (view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
package apikeys import ( pb "argus-core/rpc/apikeys" "fmt" ) func validateCreateAPIKeyRequest(req *pb.CreateAPIKeyRequest) error { if req.Name == "" { return fmt.Errorf("name is required") } if len(req.Name) > 255 { return fmt.Errorf("name must be less than 256 characters") } return nil } |