<commit_before>
# Krb5 Client Configure

*   `krb5.kadmin_principal` (string, required)
*   `krb5.kadmin_password` (string, required)
*   `krb5.kadmin_server` (string, required)
*   `krb5.realm` (string, required)
*   `krb5.etc_krb5_conf` (object)
    Object representing the full ini file in "/etc/krb5.conf". It is
    generated by default.
*   `krb5.sshd` (object)
    Properties inserted in the "/etc/ssh/sshd_config" file.

Example:
```json
{
  "krb5": {
    "realm": "ADALTAS.COM",
    "kdc": "krb5.hadoop",
    "kadmin_server": "krb5.hadoop",
    "kadmin_principal": "wdavidw/admin@<EMAIL>.<EMAIL>",
    "kadmin_password": "<PASSWORD>",
    "sshd": {
      "ChallengeResponseAuthentication: "yes",
      "KerberosAuthentication: "yes",
      "KerberosOrLocalPasswd: "<PASSWORD>",
      "KerberosTicketCleanup: "yes",
      "GSSAPIAuthentication: "yes",
      "GSSAPICleanupCredentials: "yes"
    }
  }
}
```

    module.exports = ->
      krb5_ctxs = @contexts 'masson/core/krb5_server'
      options = @config.krb5_client ?= {}
      options.fqdn ?= @config.host
      options.sshd ?= {}
      options.kinit ?= '/usr/bin/kinit'
      options.admin = merge {}, krb5_ctxs[0].config.krb5_server.admin, options.admin
      options.etc_krb5_conf = merge {}, module.exports.etc_krb5_conf, options.etc_krb5_conf
      # Merge global with server-based configuration
      # options.etc_krb5_conf.realms = merge {}, options.etc_krb5_conf.realms, options.etc_krb5_conf.realms
      for krb5_server_ctx in krb5_ctxs
        for realm, config of krb5_server_ctx.config.krb5_server.admin
          options.etc_krb5_conf.realms[realm] ?= {}
          options.etc_krb5_conf.realms[realm].kdc ?= krb5_server_ctx.config.host
          # realms[realm].kdc = [realms[realm].kdc] unless Array.isArray realms[realm].kdc
          options.etc_krb5_conf.realms[realm].admin_server ?= krb5_server_ctx.config.host
          # realms[realm].default_domain ?= realm.toLowerCase()
          options.etc_krb5_conf.libdefaults.default_realm = realm
<commit_msg>core/krb5_client: fix configure when no krb5_server ctx<commit_after>
# Krb5 Client Configure

*   `krb5.kadmin_principal` (string, required)
*   `krb5.kadmin_password` (string, required)
*   `krb5.kadmin_server` (string, required)
*   `krb5.realm` (string, required)
*   `krb5.etc_krb5_conf` (object)
    Object representing the full ini file in "/etc/krb5.conf". It is
    generated by default.
*   `krb5.sshd` (object)
    Properties inserted in the "/etc/ssh/sshd_config" file.

Example:
```json
{
  "krb5": {
    "realm": "ADALTAS.COM",
    "kdc": "krb5.hadoop",
    "kadmin_server": "krb5.hadoop",
    "kadmin_principal": "wdavidw/<EMAIL>",
    "kadmin_password": "<PASSWORD>",
    "sshd": {
      "ChallengeResponseAuthentication: "yes",
      "KerberosAuthentication: "yes",
      "KerberosOrLocalPasswd: "<PASSWORD>",
      "KerberosTicketCleanup: "yes",
      "GSSAPIAuthentication: "yes",
      "GSSAPICleanupCredentials: "yes"
    }
  }
}
```

    module.exports = ->
      krb5_ctxs = @contexts 'masson/core/krb5_server'
      options = @config.krb5_client ?= {}
      options.fqdn ?= @config.host
      options.sshd ?= {}
      options.kinit ?= '/usr/bin/kinit'
      options.admin = merge {}, krb5_ctxs[0].config.krb5_server.admin, options.admin if krb5_ctxs.length > 0
      options.etc_krb5_conf = merge {}, module.exports.etc_krb5_conf, options.etc_krb5_conf
      # Merge global with server-based configuration
      # options.etc_krb5_conf.realms = merge {}, options.etc_krb5_conf.realms, options.etc_krb5_conf.realms
      for krb5_server_ctx in krb5_ctxs
        for realm, config of krb5_server_ctx.config.krb5_server.admin
          options.etc_krb5_conf.realms[realm] ?= {}
          options.etc_krb5_conf.realms[realm].kdc ?= krb5_server_ctx.config.host
          # realms[realm].kdc = [realms[realm].kdc] unless Array.isArray realms[realm].kdc
          options.etc_krb5_conf.realms[realm].admin_server ?= krb5_server_ctx.config.host
          # realms[realm].default_domain ?= realm.toLowerCase()
          options.etc_krb5_conf.libdefaults.default_realm = realm

{'fraction_non_alphanumeric': 0.13365617433414043, 'fraction_numerical': 0.017433414043583534, 'mean_word_length': 3.470779220779221, 'pattern_counts': {'":': 14, '<': 10, '<?xml version=': 0, '>': 13, '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': '1670489', 'n_tokens_mistral': 1568, 'n_tokens_neox': 1554, 'n_words': 241}