diff --git a/.gitignore b/.gitignore index cbebfba..b7e64ba 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,5 @@ msg-*.tar # Don't commit environment variables used for local testing .env + +/priv/plts/ diff --git a/CLAUDE.md b/CLAUDE.md index 592e741..04c233d 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -79,6 +79,7 @@ The project uses ExUnit with Mox for mocking. Integration tests are separated in ### Authentication Flow The library implements OAuth2 client credentials flow: + 1. `Msg.Client.new/1` accepts credentials (`client_id`, `client_secret`, `tenant_id`) 2. `fetch_token!/1` exchanges credentials for access token via Azure AD -3. Returns configured Req client with Authorization header for Graph API calls \ No newline at end of file +3. Returns configured Req client with Authorization header for Graph API calls diff --git a/lib/msg/users.ex b/lib/msg/users.ex index af8c0a4..c654801 100644 --- a/lib/msg/users.ex +++ b/lib/msg/users.ex @@ -16,12 +16,13 @@ defmodule Msg.Users do Corresponds to: [GET /users] https://learn.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http """ - @spec list(Req.Request.t()) :: {:ok, map()} | {:error, any()} + @spec list(Req.Request.t()) :: {:ok, [map()]} | {:error, any()} def list(client) do Request.get(client, "/users") |> case do {:ok, %{"value" => value}} -> {:ok, value} + error -> error end