diff --git a/README.md b/README.md new file mode 100644 index 0000000..5d40379 --- /dev/null +++ b/README.md @@ -0,0 +1,131 @@ +# GoETAAPI + +This repository contains the backend API and database layer for **ETA Viaporte** — a logistics marketplace platform. + +> The project is currently at the **database design and infrastructure** stage. The sections below describe what is available and how to work with it. + +--- + +## Repository Structure + +``` +GoETAAPI/ +├── app/ # Go API source (in progress) +└── db/ + ├── Models/ # Schema design files (MySQL Workbench + SQL scripts) + ├── container/ # Dockerfile for the MariaDB test container + └── service/ # Docker Compose + Makefile for local deployment +``` + +--- + +## DB + +### Schema Design + +The database schema is defined under `db/Models/` and targets the schema `u947463964_etaviaporte`. + +| File | Description | +|---|---| +| `db/Models/eta_rbac.mwb` | MySQL Workbench model — open this to visualize the full schema diagram | +| `db/Models/schemas/eta_rbac.sql` | Forward-engineered SQL schema (generated from the `.mwb` model) | +| `db/Models/init/eta_rbac_init.sql` | Seed / initialization data | +| `db/Models/eta_rbac_requirements.md` | Human-readable data requirements derived from the schema constraints | + +To inspect or modify the schema visually, open `db/Models/eta_rbac.mwb` with **MySQL Workbench**. + +The schema covers: +- **Users & Authentication** — `users`, `auth_identities`, `verification_tokens`, `sessions` +- **RBAC** — `applications`, `roles`, `permissions`, `role_permissions`, `user_roles` +- **Companies & Locations** — `companies`, `locations` +- **Loads & Shipments** — `loads`, `vehicles`, `shipment_proposals`, `shipment_agreements`, `load_shipments` + +--- + +### Docker Container + +The image is built from `db/container/Dockerfile`. It uses **Alpine + MariaDB** and automatically generates a root password on first run. SQL files placed in `/docker-entrypoint-initdb.d` inside the container are executed on startup. + +#### Build the image + +Run from `db/container/`: + +```sh +docker buildx build -t eta/eta-db . +``` + +#### Run the container (basic) + +```sh +docker run --name eta-db -d -p 3306:3306 eta/eta-db +docker logs -f eta-db # root password is printed here on first boot +``` + +#### Run the container with a named database and user + +```sh +docker run --name eta-db \ + -e MYSQL_DATABASE=u947463964_etaviaporte \ + -e MYSQL_USER=etaapi \ + -e MYSQL_PASSWORD="secret_password" \ + -d -p 3306:3306 eta/eta-db +``` + +#### Run with schema initialization scripts + +Mount a directory of `.sql` files into `/docker-entrypoint-initdb.d` and they will be executed in order on first start: + +```sh +docker run --name eta-db \ + -e MYSQL_DATABASE=u947463964_etaviaporte \ + -e MYSQL_USER=etaapi \ + -e MYSQL_PASSWORD="secret_password" \ + -v ./docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d \ + -d -p 3306:3306 eta/eta-db +``` + +> **Note:** Avoid using `"` (double quotes) in SQL scripts — use `'` (single quotes) instead. Inline comments at the end of SQL statements may also cause parsing errors. + +--- + +### Docker Compose (local testing) + +`db/service/compose.yml` deploys the `eta/eta-db` image with the schema and seed data pre-loaded. It mounts `db/service/initdb/` into the container's init directory. + +Before deploying with Compose, populate `db/service/initdb/` by running `make prepare` (see below), then start the service: + +```sh +cd db/service +docker compose up -d +``` + +The service exposes MariaDB on port `3306` with: + +| Variable | Value | +|---|---| +| `MYSQL_DATABASE` | `u947463964_etaviaporte` | +| `MYSQL_USER` | `etaapi` | +| `MYSQL_PASSWORD` | `secret_password` | + +> The `initdb/` volume uses the `:Z` SELinux label to avoid permission denied errors on SELinux-enabled systems. + +--- + +### Makefile — Prepare init scripts + +The `db/service/Makefile` copies the latest schema and seed files from `db/Models/` into `db/service/initdb/`, so they are picked up by Docker Compose on the next container start. + +```sh +cd db/service +make prepare +``` + +This runs: +1. Clears any existing `.sql` files from `db/service/initdb/`. +2. Copies `db/Models/schemas/eta_rbac.sql` → `initdb/00-schema.sql` +3. Copies `db/Models/init/eta_rbac_init.sql` → `initdb/01-initdb.sql` + +Always run `make prepare` after updating the schema model before bringing the Compose service up. + + + diff --git a/db/Models/assets/ETA_RBAC_model.svg b/db/Models/assets/ETA_RBAC_model.svg index 184b92f..138ca89 100644 --- a/db/Models/assets/ETA_RBAC_model.svg +++ b/db/Models/assets/ETA_RBAC_model.svg @@ -1,5 +1,5 @@ - + @@ -266,12 +266,12 @@ - - - - - - + + + + + + @@ -295,7 +295,7 @@ - + @@ -311,7 +311,7 @@ - + @@ -320,7 +320,7 @@ - + @@ -342,7 +342,7 @@ - + @@ -364,7 +364,7 @@ - + @@ -400,7 +400,7 @@ - + @@ -422,7 +422,7 @@ - + @@ -431,7 +431,7 @@ - + @@ -451,7 +451,7 @@ - + @@ -473,7 +473,7 @@ - + @@ -509,7 +509,7 @@ - + @@ -526,7 +526,7 @@ - + @@ -535,7 +535,7 @@ - + @@ -558,7 +558,7 @@ - + @@ -580,7 +580,7 @@ - + @@ -616,7 +616,7 @@ - + @@ -631,7 +631,7 @@ - + @@ -640,7 +640,7 @@ - + @@ -660,7 +660,7 @@ - + @@ -681,7 +681,7 @@ - + @@ -704,7 +704,7 @@ - + @@ -727,7 +727,7 @@ - + @@ -749,7 +749,7 @@ - + @@ -816,7 +816,7 @@ - + @@ -825,7 +825,7 @@ - + @@ -834,7 +834,7 @@ - + @@ -855,7 +855,7 @@ - + @@ -875,7 +875,7 @@ - + @@ -894,7 +894,7 @@ - + @@ -916,7 +916,7 @@ - + @@ -1002,7 +1002,7 @@ - + @@ -1017,7 +1017,7 @@ - + @@ -1026,7 +1026,7 @@ - + @@ -1047,7 +1047,7 @@ - + @@ -1067,7 +1067,7 @@ - + @@ -1086,7 +1086,7 @@ - + @@ -1108,7 +1108,7 @@ - + @@ -1189,7 +1189,7 @@ - + @@ -1209,7 +1209,7 @@ - + @@ -1218,7 +1218,7 @@ - + @@ -1232,7 +1232,7 @@ - + @@ -1252,7 +1252,7 @@ - + @@ -1274,7 +1274,7 @@ - + @@ -1393,7 +1393,7 @@ - + @@ -1407,7 +1407,7 @@ - + @@ -1416,7 +1416,7 @@ - + @@ -1430,7 +1430,7 @@ - + @@ -1444,7 +1444,7 @@ - + @@ -1466,7 +1466,7 @@ - + @@ -1488,7 +1488,7 @@ - + @@ -1601,7 +1601,7 @@ - + @@ -1617,7 +1617,7 @@ - + @@ -1626,7 +1626,7 @@ - + @@ -1646,7 +1646,7 @@ - + @@ -1666,7 +1666,7 @@ - + @@ -1685,7 +1685,7 @@ - + @@ -1707,7 +1707,7 @@ - + @@ -1778,7 +1778,7 @@ - + @@ -1799,7 +1799,7 @@ - + @@ -1808,7 +1808,7 @@ - + @@ -1822,7 +1822,7 @@ - + @@ -1843,7 +1843,7 @@ - + @@ -1865,7 +1865,7 @@ - + @@ -1955,7 +1955,7 @@ - + @@ -1975,7 +1975,7 @@ - + @@ -1984,7 +1984,7 @@ - + @@ -2005,7 +2005,7 @@ - + @@ -2019,7 +2019,7 @@ - + @@ -2039,7 +2039,7 @@ - + @@ -2061,7 +2061,7 @@ - + @@ -2083,7 +2083,7 @@ - + @@ -2189,139 +2189,9 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -2340,7 +2210,7 @@ - + @@ -2349,7 +2219,7 @@ - + @@ -2363,7 +2233,7 @@ - + @@ -2387,7 +2257,7 @@ - + @@ -2413,7 +2283,7 @@ - + @@ -2442,7 +2312,7 @@ - + @@ -2463,7 +2333,7 @@ - + @@ -2485,7 +2355,7 @@ - + @@ -2507,7 +2377,7 @@ - + @@ -2599,7 +2469,7 @@ - + @@ -2622,7 +2492,7 @@ - + @@ -2631,7 +2501,7 @@ - + @@ -2654,7 +2524,7 @@ - + @@ -2680,7 +2550,7 @@ - + @@ -2700,7 +2570,7 @@ - + @@ -2722,7 +2592,7 @@ - + @@ -2744,7 +2614,7 @@ - + @@ -2766,7 +2636,7 @@ - + @@ -2867,30 +2737,51 @@ - - - + + + - - - - - - - - + + + + + + + + - - + + - - - - - - + + + + + + - + + + + + + + + + + + + + + + + + + + + + + @@ -2904,7 +2795,7 @@ - + @@ -2938,7 +2829,7 @@ - + @@ -2960,7 +2851,7 @@ - + @@ -2982,7 +2873,7 @@ - + @@ -3004,7 +2895,7 @@ - + @@ -3026,81 +2917,112 @@ - + - - - - - - - + + + + + + + - + - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -3111,7 +3033,7 @@ - + @@ -3120,7 +3042,7 @@ - + @@ -3141,7 +3063,7 @@ - + @@ -3155,7 +3077,7 @@ - + @@ -3175,7 +3097,7 @@ - + @@ -3194,7 +3116,7 @@ - + @@ -3218,7 +3140,7 @@ - + @@ -3235,7 +3157,7 @@ - + @@ -3257,7 +3179,7 @@ - + @@ -3279,7 +3201,7 @@ - + @@ -3362,6 +3284,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3387,7 +3439,7 @@ - + @@ -3409,7 +3461,7 @@ - + @@ -3418,7 +3470,7 @@ - + @@ -3432,7 +3484,7 @@ - + @@ -3449,7 +3501,7 @@ - + @@ -3466,7 +3518,7 @@ - + @@ -3479,7 +3531,7 @@ - + @@ -3501,7 +3553,7 @@ - + @@ -3662,7 +3714,7 @@ - + @@ -3680,7 +3732,7 @@ - + @@ -3689,7 +3741,7 @@ - + @@ -3703,7 +3755,7 @@ - + @@ -3722,7 +3774,7 @@ - + @@ -3744,7 +3796,7 @@ - + @@ -3766,7 +3818,7 @@ - + @@ -3791,7 +3843,7 @@ - + @@ -3884,7 +3936,7 @@ - + @@ -3906,7 +3958,7 @@ - + @@ -3915,7 +3967,7 @@ - + @@ -3929,7 +3981,7 @@ - + @@ -3946,7 +3998,7 @@ - + @@ -3975,7 +4027,7 @@ - + @@ -3997,7 +4049,7 @@ - + @@ -4081,7 +4133,7 @@ - + @@ -4104,7 +4156,7 @@ - + @@ -4113,7 +4165,7 @@ - + @@ -4127,7 +4179,7 @@ - + @@ -4145,7 +4197,7 @@ - + @@ -4163,7 +4215,7 @@ - + @@ -4185,7 +4237,7 @@ - + @@ -4362,7 +4414,7 @@ - + @@ -4375,7 +4427,7 @@ - + @@ -4384,7 +4436,7 @@ - + @@ -4404,7 +4456,7 @@ - + @@ -4423,7 +4475,7 @@ - + @@ -4440,7 +4492,7 @@ - + @@ -4466,7 +4518,7 @@ - + @@ -4488,7 +4540,7 @@ - + @@ -4510,7 +4562,7 @@ - + @@ -4529,7 +4581,7 @@ - + @@ -4552,7 +4604,7 @@ - + @@ -4606,7 +4658,7 @@ - + @@ -4619,7 +4671,7 @@ - + @@ -4628,7 +4680,7 @@ - + @@ -4645,7 +4697,7 @@ - + @@ -4662,7 +4714,7 @@ - + @@ -4683,7 +4735,7 @@ - + @@ -4703,7 +4755,7 @@ - + @@ -4726,7 +4778,7 @@ - + @@ -4748,7 +4800,7 @@ - + @@ -4777,7 +4829,7 @@ - + @@ -4806,7 +4858,7 @@ - + @@ -4826,7 +4878,7 @@ - + @@ -4846,7 +4898,7 @@ - + @@ -4866,7 +4918,7 @@ - + @@ -4885,7 +4937,7 @@ - + @@ -4907,7 +4959,7 @@ - + @@ -4981,7 +5033,7 @@ - + @@ -5000,7 +5052,7 @@ - + @@ -5009,7 +5061,7 @@ - + @@ -5026,7 +5078,7 @@ - + @@ -5048,7 +5100,7 @@ - + @@ -5070,7 +5122,7 @@ - + @@ -5106,7 +5158,7 @@ - + @@ -5131,7 +5183,7 @@ - + @@ -5140,7 +5192,7 @@ - + @@ -5157,7 +5209,7 @@ - + @@ -5185,7 +5237,7 @@ - + @@ -5207,7 +5259,7 @@ - + @@ -5243,7 +5295,7 @@ - + @@ -5271,7 +5323,7 @@ - + @@ -5280,7 +5332,7 @@ - + @@ -5298,7 +5350,7 @@ - + @@ -5314,7 +5366,7 @@ - + @@ -5336,7 +5388,7 @@ - + @@ -5372,7 +5424,7 @@ - + @@ -5389,7 +5441,7 @@ - + @@ -5398,7 +5450,7 @@ - + @@ -5415,7 +5467,7 @@ - + @@ -5429,7 +5481,7 @@ - + @@ -5451,7 +5503,7 @@ - + @@ -5543,7 +5595,7 @@ - + @@ -5561,7 +5613,7 @@ - + @@ -5570,7 +5622,7 @@ - + @@ -5584,7 +5636,7 @@ - + @@ -5602,7 +5654,7 @@ - + @@ -5624,7 +5676,7 @@ - + @@ -5719,7 +5771,7 @@ - + @@ -5736,7 +5788,7 @@ - + @@ -5745,7 +5797,7 @@ - + @@ -5759,7 +5811,7 @@ - + @@ -5776,7 +5828,7 @@ - + @@ -5798,7 +5850,7 @@ - + @@ -5882,7 +5934,7 @@ - + @@ -5900,7 +5952,7 @@ - + @@ -5909,7 +5961,7 @@ - + @@ -5926,7 +5978,7 @@ - + @@ -5946,7 +5998,7 @@ - + @@ -5968,7 +6020,7 @@ - + @@ -6032,7 +6084,7 @@ - + @@ -6059,7 +6111,7 @@ - + @@ -6068,7 +6120,7 @@ - + @@ -6085,7 +6137,7 @@ - + @@ -6100,7 +6152,7 @@ - + @@ -6125,7 +6177,7 @@ - + @@ -6147,7 +6199,7 @@ - + @@ -6313,7 +6365,7 @@ - + @@ -6331,7 +6383,7 @@ - + @@ -6340,7 +6392,7 @@ - + @@ -6357,7 +6409,7 @@ - + @@ -6376,7 +6428,7 @@ - + @@ -6389,7 +6441,7 @@ - + @@ -6411,7 +6463,7 @@ - + @@ -6501,7 +6553,7 @@ - + @@ -6522,7 +6574,7 @@ - + @@ -6531,7 +6583,7 @@ - + @@ -6548,7 +6600,7 @@ - + @@ -6575,7 +6627,7 @@ - + @@ -6595,7 +6647,7 @@ - + @@ -6614,7 +6666,7 @@ - + @@ -6634,7 +6686,7 @@ - + @@ -6656,7 +6708,7 @@ - + @@ -6773,7 +6825,7 @@ - + @@ -6785,7 +6837,7 @@ - + @@ -6794,7 +6846,7 @@ - + @@ -6811,7 +6863,7 @@ - + @@ -6827,7 +6879,7 @@ - + @@ -6841,7 +6893,7 @@ - + @@ -6860,7 +6912,7 @@ - + @@ -6878,7 +6930,7 @@ - + @@ -6906,7 +6958,7 @@ - + @@ -6936,7 +6988,7 @@ - + @@ -6966,7 +7018,7 @@ - + @@ -6988,7 +7040,7 @@ - + @@ -7129,7 +7181,7 @@ - + @@ -7150,7 +7202,7 @@ - + @@ -7159,7 +7211,7 @@ - + @@ -7176,7 +7228,7 @@ - + @@ -7193,7 +7245,7 @@ - + @@ -7220,7 +7272,7 @@ - + @@ -7240,7 +7292,7 @@ - + @@ -7259,7 +7311,7 @@ - + @@ -7279,7 +7331,7 @@ - + @@ -7301,7 +7353,7 @@ - + @@ -7444,7 +7496,7 @@ - + @@ -7453,7 +7505,7 @@ - + @@ -7462,7 +7514,7 @@ - + @@ -7479,7 +7531,7 @@ - + @@ -7496,7 +7548,7 @@ - + @@ -7512,7 +7564,7 @@ - + @@ -7533,7 +7585,7 @@ - + @@ -7552,7 +7604,7 @@ - + @@ -7575,7 +7627,7 @@ - + @@ -7597,7 +7649,7 @@ - + @@ -7622,7 +7674,7 @@ - + @@ -7648,7 +7700,7 @@ - + @@ -7672,7 +7724,7 @@ - + @@ -7698,7 +7750,7 @@ - + @@ -7711,7 +7763,7 @@ - + @@ -7724,7 +7776,7 @@ - + @@ -7745,7 +7797,7 @@ - + @@ -7767,7 +7819,7 @@ - + @@ -7789,7 +7841,7 @@ - + @@ -7808,7 +7860,7 @@ - + @@ -7950,7 +8002,7 @@ - + @@ -7968,7 +8020,7 @@ - + @@ -7977,7 +8029,7 @@ - + @@ -7994,7 +8046,7 @@ - + @@ -8011,7 +8063,7 @@ - + @@ -8031,7 +8083,7 @@ - + @@ -8054,7 +8106,7 @@ - + @@ -8076,7 +8128,7 @@ - + @@ -8101,7 +8153,7 @@ - + @@ -8114,7 +8166,7 @@ - + @@ -8127,7 +8179,7 @@ - + @@ -8148,7 +8200,7 @@ - + @@ -8164,7 +8216,7 @@ - + @@ -8185,7 +8237,7 @@ - + @@ -8207,7 +8259,7 @@ - + @@ -8386,7 +8438,7 @@ - + @@ -8408,7 +8460,7 @@ - + @@ -8417,7 +8469,7 @@ - + @@ -8431,7 +8483,7 @@ - + @@ -8452,7 +8504,7 @@ - + @@ -8474,7 +8526,7 @@ - + @@ -8569,7 +8621,7 @@ - + @@ -8595,7 +8647,7 @@ - + @@ -8604,7 +8656,7 @@ - + @@ -8623,7 +8675,7 @@ - + @@ -8644,7 +8696,7 @@ - + @@ -8666,7 +8718,7 @@ - + @@ -8790,9 +8842,290 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -8814,7 +9147,7 @@ - + @@ -8823,7 +9156,7 @@ - + @@ -8844,7 +9177,7 @@ - + @@ -8867,7 +9200,7 @@ - + @@ -8899,7 +9232,7 @@ - + @@ -8919,7 +9252,7 @@ - + @@ -8938,7 +9271,7 @@ - + @@ -8961,7 +9294,7 @@ - + @@ -8984,7 +9317,7 @@ - + @@ -9002,7 +9335,7 @@ - + @@ -9020,7 +9353,7 @@ - + @@ -9042,7 +9375,7 @@ - + @@ -9074,7 +9407,7 @@ - + @@ -9096,7 +9429,7 @@ - + @@ -9221,7 +9554,7 @@ - + @@ -9240,7 +9573,7 @@ - + @@ -9249,7 +9582,7 @@ - + @@ -9266,7 +9599,7 @@ - + @@ -9289,7 +9622,7 @@ - + @@ -9324,7 +9657,7 @@ - + @@ -9343,7 +9676,7 @@ - + @@ -9363,7 +9696,7 @@ - + @@ -9383,7 +9716,7 @@ - + @@ -9404,7 +9737,7 @@ - + @@ -9426,7 +9759,7 @@ - + @@ -9521,290 +9854,9 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -9829,7 +9881,7 @@ - + @@ -9838,7 +9890,7 @@ - + @@ -9855,7 +9907,7 @@ - + @@ -9869,7 +9921,7 @@ - + @@ -9909,7 +9961,7 @@ - + @@ -9928,7 +9980,7 @@ - + @@ -9950,7 +10002,7 @@ - + @@ -9972,7 +10024,7 @@ - + @@ -9990,7 +10042,7 @@ - + @@ -10018,7 +10070,7 @@ - + @@ -10044,7 +10096,7 @@ - + @@ -10064,7 +10116,7 @@ - + @@ -10232,11 +10284,11 @@ - + - - + + @@ -10247,16 +10299,16 @@ - - - - - - + + + + + + - - + + @@ -10272,11 +10324,11 @@ - + - - + + @@ -10352,11 +10404,11 @@ - + - - + + @@ -10377,11 +10429,11 @@ - + - - + + @@ -10392,21 +10444,21 @@ - + - - - + + + - - - + + + - - + + @@ -10442,16 +10494,16 @@ - + - - - + + + - - + + @@ -10462,11 +10514,11 @@ - + - - + + @@ -10487,16 +10539,16 @@ - + - - - + + + - - + + @@ -10522,14 +10574,19 @@ - + + + + + + - - + + - + @@ -10545,7 +10602,7 @@ - + @@ -10554,7 +10611,7 @@ - + @@ -10576,7 +10633,7 @@ - + @@ -10598,7 +10655,7 @@ - + @@ -10634,7 +10691,7 @@ - + @@ -10656,7 +10713,7 @@ - + @@ -10665,7 +10722,7 @@ - + @@ -10685,7 +10742,7 @@ - + @@ -10707,7 +10764,7 @@ - + @@ -10743,7 +10800,7 @@ - + @@ -10760,7 +10817,7 @@ - + @@ -10769,7 +10826,7 @@ - + @@ -10792,7 +10849,7 @@ - + @@ -10814,7 +10871,7 @@ - + @@ -10850,7 +10907,7 @@ - + @@ -10865,7 +10922,7 @@ - + @@ -10874,7 +10931,7 @@ - + @@ -10894,7 +10951,7 @@ - + @@ -10915,7 +10972,7 @@ - + @@ -10938,7 +10995,7 @@ - + @@ -10961,7 +11018,7 @@ - + @@ -10983,7 +11040,7 @@ - + @@ -11019,7 +11076,7 @@ - + @@ -11028,7 +11085,7 @@ - + @@ -11037,7 +11094,7 @@ - + @@ -11058,7 +11115,7 @@ - + @@ -11078,7 +11135,7 @@ - + @@ -11097,7 +11154,7 @@ - + @@ -11119,7 +11176,7 @@ - + @@ -11205,7 +11262,7 @@ - + @@ -11220,7 +11277,7 @@ - + @@ -11229,7 +11286,7 @@ - + @@ -11250,7 +11307,7 @@ - + @@ -11270,7 +11327,7 @@ - + @@ -11289,7 +11346,7 @@ - + @@ -11311,7 +11368,7 @@ - + @@ -11392,7 +11449,7 @@ - + @@ -11412,7 +11469,7 @@ - + @@ -11421,7 +11478,7 @@ - + @@ -11435,7 +11492,7 @@ - + @@ -11455,7 +11512,7 @@ - + @@ -11477,7 +11534,7 @@ - + @@ -11596,7 +11653,7 @@ - + @@ -11610,7 +11667,7 @@ - + @@ -11619,7 +11676,7 @@ - + @@ -11633,7 +11690,7 @@ - + @@ -11647,7 +11704,7 @@ - + @@ -11669,7 +11726,7 @@ - + @@ -11691,7 +11748,7 @@ - + @@ -11804,7 +11861,7 @@ - + @@ -11820,7 +11877,7 @@ - + @@ -11829,7 +11886,7 @@ - + @@ -11849,7 +11906,7 @@ - + @@ -11869,7 +11926,7 @@ - + @@ -11888,7 +11945,7 @@ - + @@ -11910,7 +11967,7 @@ - + @@ -11981,7 +12038,7 @@ - + @@ -12002,7 +12059,7 @@ - + @@ -12011,7 +12068,7 @@ - + @@ -12025,7 +12082,7 @@ - + @@ -12046,7 +12103,7 @@ - + @@ -12068,7 +12125,7 @@ - + @@ -12158,7 +12215,7 @@ - + @@ -12178,7 +12235,7 @@ - + @@ -12187,7 +12244,7 @@ - + @@ -12208,7 +12265,7 @@ - + @@ -12222,7 +12279,7 @@ - + @@ -12242,7 +12299,7 @@ - + @@ -12264,7 +12321,7 @@ - + @@ -12286,7 +12343,7 @@ - + @@ -12373,139 +12430,9 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -12524,7 +12451,7 @@ - + @@ -12533,7 +12460,7 @@ - + @@ -12547,7 +12474,7 @@ - + @@ -12571,7 +12498,7 @@ - + @@ -12597,7 +12524,7 @@ - + @@ -12626,7 +12553,7 @@ - + @@ -12647,7 +12574,7 @@ - + @@ -12669,7 +12596,7 @@ - + @@ -12691,7 +12618,7 @@ - + @@ -12783,7 +12710,7 @@ - + @@ -12806,7 +12733,7 @@ - + @@ -12815,7 +12742,7 @@ - + @@ -12838,7 +12765,7 @@ - + @@ -12864,7 +12791,7 @@ - + @@ -12884,7 +12811,7 @@ - + @@ -12906,7 +12833,7 @@ - + @@ -12928,7 +12855,7 @@ - + @@ -12950,7 +12877,7 @@ - + @@ -13051,30 +12978,51 @@ - - - + + + - - - - - - - - + + + + + + + + - - + + - - - - - - + + + + + + - + + + + + + + + + + + + + + + + + + + + + + @@ -13088,7 +13036,7 @@ - + @@ -13122,7 +13070,7 @@ - + @@ -13144,7 +13092,7 @@ - + @@ -13166,7 +13114,7 @@ - + @@ -13188,7 +13136,7 @@ - + @@ -13210,81 +13158,112 @@ - + - - - - - - - + + + + + + + - + - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -13295,7 +13274,7 @@ - + @@ -13304,7 +13283,7 @@ - + @@ -13325,7 +13304,7 @@ - + @@ -13339,7 +13318,7 @@ - + @@ -13359,7 +13338,7 @@ - + @@ -13378,7 +13357,7 @@ - + @@ -13402,7 +13381,7 @@ - + @@ -13419,7 +13398,7 @@ - + @@ -13441,7 +13420,7 @@ - + @@ -13463,7 +13442,7 @@ - + @@ -13546,9 +13525,139 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -13570,7 +13679,7 @@ - + @@ -13579,7 +13688,7 @@ - + @@ -13593,7 +13702,7 @@ - + @@ -13610,7 +13719,7 @@ - + @@ -13627,7 +13736,7 @@ - + @@ -13640,7 +13749,7 @@ - + @@ -13662,7 +13771,7 @@ - + @@ -13801,7 +13910,7 @@ - + @@ -13819,7 +13928,7 @@ - + @@ -13828,7 +13937,7 @@ - + @@ -13842,7 +13951,7 @@ - + @@ -13861,7 +13970,7 @@ - + @@ -13883,7 +13992,7 @@ - + @@ -13905,7 +14014,7 @@ - + @@ -13930,7 +14039,7 @@ - + @@ -14023,7 +14132,7 @@ - + @@ -14045,7 +14154,7 @@ - + @@ -14054,7 +14163,7 @@ - + @@ -14068,7 +14177,7 @@ - + @@ -14085,7 +14194,7 @@ - + @@ -14114,7 +14223,7 @@ - + @@ -14136,7 +14245,7 @@ - + @@ -14197,7 +14306,7 @@ - + @@ -14220,7 +14329,7 @@ - + @@ -14229,7 +14338,7 @@ - + @@ -14243,7 +14352,7 @@ - + @@ -14261,7 +14370,7 @@ - + @@ -14279,7 +14388,7 @@ - + @@ -14301,7 +14410,7 @@ - + @@ -14456,7 +14565,7 @@ - + @@ -14469,7 +14578,7 @@ - + @@ -14478,7 +14587,7 @@ - + @@ -14498,7 +14607,7 @@ - + @@ -14517,7 +14626,7 @@ - + @@ -14534,7 +14643,7 @@ - + @@ -14560,7 +14669,7 @@ - + @@ -14582,7 +14691,7 @@ - + @@ -14604,7 +14713,7 @@ - + @@ -14623,7 +14732,7 @@ - + @@ -14646,7 +14755,7 @@ - + @@ -14700,7 +14809,7 @@ - + @@ -14713,7 +14822,7 @@ - + @@ -14722,7 +14831,7 @@ - + @@ -14739,7 +14848,7 @@ - + @@ -14756,7 +14865,7 @@ - + @@ -14777,7 +14886,7 @@ - + @@ -14797,7 +14906,7 @@ - + @@ -14820,7 +14929,7 @@ - + @@ -14842,7 +14951,7 @@ - + @@ -14871,7 +14980,7 @@ - + @@ -14900,7 +15009,7 @@ - + @@ -14920,7 +15029,7 @@ - + @@ -14940,7 +15049,7 @@ - + @@ -14960,7 +15069,7 @@ - + @@ -14979,7 +15088,7 @@ - + @@ -15001,7 +15110,7 @@ - + @@ -15075,7 +15184,7 @@ - + @@ -15094,7 +15203,7 @@ - + @@ -15103,7 +15212,7 @@ - + @@ -15120,7 +15229,7 @@ - + @@ -15142,7 +15251,7 @@ - + @@ -15164,7 +15273,7 @@ - + @@ -15200,7 +15309,7 @@ - + @@ -15225,7 +15334,7 @@ - + @@ -15234,7 +15343,7 @@ - + @@ -15251,7 +15360,7 @@ - + @@ -15279,7 +15388,7 @@ - + @@ -15301,7 +15410,7 @@ - + @@ -15337,7 +15446,7 @@ - + @@ -15365,7 +15474,7 @@ - + @@ -15374,7 +15483,7 @@ - + @@ -15392,7 +15501,7 @@ - + @@ -15408,7 +15517,7 @@ - + @@ -15430,7 +15539,7 @@ - + @@ -15466,7 +15575,7 @@ - + @@ -15483,7 +15592,7 @@ - + @@ -15492,7 +15601,7 @@ - + @@ -15509,7 +15618,7 @@ - + @@ -15523,7 +15632,7 @@ - + @@ -15545,7 +15654,7 @@ - + @@ -15637,7 +15746,7 @@ - + @@ -15655,7 +15764,7 @@ - + @@ -15664,7 +15773,7 @@ - + @@ -15678,7 +15787,7 @@ - + @@ -15696,7 +15805,7 @@ - + @@ -15718,7 +15827,7 @@ - + @@ -15813,7 +15922,7 @@ - + @@ -15830,7 +15939,7 @@ - + @@ -15839,7 +15948,7 @@ - + @@ -15853,7 +15962,7 @@ - + @@ -15870,7 +15979,7 @@ - + @@ -15892,7 +16001,7 @@ - + @@ -15976,7 +16085,7 @@ - + @@ -15994,7 +16103,7 @@ - + @@ -16003,7 +16112,7 @@ - + @@ -16020,7 +16129,7 @@ - + @@ -16040,7 +16149,7 @@ - + @@ -16062,7 +16171,7 @@ - + @@ -16126,7 +16235,7 @@ - + @@ -16153,7 +16262,7 @@ - + @@ -16162,7 +16271,7 @@ - + @@ -16179,7 +16288,7 @@ - + @@ -16194,7 +16303,7 @@ - + @@ -16219,7 +16328,7 @@ - + @@ -16241,7 +16350,7 @@ - + @@ -16377,7 +16486,7 @@ - + @@ -16395,7 +16504,7 @@ - + @@ -16404,7 +16513,7 @@ - + @@ -16421,7 +16530,7 @@ - + @@ -16440,7 +16549,7 @@ - + @@ -16453,7 +16562,7 @@ - + @@ -16475,7 +16584,7 @@ - + @@ -16565,7 +16674,7 @@ - + @@ -16586,7 +16695,7 @@ - + @@ -16595,7 +16704,7 @@ - + @@ -16612,7 +16721,7 @@ - + @@ -16639,7 +16748,7 @@ - + @@ -16659,7 +16768,7 @@ - + @@ -16678,7 +16787,7 @@ - + @@ -16698,7 +16807,7 @@ - + @@ -16720,7 +16829,7 @@ - + @@ -16807,7 +16916,7 @@ - + @@ -16819,7 +16928,7 @@ - + @@ -16828,7 +16937,7 @@ - + @@ -16845,7 +16954,7 @@ - + @@ -16861,7 +16970,7 @@ - + @@ -16875,7 +16984,7 @@ - + @@ -16894,7 +17003,7 @@ - + @@ -16912,7 +17021,7 @@ - + @@ -16940,7 +17049,7 @@ - + @@ -16970,7 +17079,7 @@ - + @@ -17000,7 +17109,7 @@ - + @@ -17022,7 +17131,7 @@ - + @@ -17163,7 +17272,7 @@ - + @@ -17184,7 +17293,7 @@ - + @@ -17193,7 +17302,7 @@ - + @@ -17210,7 +17319,7 @@ - + @@ -17227,7 +17336,7 @@ - + @@ -17254,7 +17363,7 @@ - + @@ -17274,7 +17383,7 @@ - + @@ -17293,7 +17402,7 @@ - + @@ -17313,7 +17422,7 @@ - + @@ -17335,7 +17444,7 @@ - + @@ -17452,7 +17561,7 @@ - + @@ -17461,7 +17570,7 @@ - + @@ -17470,7 +17579,7 @@ - + @@ -17487,7 +17596,7 @@ - + @@ -17504,7 +17613,7 @@ - + @@ -17520,7 +17629,7 @@ - + @@ -17541,7 +17650,7 @@ - + @@ -17560,7 +17669,7 @@ - + @@ -17583,7 +17692,7 @@ - + @@ -17605,7 +17714,7 @@ - + @@ -17630,7 +17739,7 @@ - + @@ -17656,7 +17765,7 @@ - + @@ -17680,7 +17789,7 @@ - + @@ -17706,7 +17815,7 @@ - + @@ -17719,7 +17828,7 @@ - + @@ -17732,7 +17841,7 @@ - + @@ -17753,7 +17862,7 @@ - + @@ -17775,7 +17884,7 @@ - + @@ -17797,7 +17906,7 @@ - + @@ -17816,7 +17925,7 @@ - + @@ -17958,7 +18067,7 @@ - + @@ -17976,7 +18085,7 @@ - + @@ -17985,7 +18094,7 @@ - + @@ -18002,7 +18111,7 @@ - + @@ -18019,7 +18128,7 @@ - + @@ -18039,7 +18148,7 @@ - + @@ -18062,7 +18171,7 @@ - + @@ -18084,7 +18193,7 @@ - + @@ -18109,7 +18218,7 @@ - + @@ -18122,7 +18231,7 @@ - + @@ -18135,7 +18244,7 @@ - + @@ -18156,7 +18265,7 @@ - + @@ -18172,7 +18281,7 @@ - + @@ -18193,7 +18302,7 @@ - + @@ -18215,7 +18324,7 @@ - + @@ -18367,7 +18476,7 @@ - + @@ -18389,7 +18498,7 @@ - + @@ -18398,7 +18507,7 @@ - + @@ -18412,7 +18521,7 @@ - + @@ -18433,7 +18542,7 @@ - + @@ -18455,7 +18564,7 @@ - + @@ -18550,7 +18659,7 @@ - + @@ -18576,7 +18685,7 @@ - + @@ -18585,7 +18694,7 @@ - + @@ -18604,7 +18713,7 @@ - + @@ -18625,7 +18734,7 @@ - + @@ -18647,7 +18756,7 @@ - + @@ -18749,9 +18858,290 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -18773,7 +19163,7 @@ - + @@ -18782,7 +19172,7 @@ - + @@ -18803,7 +19193,7 @@ - + @@ -18826,7 +19216,7 @@ - + @@ -18858,7 +19248,7 @@ - + @@ -18878,7 +19268,7 @@ - + @@ -18897,7 +19287,7 @@ - + @@ -18920,7 +19310,7 @@ - + @@ -18943,7 +19333,7 @@ - + @@ -18961,7 +19351,7 @@ - + @@ -18979,7 +19369,7 @@ - + @@ -19001,7 +19391,7 @@ - + @@ -19033,7 +19423,7 @@ - + @@ -19055,7 +19445,7 @@ - + @@ -19180,7 +19570,7 @@ - + @@ -19199,7 +19589,7 @@ - + @@ -19208,7 +19598,7 @@ - + @@ -19225,7 +19615,7 @@ - + @@ -19248,7 +19638,7 @@ - + @@ -19283,7 +19673,7 @@ - + @@ -19302,7 +19692,7 @@ - + @@ -19322,7 +19712,7 @@ - + @@ -19342,7 +19732,7 @@ - + @@ -19363,7 +19753,7 @@ - + @@ -19385,7 +19775,7 @@ - + @@ -19480,290 +19870,9 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -19788,7 +19897,7 @@ - + @@ -19797,7 +19906,7 @@ - + @@ -19814,7 +19923,7 @@ - + @@ -19828,7 +19937,7 @@ - + @@ -19868,7 +19977,7 @@ - + @@ -19887,7 +19996,7 @@ - + @@ -19909,7 +20018,7 @@ - + @@ -19931,7 +20040,7 @@ - + @@ -19949,7 +20058,7 @@ - + @@ -19977,7 +20086,7 @@ - + @@ -20003,7 +20112,7 @@ - + @@ -20023,7 +20132,7 @@ - + diff --git a/db/Models/assets/RBAC_model.svg b/db/Models/assets/RBAC_model.svg deleted file mode 100644 index 493f7ba..0000000 --- a/db/Models/assets/RBAC_model.svg +++ /dev/null @@ -1,2752 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/db/Models/eta_rbac.mwb b/db/Models/eta_rbac.mwb index a344180..d8ccb93 100644 Binary files a/db/Models/eta_rbac.mwb and b/db/Models/eta_rbac.mwb differ diff --git a/db/Models/init/rbac_root_init.sql b/db/Models/init/rbac_root_init.sql deleted file mode 100644 index d7f0c06..0000000 --- a/db/Models/init/rbac_root_init.sql +++ /dev/null @@ -1,18 +0,0 @@ --- Creation of root and backoffice -INSERT INTO applications (name, slug, description) VALUES ('root/backoffice','root_backoffice',"This is the application with no restrictions to all resources"); - -INSERT INTO permissions (application_id, name, description) VALUES (1, 'root', "No restrictions"); - -INSERT INTO roles (application_id, name, description) VALUES (1, 'root', "No restrictions"); - -INSERT INTO role_permissions (role_id, permission_id) VALUES (1,1); - -INSERT INTO users (name, last_name) VALUES ('root','root'); - -INSERT INTO auth_identities (user_id, provider, identifier, password_hash, is_primary, is_verified) VALUES (1,'email','root@root.com','invalid_password_hash',1,1); - -INSERT INTO user_roles (user_id, role_id) VALUES (1,1); - -INSERT INTO user_permissions (user_id, permission_id) VALUES (1,1); - -INSERT INTO user_applications (user_id, application_id) VALUES (1,1); diff --git a/db/Models/rbac.mwb b/db/Models/rbac.mwb deleted file mode 100644 index 32e80ee..0000000 Binary files a/db/Models/rbac.mwb and /dev/null differ diff --git a/db/Models/schemas/eta_rbac.sql b/db/Models/schemas/eta_rbac.sql index 71e0b64..448b8cf 100644 --- a/db/Models/schemas/eta_rbac.sql +++ b/db/Models/schemas/eta_rbac.sql @@ -1,5 +1,5 @@ -- MySQL Script generated by MySQL Workbench --- Thu 02 Apr 2026 01:32:42 AM CST +-- Mon 06 Apr 2026 02:56:46 PM CST -- Model: New Model Version: 1.0 -- MySQL Workbench Forward Engineering @@ -193,6 +193,7 @@ ENGINE = InnoDB; -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `u947463964_etaviaporte`.`sessions` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, + `application_id` INT UNSIGNED NOT NULL, `user_id` INT UNSIGNED NOT NULL, `session_token_hash` VARCHAR(255) NOT NULL, `created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, @@ -202,10 +203,16 @@ CREATE TABLE IF NOT EXISTS `u947463964_etaviaporte`.`sessions` ( PRIMARY KEY (`id`), INDEX `fk_sessions_users1_idx` (`user_id` ASC) VISIBLE, UNIQUE INDEX `session_token_hash_UNIQUE` (`session_token_hash` ASC) VISIBLE, + INDEX `fk_sessions_applications1_idx` (`application_id` ASC) VISIBLE, CONSTRAINT `fk_sessions_users1` FOREIGN KEY (`user_id`) REFERENCES `u947463964_etaviaporte`.`users` (`id`) ON DELETE CASCADE + ON UPDATE NO ACTION, + CONSTRAINT `fk_sessions_applications1` + FOREIGN KEY (`application_id`) + REFERENCES `u947463964_etaviaporte`.`applications` (`id`) + ON DELETE CASCADE ON UPDATE NO ACTION) ENGINE = InnoDB; diff --git a/db/Models/schemas/rbac.sql b/db/Models/schemas/rbac.sql deleted file mode 100644 index 8c62e9a..0000000 --- a/db/Models/schemas/rbac.sql +++ /dev/null @@ -1,289 +0,0 @@ --- MySQL Script generated by MySQL Workbench --- Tue 31 Mar 2026 11:55:20 PM CST --- Model: New Model Version: 1.0 --- MySQL Workbench Forward Engineering - -SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; -SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; -SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'; - --- ----------------------------------------------------- --- Schema u947463964_etaviaporte --- ----------------------------------------------------- - --- ----------------------------------------------------- --- Schema u947463964_etaviaporte --- ----------------------------------------------------- -CREATE SCHEMA IF NOT EXISTS `u947463964_etaviaporte` DEFAULT CHARACTER SET utf8 ; -USE `u947463964_etaviaporte` ; - --- ----------------------------------------------------- --- Table `u947463964_etaviaporte`.`users` --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS `u947463964_etaviaporte`.`users` ( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, - `name` VARCHAR(512) NOT NULL, - `last_name` VARCHAR(512) NOT NULL, - `created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - `updated_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - PRIMARY KEY (`id`)) -ENGINE = InnoDB; - - --- ----------------------------------------------------- --- Table `u947463964_etaviaporte`.`auth_identities` --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS `u947463964_etaviaporte`.`auth_identities` ( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, - `user_id` INT UNSIGNED NOT NULL, - `provider` VARCHAR(512) NOT NULL COMMENT 'type of identifier: email, phone, etc', - `identifier` VARCHAR(512) COLLATE 'Default Collation' NOT NULL COMMENT 'email, phone google, facebook, etc.', - `password_hash` VARCHAR(512) COLLATE 'Default Collation' NULL COMMENT 'password for phone or email', - `is_primary` TINYINT NOT NULL DEFAULT 0, - `is_verified` TINYINT NOT NULL DEFAULT 0, - `created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - `updated_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'when phone or email, password goes here.', - PRIMARY KEY (`id`), - INDEX `fk_auth_identities_users_idx` (`user_id` ASC) VISIBLE, - UNIQUE INDEX `provider_UNIQUE` (`provider` ASC, `identifier` ASC) VISIBLE, - CONSTRAINT `fk_auth_identities_users` - FOREIGN KEY (`user_id`) - REFERENCES `u947463964_etaviaporte`.`users` (`id`) - ON DELETE CASCADE - ON UPDATE NO ACTION) -ENGINE = InnoDB; - - --- ----------------------------------------------------- --- Table `u947463964_etaviaporte`.`applications` --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS `u947463964_etaviaporte`.`applications` ( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, - `name` VARCHAR(512) NOT NULL, - `slug` VARCHAR(512) NOT NULL, - `description` TEXT NULL, - `created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - `updated_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - PRIMARY KEY (`id`), - UNIQUE INDEX `slug_UNIQUE` (`slug` ASC) VISIBLE, - UNIQUE INDEX `name_UNIQUE` (`name` ASC) VISIBLE) -ENGINE = InnoDB; - - --- ----------------------------------------------------- --- Table `u947463964_etaviaporte`.`roles` --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS `u947463964_etaviaporte`.`roles` ( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, - `application_id` INT UNSIGNED NOT NULL, - `name` VARCHAR(512) NOT NULL, - `description` TEXT NULL, - `created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - `updated_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - PRIMARY KEY (`id`), - UNIQUE INDEX `name_UNIQUE` (`application_id` ASC, `name` ASC) VISIBLE, - INDEX `fk_roles_applications1_idx` (`application_id` ASC) VISIBLE, - CONSTRAINT `fk_roles_applications1` - FOREIGN KEY (`application_id`) - REFERENCES `u947463964_etaviaporte`.`applications` (`id`) - ON DELETE NO ACTION - ON UPDATE NO ACTION) -ENGINE = InnoDB; - - --- ----------------------------------------------------- --- Table `u947463964_etaviaporte`.`permissions` --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS `u947463964_etaviaporte`.`permissions` ( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, - `application_id` INT UNSIGNED NOT NULL, - `name` VARCHAR(512) NOT NULL, - `description` TEXT NULL, - PRIMARY KEY (`id`), - UNIQUE INDEX `name_UNIQUE` (`application_id` ASC, `name` ASC) VISIBLE, - INDEX `fk_permissions_applications1_idx` (`application_id` ASC) VISIBLE, - CONSTRAINT `fk_permissions_applications1` - FOREIGN KEY (`application_id`) - REFERENCES `u947463964_etaviaporte`.`applications` (`id`) - ON DELETE NO ACTION - ON UPDATE NO ACTION) -ENGINE = InnoDB; - - --- ----------------------------------------------------- --- Table `u947463964_etaviaporte`.`role_permissions` --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS `u947463964_etaviaporte`.`role_permissions` ( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, - `role_id` INT UNSIGNED NOT NULL, - `permission_id` INT UNSIGNED NOT NULL, - PRIMARY KEY (`id`), - INDEX `fk_role_permissions_roles1_idx` (`role_id` ASC) VISIBLE, - INDEX `fk_role_permissions_permissions1_idx` (`permission_id` ASC) VISIBLE, - UNIQUE INDEX `role_id_UNIQUE` (`role_id` ASC, `permission_id` ASC) VISIBLE, - CONSTRAINT `fk_role_permissions_roles1` - FOREIGN KEY (`role_id`) - REFERENCES `u947463964_etaviaporte`.`roles` (`id`) - ON DELETE CASCADE - ON UPDATE NO ACTION, - CONSTRAINT `fk_role_permissions_permissions1` - FOREIGN KEY (`permission_id`) - REFERENCES `u947463964_etaviaporte`.`permissions` (`id`) - ON DELETE CASCADE - ON UPDATE NO ACTION) -ENGINE = InnoDB; - - --- ----------------------------------------------------- --- Table `u947463964_etaviaporte`.`user_roles` --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS `u947463964_etaviaporte`.`user_roles` ( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, - `user_id` INT UNSIGNED NOT NULL, - `role_id` INT UNSIGNED NOT NULL, - `created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - `expires_at` DATETIME NULL, - PRIMARY KEY (`id`), - INDEX `fk_user_roles_users1_idx` (`user_id` ASC) VISIBLE, - INDEX `fk_user_roles_roles1_idx` (`role_id` ASC) VISIBLE, - UNIQUE INDEX `user_id_UNIQUE` (`user_id` ASC, `role_id` ASC) VISIBLE, - CONSTRAINT `fk_user_roles_users1` - FOREIGN KEY (`user_id`) - REFERENCES `u947463964_etaviaporte`.`users` (`id`) - ON DELETE CASCADE - ON UPDATE NO ACTION, - CONSTRAINT `fk_user_roles_roles1` - FOREIGN KEY (`role_id`) - REFERENCES `u947463964_etaviaporte`.`roles` (`id`) - ON DELETE CASCADE - ON UPDATE NO ACTION) -ENGINE = InnoDB; - - --- ----------------------------------------------------- --- Table `u947463964_etaviaporte`.`user_permissions` --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS `u947463964_etaviaporte`.`user_permissions` ( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, - `user_id` INT UNSIGNED NOT NULL, - `permission_id` INT UNSIGNED NOT NULL, - `created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - `expires_at` DATETIME NULL, - PRIMARY KEY (`id`), - INDEX `fk_user_permissions_permissions1_idx` (`permission_id` ASC) VISIBLE, - INDEX `fk_user_permissions_users1_idx` (`user_id` ASC) VISIBLE, - UNIQUE INDEX `user_id_UNIQUE` (`user_id` ASC, `permission_id` ASC) VISIBLE, - CONSTRAINT `fk_user_permissions_permissions1` - FOREIGN KEY (`permission_id`) - REFERENCES `u947463964_etaviaporte`.`permissions` (`id`) - ON DELETE CASCADE - ON UPDATE NO ACTION, - CONSTRAINT `fk_user_permissions_users1` - FOREIGN KEY (`user_id`) - REFERENCES `u947463964_etaviaporte`.`users` (`id`) - ON DELETE CASCADE - ON UPDATE NO ACTION) -ENGINE = InnoDB; - - --- ----------------------------------------------------- --- Table `u947463964_etaviaporte`.`verification_tokens` --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS `u947463964_etaviaporte`.`verification_tokens` ( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, - `auth_identity_id` INT UNSIGNED NOT NULL, - `token_hash` VARCHAR(255) NOT NULL COMMENT 'Verification token for email/phone/notification mechanisms to either validate or reset passwords', - `purpose` ENUM('email_verification', 'phone_verification', 'password_reset') NOT NULL, - `created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - `expires_at` DATETIME NOT NULL, - `used_at` DATETIME NULL, - PRIMARY KEY (`id`), - INDEX `fk_verification_tokens_auth_identities1_idx` (`auth_identity_id` ASC) VISIBLE, - UNIQUE INDEX `token_hash_UNIQUE` (`token_hash` ASC) VISIBLE, - CONSTRAINT `fk_verification_tokens_auth_identities1` - FOREIGN KEY (`auth_identity_id`) - REFERENCES `u947463964_etaviaporte`.`auth_identities` (`id`) - ON DELETE CASCADE - ON UPDATE NO ACTION) -ENGINE = InnoDB; - - --- ----------------------------------------------------- --- Table `u947463964_etaviaporte`.`sessions` --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS `u947463964_etaviaporte`.`sessions` ( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, - `user_id` INT UNSIGNED NOT NULL, - `application_id` INT UNSIGNED NOT NULL, - `session_token_hash` VARCHAR(255) NOT NULL, - `created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - `updated_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `expires_at` DATETIME NOT NULL, - `revoked_at` DATETIME NULL, - PRIMARY KEY (`id`), - INDEX `fk_sessions_users1_idx` (`user_id` ASC) VISIBLE, - UNIQUE INDEX `session_token_hash_UNIQUE` (`application_id` ASC, `session_token_hash` ASC) VISIBLE, - INDEX `fk_sessions_applications1_idx` (`application_id` ASC) VISIBLE, - CONSTRAINT `fk_sessions_users1` - FOREIGN KEY (`user_id`) - REFERENCES `u947463964_etaviaporte`.`users` (`id`) - ON DELETE CASCADE - ON UPDATE NO ACTION, - CONSTRAINT `fk_sessions_applications1` - FOREIGN KEY (`application_id`) - REFERENCES `u947463964_etaviaporte`.`applications` (`id`) - ON DELETE NO ACTION - ON UPDATE NO ACTION) -ENGINE = InnoDB; - - --- ----------------------------------------------------- --- Table `u947463964_etaviaporte`.`user_applications` --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS `u947463964_etaviaporte`.`user_applications` ( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, - `user_id` INT UNSIGNED NOT NULL, - `application_id` INT UNSIGNED NOT NULL, - `created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (`id`), - INDEX `fk_user_application_users1_idx` (`user_id` ASC) VISIBLE, - INDEX `fk_user_application_applications1_idx` (`application_id` ASC) VISIBLE, - UNIQUE INDEX `user_id_UNIQUE` (`user_id` ASC, `application_id` ASC) VISIBLE, - CONSTRAINT `fk_user_application_users1` - FOREIGN KEY (`user_id`) - REFERENCES `u947463964_etaviaporte`.`users` (`id`) - ON DELETE CASCADE - ON UPDATE NO ACTION, - CONSTRAINT `fk_user_application_applications1` - FOREIGN KEY (`application_id`) - REFERENCES `u947463964_etaviaporte`.`applications` (`id`) - ON DELETE CASCADE - ON UPDATE NO ACTION) -ENGINE = InnoDB; - - --- ----------------------------------------------------- --- Table `u947463964_etaviaporte`.`api_keys` --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS `u947463964_etaviaporte`.`api_keys` ( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, - `application_id` INT UNSIGNED NOT NULL, - `name` VARCHAR(512) NOT NULL, - `description` TEXT NULL, - `key_hash` VARCHAR(255) NOT NULL, - `created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - `expires_at` DATETIME NULL, - PRIMARY KEY (`id`), - UNIQUE INDEX `key_hash_UNIQUE` (`key_hash` ASC) VISIBLE, - INDEX `fk_api_keys_applications1_idx` (`application_id` ASC) VISIBLE, - CONSTRAINT `fk_api_keys_applications1` - FOREIGN KEY (`application_id`) - REFERENCES `u947463964_etaviaporte`.`applications` (`id`) - ON DELETE CASCADE - ON UPDATE NO ACTION) -ENGINE = InnoDB; - - -SET SQL_MODE=@OLD_SQL_MODE; -SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; -SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS; diff --git a/db/service/initdb/00-schema.sql b/db/service/initdb/00-schema.sql index 71e0b64..448b8cf 100644 --- a/db/service/initdb/00-schema.sql +++ b/db/service/initdb/00-schema.sql @@ -1,5 +1,5 @@ -- MySQL Script generated by MySQL Workbench --- Thu 02 Apr 2026 01:32:42 AM CST +-- Mon 06 Apr 2026 02:56:46 PM CST -- Model: New Model Version: 1.0 -- MySQL Workbench Forward Engineering @@ -193,6 +193,7 @@ ENGINE = InnoDB; -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `u947463964_etaviaporte`.`sessions` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, + `application_id` INT UNSIGNED NOT NULL, `user_id` INT UNSIGNED NOT NULL, `session_token_hash` VARCHAR(255) NOT NULL, `created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, @@ -202,10 +203,16 @@ CREATE TABLE IF NOT EXISTS `u947463964_etaviaporte`.`sessions` ( PRIMARY KEY (`id`), INDEX `fk_sessions_users1_idx` (`user_id` ASC) VISIBLE, UNIQUE INDEX `session_token_hash_UNIQUE` (`session_token_hash` ASC) VISIBLE, + INDEX `fk_sessions_applications1_idx` (`application_id` ASC) VISIBLE, CONSTRAINT `fk_sessions_users1` FOREIGN KEY (`user_id`) REFERENCES `u947463964_etaviaporte`.`users` (`id`) ON DELETE CASCADE + ON UPDATE NO ACTION, + CONSTRAINT `fk_sessions_applications1` + FOREIGN KEY (`application_id`) + REFERENCES `u947463964_etaviaporte`.`applications` (`id`) + ON DELETE CASCADE ON UPDATE NO ACTION) ENGINE = InnoDB; diff --git a/docs/software_requirements_specification.md b/docs/software_requirements_specification.md new file mode 100644 index 0000000..b357453 --- /dev/null +++ b/docs/software_requirements_specification.md @@ -0,0 +1,117 @@ +# ETA's Core API + +Draft of software requirements specification (SRS) to model API endpoints and its responsabilities. + +- **/meta/applications**: + - **Operations**: + - Create application. (idempotency through client UUID) + - Read applications + - Update applications + - Delete applications + +- **/apps/{app_id}/roles**: + - **Operations**: + - Create application roles. (idempotency through client UUID) + - Read application roles + - Update application roles + - Delete application roles + +- **/apps/{app_id}/permissions**: + - **Operations**: + - Create application permissions. (idempotency through client UUID) + - Read application permissions + - Update application permissions + - Delete application permissions + +- **/apps/{app_id}/users/{user_id}/roles**: + - **Operations**: + - Assign roles to user + - Delete roles from user + - Read roles from user + +- **/apps/{app_id}/users/{user_id}/permissions**: + - **Operations**: + - Assign permission to user + - Delete permission to user + - Read permissions assigned to user + +- **/apps/{app_id}/users/{user_id}/apikeys**: + - **Operations**: + - Create apikeys. (idempotency through client UUID) + - Read apikeys + - Delete apikeys + +- **/apps/{app_id}/auth**: + - **Operations**: + - Manage authentication of user: + - **/app/{app_id}/auth/identity/[phone,email]**: + - Identify user and return JWT. + - Create user and assign to application. (idempotency through client UUID) + - **/app/{app_id}/auth/identity/[phone,email]/verify**: + - Verify identity and assign to application. (idempotency through client UUID) + - **/app/{app_id}/auth/logout**: + - **/app/{app_id}/auth/refresh**: + - **/app/{app_id}/auth/me**: + +# Admin Authorization Strategy: + +The system shall have a predefined system application to control all resources. + +The system application can't be removed. + +The system application shall have predefined permissions and roles to control the access to all resources at different granularity levels: + - CRUD of applications. + - CRUD of applications' roles. + - CRUD of applications' permissions. + - CRUD of applications' users. + - CRUD of applications' apikeys. + - etc. + +The system application shall have an admin user with only apikeys and no identities. + +The system application's admin user shall have permissions assigned to manage applications. + +The system application's admin user shall have permissions assigned to manage users. + +The system application's admin user shall have permissions assigned to manage roles and permissions within applications. + +The system application's admin user shall have permissions assigned to manage apikeys within applications. + +The system application's admin user shall not have full control over the system resources.* (No other resource than users, roles, permissions) + +Every application shall have an admin user with only apikeys and no identities. + +Every application shall have an admin user to manage application resources. + +Every application shall have an admin user to manage users within applications: + + - Shall allow assigning or removing existing users to/from applications. + - Shall allow create and assign users to applications. + +The application's admin user shall not have full control over the application resources.* (No other resource than users, roles, permissions) + +Every application shall have it's own API that serves as an API wrapper to consume system resources. + +Every application shall have it's own API that serves as an API wrapper to consume application resources. + +Every application specific API shall use the user's authorization token or apikey to consume application's resources. + +(Admin Portal shall have it's own API that communicates with the core API to manage system resources associated to the system and the application components). + +(Admin Portal shall have it's own API key to only create users and assign roles to it). + +(Admin Portal shall modify system resources by the usage of a JWT of an identified user to enable audit logs of resources manipulation). + +# Idempotency Strategy: + +When a resource requires "idempotency", the HTTP header `X-Idempotency-Key` must be provided with an UUID generated from the client. + +# Authorization Tokens (Core API): + +When API Key is used, the HTTP header `x-api-key: ` shall be used.* + +When JWT is used, the HTTP header `Authorization: Bearer ` shall be used. + +When JWT refresh is used, the HTTP header `x-refresh-token: ` shall be used. + +Every application's specific API (also known as API wrapper) shall use it's own authorization mechanisms.