Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ msg-*.tar

# Don't commit environment variables used for local testing
.env

/priv/plts/
3 changes: 2 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
3. Returns configured Req client with Authorization header for Graph API calls
3 changes: 2 additions & 1 deletion lib/msg/users.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down