Brijesh's Git Server — argus-core @ 501bb0a8ed0ed7d9ff9adc1ba1930ba3001a5433

Logging service

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
}