<commit_before>(ns puppetlabs.master.certificate-authority
  (:require [me.raynes.fs :as fs]
            [schema.core :as schema]
            [clojure.string :as str]
            [clojure.java.io :as io]
            [clojure.java.shell :as shell]
            [clojure.tools.logging :as log]
            [clj-time.core :as time]
            [puppetlabs.kitchensink.core :as ks]
            [puppetlabs.certificate-authority.core :as utils]))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Schemas

(def MasterSettings
  "Paths to the various directories and files within the SSL directory,
  excluding the CA directory and its contents. These are only used during
  initialization of the master. All of these are Puppet configuration settings."
  {:requestdir       String
   :certdir          String
   :hostcert         String
   :localcacert      String
   :hostprivkey      String
   :hostpubkey       String
   (schema/optional-key :dns-alt-names)
                     (schema/maybe String)})

(def CaSettings
  "Settings from Puppet that are necessary for CA initialization and request
  handling during normal Puppet operation.
  Most of these are Puppet configuration settings."
  {:autosign  (schema/either String Boolean)
   :cacert    String<commit_msg>(PE-4372) :dns-alt-names should be a required key in master settings<commit_after>(ns puppetlabs.master.certificate-authority
  (:require [me.raynes.fs :as fs]
            [schema.core :as schema]
            [clojure.string :as str]
            [clojure.java.io :as io]
            [clojure.java.shell :as shell]
            [clojure.tools.logging :as log]
            [clj-time.core :as time]
            [puppetlabs.kitchensink.core :as ks]
            [puppetlabs.certificate-authority.core :as utils]))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Schemas

(def MasterSettings
  "Paths to the various directories and files within the SSL directory,
  excluding the CA directory and its contents. These are only used during
  initialization of the master. All of these are Puppet configuration settings."
  {:requestdir       String
   :certdir          String
   :hostcert         String
   :localcacert      String
   :hostprivkey      String
   :hostpubkey       String
   :dns-alt-names    (schema/maybe String)})

(def CaSettings
  "Settings from Puppet that are necessary for CA initialization and request
  handling during normal Puppet operation.
  Most of these are Puppet configuration settings."
  {:autosign  (schema/either String Boolean)
   :cacert    String
{'fraction_non_alphanumeric': 0.1344024436807942, 'fraction_numerical': 0.0015273004963726614, 'mean_word_length': 2.808139534883721, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7315327', 'n_tokens_mistral': 807, 'n_tokens_neox': 759, 'n_words': 235}