<commit_before>require "json"

require_relative "secret"
require_relative "../client"
require_relative "../request"
require_relative "../response"

module Vault
  class Certificate < Response.new(:display_name, :certificate, :policies, :ttl); end

  class Client
    # A proxy to the {AuthToken} methods.
    # @return [AuthToken]
    def auth_tls
      @auth_tls ||= AuthTLS.new(self)
    end
  end

  class AuthTLS < Request

    # This enables the auth tls cert backend
    def enable
      client.sys.enable_auth('cert', 'cert', 'Allow to login via TLS certificate')
    end

    # This disable the auth tls cert backend
    def disable
      client.sys.disable_auth('cert')
    end
<commit_msg>Add enabled? method to auth_tls<commit_after>require "json"

require_relative "secret"
require_relative "../client"
require_relative "../request"
require_relative "../response"

module Vault
  class Certificate < Response.new(:display_name, :certificate, :policies, :ttl); end

  class Client
    # A proxy to the {AuthToken} methods.
    # @return [AuthToken]
    def auth_tls
      @auth_tls ||= AuthTLS.new(self)
    end
  end

  class AuthTLS < Request

    # This enables the auth tls cert backend
    def enable
      client.sys.enable_auth('cert', 'cert', 'Allow to login via TLS certificate')
    end

    def enabled?
      client.sys.auths.keys.include? :cert
    end

    # This disable the auth tls cert backend
    def disable
      client.sys.disable_auth('cert')
    end

{'fraction_non_alphanumeric': 0.09966329966329966, 'fraction_numerical': 0.0, 'mean_word_length': 3.2096317280453257, 'pattern_counts': {'":': 0, '<': 7, '<?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': '6580424', 'n_tokens_mistral': 452, 'n_tokens_neox': 440, 'n_words': 143}