# islem52/securecorp architecture

> Architecture diagram of the GitHub repository islem52/securecorp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/islem52/securecorp
- Repository: https://github.com/islem52/securecorp

## Overview

SecureCorp is a distributed access-control system. A client enrolls or logs in with the KDC, exchanges a TGT for a service-specific ticket, then presents that ticket to the HR or Finance resource server. The server validates the ticket and asks the PDP to decide access using RBAC and ABAC policies. The graph includes the principal services, authorization stages, and their JSON-backed state. Relationships are grounded in the shown server code or README; the resource and policy JSON contents were not sampled.

Main entry points: [`services/pdp/server.js`](https://github.com/islem52/securecorp/blob/main/services/pdp/server.js) (Policy Decision Point), [`services/hr-service/server.js`](https://github.com/islem52/securecorp/blob/main/services/hr-service/server.js) (HR Resource Server), [`services/finance-service/server.js`](https://github.com/islem52/securecorp/blob/main/services/finance-service/server.js) (Finance Resource Server), [`services/auth-server/server.js`](https://github.com/islem52/securecorp/blob/main/services/auth-server/server.js) (Login and TGT)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_auth["Authentication"]
  node_signup["User Signup<br/>[server.js]"]
  node_userstore[("User Records<br/>[users.json]")]
  node_login["Login and TGT<br/>[server.js]"]
  node_ticket["Service Ticket Issuer<br/>[server.js]"]
end

subgraph group_resources["Resource Services"]
  node_hr["HR Resource Server<br/>[server.js]"]
  node_hrdata[("HR Resources<br/>[resources.json]")]
  node_finance["Finance Resource Server<br/>[server.js]"]
  node_financedata[("Finance Resources<br/>[resources.json]")]
end

subgraph group_policy["Policy Decisions"]
  node_pdp["Policy Decision Point<br/>[server.js]"]
  node_policydata[("Policy Definitions<br/>[policies.json]")]
  node_rbac["RBAC Check<br/>[server.js]"]
  node_abac["ABAC Restrictions<br/>[server.js]"]
end

node_client(("Client"))

node_client -->|"registers"| node_signup
node_signup -->|"writes users"| node_userstore
node_login -->|"checks credentials"| node_userstore
node_client -->|"authenticates"| node_login
node_login -->|"provides TGT"| node_ticket
node_client -->|"requests ticket"| node_ticket
node_ticket -->|"returns ticket"| node_client
node_client -->|"requests resources"| node_hr
node_client -->|"requests resources"| node_finance
node_hr -->|"loads resources"| node_hrdata
node_finance -->|"loads resources"| node_financedata
node_hr -->|"submits context"| node_pdp
node_finance -->|"submits context"| node_pdp
node_pdp -->|"returns decision"| node_hr
node_pdp -->|"returns decision"| node_finance
node_pdp -->|"loads policies"| node_policydata
node_pdp -->|"checks role actions"| node_rbac
node_pdp -->|"checks restrictions"| node_abac
node_client -->|"requests evaluation"| node_pdp

click node_signup "https://github.com/islem52/securecorp/blob/main/services/auth-server/server.js"
click node_userstore "https://github.com/islem52/securecorp/blob/main/services/auth-server/users.json"
click node_login "https://github.com/islem52/securecorp/blob/main/services/auth-server/server.js"
click node_ticket "https://github.com/islem52/securecorp/blob/main/services/auth-server/server.js"
click node_hr "https://github.com/islem52/securecorp/blob/main/services/hr-service/server.js"
click node_hrdata "https://github.com/islem52/securecorp/blob/main/services/hr-service/resources.json"
click node_finance "https://github.com/islem52/securecorp/blob/main/services/finance-service/server.js"
click node_financedata "https://github.com/islem52/securecorp/blob/main/services/finance-service/resources.json"
click node_pdp "https://github.com/islem52/securecorp/blob/main/services/pdp/server.js"
click node_policydata "https://github.com/islem52/securecorp/blob/main/services/pdp/policies.json"
click node_rbac "https://github.com/islem52/securecorp/blob/main/services/pdp/server.js"
click node_abac "https://github.com/islem52/securecorp/blob/main/services/pdp/server.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_signup,node_userstore,node_login,node_ticket,node_client toneBlue
class node_hr,node_hrdata,node_finance,node_financedata toneAmber
class node_pdp,node_policydata,node_rbac,node_abac toneMint
```

## Components

### Authentication

- [User Signup](https://github.com/islem52/securecorp/blob/main/services/auth-server/server.js): `services/auth-server/server.js`
- [User Records](https://github.com/islem52/securecorp/blob/main/services/auth-server/users.json): `services/auth-server/users.json`
- [Login and TGT](https://github.com/islem52/securecorp/blob/main/services/auth-server/server.js): `services/auth-server/server.js`
- [Service Ticket Issuer](https://github.com/islem52/securecorp/blob/main/services/auth-server/server.js): `services/auth-server/server.js`

### Resource Services

- [HR Resource Server](https://github.com/islem52/securecorp/blob/main/services/hr-service/server.js): `services/hr-service/server.js`
- [HR Resources](https://github.com/islem52/securecorp/blob/main/services/hr-service/resources.json): `services/hr-service/resources.json`
- [Finance Resource Server](https://github.com/islem52/securecorp/blob/main/services/finance-service/server.js): `services/finance-service/server.js`
- [Finance Resources](https://github.com/islem52/securecorp/blob/main/services/finance-service/resources.json): `services/finance-service/resources.json`

### Policy Decisions

- [Policy Decision Point](https://github.com/islem52/securecorp/blob/main/services/pdp/server.js): `services/pdp/server.js`
- [Policy Definitions](https://github.com/islem52/securecorp/blob/main/services/pdp/policies.json): `services/pdp/policies.json`
- [RBAC Check](https://github.com/islem52/securecorp/blob/main/services/pdp/server.js): `services/pdp/server.js`
- [ABAC Restrictions](https://github.com/islem52/securecorp/blob/main/services/pdp/server.js): `services/pdp/server.js`

### Other components

- **Client**

## Connections

- Client → User Signup: registers (evidence: `README.md`)
- User Signup → User Records: writes users (evidence: `services/auth-server/server.js`)
- Login and TGT → User Records: checks credentials (evidence: `services/auth-server/server.js`)
- Client → Login and TGT: authenticates (evidence: `README.md`)
- Login and TGT → Service Ticket Issuer: provides TGT (evidence: `README.md`)
- Client → Service Ticket Issuer: requests ticket (evidence: `README.md`)
- Service Ticket Issuer → Client: returns ticket (evidence: `README.md`)
- Client → HR Resource Server: requests resources (evidence: `README.md`)
- Client → Finance Resource Server: requests resources (evidence: `README.md`)
- HR Resource Server → HR Resources: loads resources (evidence: `services/hr-service/server.js`)
- Finance Resource Server → Finance Resources: loads resources (evidence: `services/finance-service/server.js`)
- HR Resource Server → Policy Decision Point: submits context (evidence: `services/hr-service/server.js`)
- Finance Resource Server → Policy Decision Point: submits context (evidence: `services/finance-service/server.js`)
- Policy Decision Point → HR Resource Server: returns decision (evidence: `services/hr-service/server.js`)
- Policy Decision Point → Finance Resource Server: returns decision (evidence: `services/finance-service/server.js`)
- Policy Decision Point → Policy Definitions: loads policies (evidence: `services/pdp/server.js`)
- Policy Decision Point → RBAC Check: checks role actions (evidence: `services/pdp/server.js`)
- Policy Decision Point → ABAC Restrictions: checks restrictions (evidence: `services/pdp/server.js`)
- Client → Policy Decision Point: requests evaluation (evidence: `README.md`)
