private Optional<ValidationEvent> validateTrailingPeriod(OperationShape operation, EndpointTrait trait) {
        SmithyPattern hostPrefix = trait.getHostPrefix();
        if (!hostPrefix.toString().endsWith(".") && !hostPrefix.getLabels().isEmpty()) {
            String message = "`endpoint` trait hostPrefix contains host labels and does not end in a period (`.`). "
                    + "This can result in clients inadvertently sending data to domains you do not control.";
            return Optional.of(danger(operation, trait, message));
        }
        return Optional.empty();
    }
Match the expanded template to be a valid RFC 3896 host.
smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/HostLabelTraitValidator.java