Module: Legion::Extensions::Agentic::Self::Identity::Helpers::GraphClient

Defined in:
lib/legion/extensions/agentic/self/identity/helpers/graph_client.rb

Constant Summary collapse

GRAPH_BASE =
'https://graph.microsoft.com/v1.0'

Class Method Summary collapse

Class Method Details

.connection(token:, base: GRAPH_BASE) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/legion/extensions/agentic/self/identity/helpers/graph_client.rb', line 14

def connection(token:, base: GRAPH_BASE)
  require 'faraday'
  Faraday.new(url: base) do |conn|
    conn.request :json
    conn.response :json, content_type: /\bjson$/
    conn.headers['Authorization'] = "Bearer #{token}"
    conn.headers['Content-Type'] = 'application/json'
  end
end