Add device data model and ITAM service

Introduce device, posture, and enrollment-token entities with ITAM
service policies for agent-managed fleet inventory.

Signed-off-by: Ludovic Vielle <ludovic@probo.com>
This commit is contained in:
Ludovic Vielle
2026-07-14 20:38:38 +02:00
parent fa3b7dc2b3
commit 1f79453386
21 changed files with 3591 additions and 0 deletions

View File

@@ -509,6 +509,17 @@ json.Unmarshal(plaintext, &c.Connection)
- **Return plaintext tokens once.** For SHA-256-hashed tokens, return the raw token to the caller at creation time only. After that, the application only ever sees the hash.
- **Migration columns.** When adding a new sensitive column, always use `BYTEA`. Never add `DEFAULT` on sensitive columns.
## Resource ownership
Org-scoped owners are stored as `owner_profile_id` → `iam_membership_profiles`,
not identity GIDs. GraphQL uses `ownerId`; resolvers load `owner: Profile` via
dataloader. Employee self-service resolves identity → profile at the API
boundary; IAM may bridge profile storage back to identity in
`AuthorizationAttributes`.
See [`ownership.md`](ownership.md) for the full pattern (provisional — pending
team review).
## New entity checklist
1. **Entity file** (`entity.go`) — struct with `db` tags, slice type alias, `LoadByID`, `Insert`, `Update`, `Delete`, `CursorKey`, `AuthorizationAttributes`