How betogrun/lean-microsoft-graph works
Project Type Analysis
This is a Ruby gem (library) that serves as a wrapper/client for Microsoft Graph API, specifically designed to work with Faraday version 1. The architecture should focus on showing the interaction flow between the client application, this gem, and Microsoft Graph API.
Main Components
a. Client Application Layer:
• How external applications integrate with the gem
• Entry point through LeanMicrosoftGraph::Client
b. Authentication Layer:
• Credentials management
• Token retrieval and handling
• Interaction with Microsoft Azure AD
c. Resource Layer:
• Resource handlers (Users, Tokens)
• Model objects (User, Token)
d. External Services:
• Microsoft Graph API
• Azure Active Directory
┌─ External Application Layer ─┐
• Client Application │
• ┬─────────────────┘
• ↓
┌─ LeanMicrosoftGraph Gem ────────────────────┐
• ┌─ Client Layer ─┐ │
• Client Class │ │
• ┬────────┘ │
• ↓ │
• ┌─ Authentication Layer ─┐ │
• Credentials │ │
• TokenRetriever │ │
• ┬──────────────┘ │
• ↓ │
• ┌─ Resource Layer ──────┐ │
• TokenResource │ │
• UsersResource │ │
• ┬──────────────┘ │
• ┼──────────────────────────────────┘
• ↓
┌─ External Services ──────┐
• Microsoft Graph API │
• Azure Active Directory│
• ┘
Important Details
a. Authentication Flow:
• Credential flow from Client → Credentials → TokenRetriever
• Token caching and renewal process
b. Resource Handling:
• Demonstrate how Resource classes interact with the Client
• Relationship between resource handlers and their models
c. External Communication:
• API endpoints
• Authentication token flow