<commit_before>require "spec_helper"

describe Api::OpenidConnect::IdTokensController, type: :controller do
  describe "#jwks" do
    before do
      get :jwks
    end

    it "should contain a public key that matches the internal private key" do
      json = JSON.parse(response.body).with_indifferent_access
      jwks = JSON::JWK::Set.new json[:keys]
      public_keys = jwks.map do |jwk|
        JSON::JWK.decode jwk
      end
      public_key = public_keys.first
      expect(Api::OpenidConnect::IdTokenConfig::PUBLIC_KEY.to_s).to eq(public_key.to_s)
    end
  end
end
<commit_msg>Update json-jwt legacy methods<commit_after>require "spec_helper"

describe Api::OpenidConnect::IdTokensController, type: :controller do
  describe "#jwks" do
    before do
      get :jwks
    end

    it "should contain a public key that matches the internal private key" do
      json = JSON.parse(response.body).with_indifferent_access
      jwks = JSON::JWK::Set.new json[:keys]
      public_keys = jwks.map do |jwk|
        JSON::JWK.new(jwk).to_key
      end
      public_key = public_keys.first
      expect(Api::OpenidConnect::IdTokenConfig::PUBLIC_KEY.to_s).to eq(public_key.to_s)
    end
  end
end

{'fraction_non_alphanumeric': 0.09547738693467336, 'fraction_numerical': 0.0, 'mean_word_length': 3.4095940959409594, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6439542', 'n_tokens_mistral': 408, 'n_tokens_neox': 397, 'n_words': 96}