# os-lab-daejinuniv/ospass architecture

> Architecture diagram of the GitHub repository os-lab-daejinuniv/ospass, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/os-lab-daejinuniv/ospass
- Repository: https://github.com/os-lab-daejinuniv/ospass

## Overview

##### Main Components

a) Client Components:
- OS Utility APP (Client Application)
- OSPASS Application/Service

b) Server Components:
- Authorization Server
- API Gateway (api.oslab)
- Authentication Service

##### Key Interactions

a) Authorization Flow:
- Authorization code request/response cycle
- Callback mechanism

##### API Endpoints
- POST /api/v1/card-response
- GET /api/v1/authorization-code
- GET /api/v1/callback

**[OS Utility APP] ←→ [API Gateway] ←→ [OSPASS Service]**
- ↑
- ↓
- [Authorization Server]

##### Additional Elements
- Version information (v1)
- Security boundaries
- Authentication checkpoints

##### Important Notes
- Sequence of authorization code flow
- Where data validation occurs
- Error handling paths

Remember to include:
- Security boundaries
- API versioning
- Data validation checkpoints
- Error handling paths
- Clear labeling of all components
- Directional flow indicators
- Authentication/Authorization checkpoints

This will provide a comprehensive view of the OSPASS authentication architecture while maintaining clarity and usefulness for technical discussions.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles and classes
    classDef client fill:#3498db,stroke:#2980b9,color:white
    classDef gateway fill:#2ecc71,stroke:#27ae60,color:white
    classDef auth fill:#e67e22,stroke:#d35400,color:white
    classDef service fill:#9b59b6,stroke:#8e44ad,color:white
    classDef endpoint fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef error fill:#e74c3c,stroke:#c0392b,color:white

    %% Client Layer
    subgraph ClientLayer["Client Layer"]
        OSUtility["OS Utility APP"]:::client
        OSPASS["OSPASS Service"]:::service
    end

    %% API Gateway Layer
    subgraph GatewayLayer["API Gateway Layer"]
        APIGateway["api.oslab"]:::gateway
    end

    %% Authorization Layer
    subgraph AuthLayer["Authorization Layer"]
        AuthServer["Authorization Server"]:::auth
        AuthCode["Authorization Code\nEndpoint"]:::endpoint
        Callback["Callback\nEndpoint"]:::endpoint
        CardResponse["Card Response\nEndpoint"]:::endpoint
    end

    %% Error Handling
    ErrorHandler["Error Handler"]:::error

    %% Connections
    OSUtility --> |"1. Request Auth"| APIGateway
    APIGateway --> |"2. Route"| AuthCode
    AuthCode --> |"3. Generate Code"| AuthServer
    AuthServer --> |"4. Return Code"| APIGateway
    APIGateway --> |"5. Callback"| Callback
    Callback --> |"6. Validate"| AuthServer
    OSUtility --> |"7. Card Response"| CardResponse
    CardResponse --> |"8. Process"| OSPASS

    %% Error Paths
    APIGateway -.-> ErrorHandler
    AuthServer -.-> ErrorHandler
    OSPASS -.-> ErrorHandler

    %% API Endpoints
    AuthCode["GET /api/v1/authorization-code"]:::endpoint
    Callback["GET /api/v1/callback"]:::endpoint
    CardResponse["POST /api/v1/card-response"]:::endpoint

    %% Legend
    subgraph Legend
        Client["Client Component"]:::client
        Gateway["Gateway"]:::gateway
        Authorization["Authorization Component"]:::auth
        Endpoint["API Endpoint"]:::endpoint
        Error["Error Handler"]:::error
    end
```
