Verified against konsol 3e220ba8 and konsolidat 54d072a on 2026-11-05. Items marked "not built" are not in the code; items marked "hosting" depend on where you run it.
Design
- konsol (Frappe v16) owns users, roles, declarations, approvals, the close and the audit trail.
- ClickHouse owns the numbers. Nothing outside the stack reads it; konsol reads it over HTTP from inside the Compose network.
- Excel reads and writes only through konsol's API.
- Approvals are the control. A rate, journal, ownership change, deal or build is approved from the record's Actions menu by a role that may; an approval after sign-off voids the signature (konsol#338, #341).
┌──────────────────────────────────────────────────────────────┐
│ Clients: Excel add-in · close app /close · Desk /desk · CLI │
└──────────────┬───────────────────────────────────────────────┘
│ HTTPS (Caddy) — session cookie, or X-Konsolidat-Token
▼
┌──────────────────────────────────────────────────────────────┐
│ konsol: roles · User Permissions on Entity · workflows │
│ Close Event audit trail · track_changes on doctypes │
│ MariaDB (declarations, approvals) │
└──────────────┬───────────────────────────────────────────────┘
│ HTTP inside the Compose network (TLS optional)
▼
┌──────────────────────────────────────────────────────────────┐
│ ClickHouse: ports bound to 127.0.0.1 unless CLICKHOUSE_BIND │
└──────────────────────────────────────────────────────────────┘
1. Identity and authentication
| Mechanism | Details | Status |
|---|
| Frappe session login | Username and password at /api/method/login; the session cookie is sent on every Desk, close-app and API call | Shipped |
| Excel add-in bearer token | The task pane posts to konsol.api.excel_addin_auth (credentials: "omit"), stores the token in localStorage (konsol_token); functions.js sends it as X-Konsolidat-Token; konsol.excel_addin_auth.apply_excel_token_auth runs before_request and signs the request in as the token's user. Token life 8 hours (_TOKEN_TTL). Cookies are also sent, forced SameSite=None; Secure; Partitioned as a fallback (excel_addin_cookies.py) | Shipped |
| API keys | Frappe API key and secret (User → API Access); used by konsol-cli --backend api and the MCP server | Shipped (Frappe) |
| Guest methods | Five: health, excel_addin_auth, excel_addin_whoami, excel_addin_logout, airbyte_sync_complete (the last needs X-Webhook-Secret, compared in constant time, konsol#10) | Shipped |
| 2FA | Frappe built-in, configurable per role | Available (Frappe) |
| Microsoft Entra ID SSO | No OAuth or social-login code in konsol; the only OAuth client is the D365 connector's client-credentials flow | Not built |
2. Authorisation
Roles
Roles are defined on the doctypes (konsol/*/doctype/*/*.json) and in frappe.only_for gates on the API.
| Role | Used for |
|---|
| EPM Admin | Configuration: chart upload and publish, Dimension, Measure, Dataset, Connector, Build Approval, EPM Settings; Close Lead in the close app |
| EPM Analyst | Group Accountant in the close app: drafts rates, journals, IC balances, ownership changes; runs checks |
| Entity Accountant | Uploads and submits trial balances for the entities a User Permission grants; sees My work and Trial balances only |
| EPM User | Viewer: read-only across the close app and K.EPM reads |
| Budget Submitter / Manager / Controller / Approver | The budget doctypes (Budget Cycle, Sheet, Line, Annual Input, Spread Profile) |
| System Manager | Frappe administration; also passes every gate |
The close app maps these to four personas (konsol/close/period_model.py): Close Lead, Group Accountant, Entity Accountant, Viewer. Which role may do what at each close step is listed in the Period Close Guide and the Period close API.
Entity scope
konsol/entity_permissions.py: a Frappe User Permission on Entity restricts a user to that entity's sub-tree, in Desk lists (permission_query_conditions), in the close app and in epm_value / epm_batch (_assert_entity_access; a refused item is a 403, per item in a batch). As in every Frappe app, no permission means no restriction; EPM Settings.restrict_entities_by_default turns that into deny-by-default. Entity-scoped doctypes include Consolidation Group, Ownership Period, Budget Sheet and Historical Equity Rate; Consolidation Journal is deliberately group-level (decision on konsol#305, 2026-09-27).
Writes
Every method that writes is @frappe.whitelist(methods=["POST"]); a GET rolls back (konsol/CLAUDE.md; tests/test_close_api_contract.py). Four orchestrator methods (start_run, retry_step, resume_run, cancel_run) and trigger_pipeline write without declaring POST-only (PRD-02 open question).
3. Transport and network
| Layer | Implementation | Status |
|---|
| TLS | Caddy issues a certificate when SITE_DOMAIN is a hostname; for an IP or localhost the site stays http (deploy.sh domain_scheme) | Shipped |
| ClickHouse isolation | Ports 8123, 9000 and the Postgres-wire 15432 bind to ${CLICKHOUSE_BIND:-127.0.0.1}; konsol reaches ClickHouse by service name inside the Compose network | Shipped |
| ClickHouse TLS | EPM Settings.clickhouse_secure switches the client to HTTPS; clickhouse_verify_tls controls certificate checks (konsol#11) | Shipped; clickhouse_secure defaults to 0, clickhouse_verify_tls to 1 |
| SQL transport | Queries and write-through inserts go in the POST body with parameters, never in the URL (konsol#188, #194) | Shipped |
| CORS | No allow_cors in hooks.py, the configurator or the Caddyfile. Excel on the web needs the add-in's functions.json served with a CORS header; this is a deployment setting, not shipped code | Not configured |
| Rate limiting | None configured in konsol or Caddy | Not configured |
4. Audit trail
| Mechanism | Details |
|---|
| Field-level change tracking | track_changes is on for 43 of the doctype definitions (Frappe Version documents record who changed which field, when) |
| Close Event | Every close action (sign-off, reject with reason, reminder, commentary saved, sent back, IC sent back) is a Close Event; the Audit trail screen filters and exports CSV (konsol#326, #345) |
| Assertion Run | Each run records every test's result and its failing-row sample (group-only, konsol#165); signed runs carry a fingerprint of the numbers |
| Approvals | Submittable doctypes: the submit is the approval; a correction supersedes rather than edits (Group Exchange Rate); a reject records its reason (konsol#310) |
| Statement Commentary | Versioned, cannot be deleted |
| Build Approval | Who approved which dbt build of which scope, and when |
5. Data protection
| Concern | Approach | Status |
|---|
| PII | The warehouse holds trial balances: account, entity, period, amounts, declared dimensions. No personal data unless a dimension carries it | Design |
| Budget confidentiality | User Permissions on Entity scope budget reads and writes | Shipped |
| Encryption at rest | Whatever the host or cloud disk provides | Hosting |
| Encryption in transit | Browser and Excel to Caddy over TLS; konsol to ClickHouse inside Compose, HTTPS optional | Shipped / optional |
| Backup | ./deploy.sh backup (docker/backup/backup.sh): MariaDB, Frappe files, ClickHouse epm, epm_staging, epm_bronze, epm_silver, epm_gold; not epm_raw, which is rebuilt from Trial Balance Submissions (konsol PR #381). Retention BACKUP_RETENTION_DAYS. No restore smoke test yet (konsolidat#241) | Shipped, partial |
| Secrets | deploy.sh generates .env secrets; ERP credentials live on the Connector doctype (Frappe Password fields), not in .env | Shipped |
Excel add-in
Eight K. custom functions in a shared Office.js runtime. Reads are batched into POST /api/method/konsol.api.epm_batch (at most 2,000 items), K.EPMSAVE calls POST /api/method/konsol.api.budget_cell_save. Every call carries the bearer token; the server applies the caller's roles and entity scope. The manifest's SourceLocation and the functions.json URL must be served from the konsol site over HTTPS for Excel on the web. See Excel Custom Functions.
| Hyperion SmartView | konsol add-in |
|---|
| Cell formula | =HsGetValue(...) | =K.EPM(...) |
| Submit data | SmartView submit | =K.EPMSAVE(...) |
| Auth | EPM workspace login | Frappe login; bearer token, 8 hours |
| Install | Desktop plugin | Office add-in: desktop and web |
Known gaps
| Gap | Issue |
|---|
| Entra ID SSO | Roadmap (Phase 4 in repo/docs/prd/README.md); not built |
| CORS and rate limiting | Not configured; document the deployment's reverse-proxy settings when you add them |
cli_api.export_config_api, diff_config_api, apply_config_api have no role gate beyond login | PRD-02 open question; apply_config_api writes configuration |
Orchestrator start_run, retry_step, resume_run, cancel_run and trigger_pipeline write without methods=["POST"] | PRD-02 open question |
Backup restore is unproven; epm_raw not in the backup | konsolidat#241; konsol#283 closed by PR #381 |
| The Frappe image is not built in CI | konsolidat#244 |