<commit_before>class Carto::Api::ApiKeysController < ::Api::ApplicationController
  ssl_required :create
  before_filter :api_authorization_required

  def create
    api_key = ::Carto::ApiKey.new
    api_key.user_id = current_user.id
    api_key.type = ::Carto::ApiKey::TYPE_REGULAR
    api_key.name = params[:name]
    api_key.grants_json = params[:grants]
    api_key.save!
    render_jsonp(::Carto::Api::ApiKeyPresenter.new(api_key).to_poro)
  end
end
<commit_msg>Add FF<commit_after>class Carto::Api::ApiKeysController < ::Api::ApplicationController
  ssl_required :create
  before_filter :api_authorization_required
  before_filter :check_feature_flag

  def check_feature_flag
    render_404 unless current_user.try(:has_feature_flag?, 'auth_api')
  end

  def create
    api_key = ::Carto::ApiKey.new
    api_key.user_id = current_user.id
    api_key.type = ::Carto::ApiKey::TYPE_REGULAR
    api_key.name = params[:name]
    api_key.grants_json = params[:grants]
    api_key.save!
    render_jsonp(::Carto::Api::ApiKeyPresenter.new(api_key).to_poro)
  end
end

{'fraction_non_alphanumeric': 0.11142322097378277, 'fraction_numerical': 0.0028089887640449437, 'mean_word_length': 5.179190751445087, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6881169', 'n_tokens_mistral': 385, 'n_tokens_neox': 376, 'n_words': 56}