• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

source-academy / backend / 7e642952d0555adb4cd923cf9682728662eb8fbb-PR-1259

14 May 2025 04:25PM UTC coverage: 93.607%. Remained the same
7e642952d0555adb4cd923cf9682728662eb8fbb-PR-1259

Pull #1259

github

RichDom2185
Update CD workflow
Pull Request #1259: Upgrade CI runner version and README

3104 of 3316 relevant lines covered (93.61%)

1064.61 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/lib/cadet/auth/providers/openid/mit_csail_claim_extractor.ex
1
defmodule Cadet.Auth.Providers.MITCSAILClaimExtractor do
2
  @moduledoc """
3
  Extracts fields from MIT CSAIL OIDC JWTs.
4
  """
5

6
  @behaviour Cadet.Auth.Providers.OpenID.ClaimExtractor
7

8
  def get_username(_claims, access_token), do: get_userinfo(access_token, "email")
×
9

10
  def get_name(_claims, access_token), do: get_userinfo(access_token, "name")
×
11

12
  def get_token_type, do: "access_token"
×
13

14
  defp get_userinfo(token, key) do
15
    headers = [{"Authorization", "Bearer #{token}"}]
×
16
    options = [timeout: 10_000, recv_timeout: 10_000]
×
17

18
    case HTTPoison.get("https://oidc.csail.mit.edu/userinfo", headers, options) do
×
19
      {:ok, %{body: body, status_code: 200}} ->
20
        body |> Jason.decode!() |> Map.get(key)
×
21

22
      {:ok, _} ->
×
23
        nil
24
    end
25
  end
26
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc