<commit_before>require 'cheffish'
require 'cheffish/base_resource'

class Chef
  class Resource
    class ChefUser < Cheffish::BaseResource
      resource_name :chef_user

      # Grab environment from with_environment
      def initialize(*args)
        super
        chef_server run_context.cheffish.current_chef_server
      end

      # Client attributes
      property :name, :kind_of => String, :regex => Cheffish::NAME_REGEX, :name_attribute => true
      property :display_name, :kind_of => String
      property :admin, :kind_of => [TrueClass, FalseClass]
      property :email, :kind_of => String
      property :external_authentication_uid
      property :recovery_authentication_enabled, :kind_of => [TrueClass, FalseClass]
      property :password, :kind_of => String # Hmm.  There is no way to idempotentize this.
      #property :salt  # TODO server doesn't support sending or receiving these, but it's the only way to backup / restore a user
      #property :hashed_password<commit_msg>Make chef_user descend from ChefActorBase<commit_after>require 'cheffish'
require 'cheffish/chef_actor_base'

class Chef
  class Resource
    class ChefUser < Cheffish::ChefActorBase
      resource_name :chef_user

      # Grab environment from with_environment
      def initialize(*args)
        super
        chef_server run_context.cheffish.current_chef_server
      end

      # Client attributes
      property :name, :kind_of => String, :regex => Cheffish::NAME_REGEX, :name_attribute => true
      property :display_name, :kind_of => String
      property :admin, :kind_of => [TrueClass, FalseClass]
      property :email, :kind_of => String
      property :external_authentication_uid
      property :recovery_authentication_enabled, :kind_of => [TrueClass, FalseClass]
      property :password, :kind_of => String # Hmm.  There is no way to idempotentize this.
      #property :salt  # TODO server doesn't support sending or receiving these, but it's the only way to backup / restore a user
      #property :hashed_password
{'fraction_non_alphanumeric': 0.07665847665847667, 'fraction_numerical': 0.0, 'mean_word_length': 3.6378132118451023, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, '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': '2621600', 'n_tokens_mistral': 585, 'n_tokens_neox': 567, 'n_words': 177}