<commit_before>control 'postgresl-local-access' do
  impact 1.0
  desc 'This test ensures postgres has localhost access to the database'

  describe postgres_hba_conf.where { type == 'host' && user == 'postgres' } do
    its('database') { should cmp 'all' }
    its('user') { should cmp 'postgres' }
    its('auth_method') { should cmp 'md5' }
    its('address') { should cmp '127.0.0.1/32' }
  end

  postgres_access = postgres_session('postgres', '12345', '127.0.0.1')

  describe postgres_access.query('SELECT 1;') do
    its('output') { should eq '1' }
  end
end

control 'postgresl-sous-chef-access' do
  impact 1.0
  desc 'This test ensures sous_chefs have local trust access to the database'

  describe postgres_hba_conf.where { user == 'sous_chef' } do
    its('database') { should cmp 'all' }
    its('type') { should cmp 'host' }
    its('auth_method') { should cmp 'md5' }
    its('address') { should cmp '127.0.0.1/32' }
  end

  postgres_access = postgres_session('sous_chef', '67890')

  describe postgres_access.query('SELECT 1;', ['postgres']) do
    its('output') { should eq '1' }
  end
end
<commit_msg>Fix the name of base access control<commit_after>control 'postgresql-local-access' do
  impact 1.0
  desc 'This test ensures postgres has localhost access to the database'

  describe postgres_hba_conf.where { type == 'host' && user == 'postgres' } do
    its('database') { should cmp 'all' }
    its('user') { should cmp 'postgres' }
    its('auth_method') { should cmp 'md5' }
    its('address') { should cmp '127.0.0.1/32' }
  end

  postgres_access = postgres_session('postgres', '12345', '127.0.0.1')

  describe postgres_access.query('SELECT 1;') do
    its('output') { should eq '1' }
  end
end

control 'postgresql-sous-chef-access' do
  impact 1.0
  desc 'This test ensures sous_chefs have local trust access to the database'

  describe postgres_hba_conf.where { user == 'sous_chef' } do
    its('database') { should cmp 'all' }
    its('type') { should cmp 'host' }
    its('auth_method') { should cmp 'md5' }
    its('address') { should cmp '127.0.0.1/32' }
  end

  postgres_access = postgres_session('sous_chef', '67890')

  describe postgres_access.query('SELECT 1;', ['postgres']) do
    its('output') { should eq '1' }
  end
end

{'fraction_non_alphanumeric': 0.1455026455026455, 'fraction_numerical': 0.037037037037037035, 'mean_word_length': 3.776842105263158, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 6, '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': '4222119', 'n_tokens_mistral': 845, 'n_tokens_neox': 796, 'n_words': 220}