1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 09:54:05 +00:00
Commit graph

1347 commits

Author SHA1 Message Date
lukinovec
fb382a10d1 Improve comments and method name 2025-06-12 09:19:34 +02:00
lukinovec
fbbe697500 Correct terminology in table manager test file 2025-06-10 09:46:04 +02:00
lukinovec
9b34a8cdf3 Correct terminology and comments in TableRLSManager 2025-06-10 09:42:51 +02:00
github-actions[bot]
8d37415fc8 Fix code style (php-cs-fixer) 2025-06-09 14:23:44 +00:00
lukinovec
608e11a4f0 Add a "single source of truth" for path array format, make lower-level code more concise, improve comments 2025-06-09 16:23:24 +02:00
github-actions[bot]
4f909b09d9 Fix code style (php-cs-fixer) 2025-06-09 13:38:36 +00:00
lukinovec
e7d406b3df Improve comments, delete excessive methods, make methods more concise, position helper methods more appropriately 2025-06-09 15:38:10 +02:00
lukinovec
a8941c3373 Make higher-level code clearer, improve comments 2025-06-09 14:37:32 +02:00
lukinovec
f68ead8e38 Use tenant id instead of getTenantKey() 2025-06-09 14:04:15 +02:00
lukinovec
df0d96f9bf Test data separation with comment constraints 2025-06-09 14:03:46 +02:00
lukinovec
1d87e4b00f Delete excessive test 2025-06-09 13:51:41 +02:00
lukinovec
0dce61bd34 Clarify and simplify tests, add comments 2025-06-09 12:59:52 +02:00
lukinovec
cac2649568 Simplify and clarify core shortest path generation test 2025-06-09 12:38:27 +02:00
8c773245f7 Merge branch 'may25' into rls-fake-constrained-foreign-keys 2025-06-05 05:08:14 +02:00
lukinovec
2057e1e5ae
[4.x] Make forcing RLS configurable (#1293)
* Add `$forceRls` static property to tenants:rls

* Set `$forceRls` in tests where scoping is tested, add non-superuser, non-bypassrls table owner test

* Move DROP TABLE statement

* Remove try/catch

* Put DROP OWNED BY into try/catch

* Static property cleanup in afterEach

* Make with() matrix syntax more clear by using with() multiple times

* Fix typo, improve comment

* Move and update force RLS comment

* Add test for `$forceRls = false`, refactor BYPASSRLS test

* Update link in test comment

* Add a dataset for `$forceRls` in the table owner test, fix BYPASSRLS test

* Correct PR link comment

* minor fixes

* Add test that makes the bypassrls/forceRls behavior clear

* Delete redundant test

* cleanup

* Update tests/RLS/TableManagerTest.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Samuel Štancl <samuel@archte.ch>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-06-05 05:06:05 +02:00
e74e1f92e1
Make RouteMode enum backed (#1362) 2025-06-02 20:34:49 +02:00
lukinovec
f771aa8645
[4.x] Test that route model binding works correctly with path identification (#1360)
* Test that route model binding works with path identification (closure-based routes)

* Correct test name

* Update tests/PathIdentificationTest.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* make assertions more clear

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Samuel Štancl <samuel@archte.ch>
2025-06-02 19:05:17 +02:00
5f7fd38e5a
[4.x] URL generation, request data identification improvements (#1357)
* UrlGenerator: set defaults based on config; request data: move config to config file+resolver

* Claude code adjustments

* improve request data tests, simplify complex test in UrlGeneratorBootstrapperTest

* url generator test: test changing tenant parameter name

* request data identification: add tenant_model_column configuration

* defaultParameterNames -> passQueryParameter

* move comment

* minor refactor in PathIdentificationTest, expand CLAUDE.md to include early identification section

* Fix COLOR_FLAG

* improve test name

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* TenancyUrlGenerator: add a check for queryParameterName being null

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fix code style (php-cs-fixer)

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-06-02 03:43:47 +02:00
f4cc99b317 fix phpstan 2025-05-29 18:39:05 +02:00
37f6260812 Add CLAUDE.md 2025-05-29 18:36:09 +02:00
lukinovec
c89c2938fe Improve method name 2025-05-29 13:28:56 +02:00
lukinovec
bfe62611e0 Improve comment 2025-05-29 13:15:35 +02:00
lukinovec
a1e8324fb5 Use consistent shortest path terminology 2025-05-29 13:13:41 +02:00
lukinovec
c867ecec44 Update the tree terminology 2025-05-29 13:06:54 +02:00
github-actions[bot]
82f9138666 Fix code style (php-cs-fixer) 2025-05-29 10:52:24 +00:00
lukinovec
233dbd0184 Improve readability 2025-05-29 12:51:37 +02:00
lukinovec
973f7994c3 Improve code for determining the shortest path 2025-05-29 12:51:37 +02:00
lukinovec
1bfac014ab Test uncovered edge cases 2025-05-29 12:51:36 +02:00
lukinovec
3e8cb02981 Improve TableRLSManager comments 2025-05-29 12:51:36 +02:00
github-actions[bot]
759931394c Fix code style (php-cs-fixer) 2025-05-28 13:56:50 +00:00
lukinovec
a3b925b362 Refactor TableRLSManagerr (dynamic programming, deal with recursive relationships, determine shortest paths while generating the paths) 2025-05-28 15:56:25 +02:00
lukinovec
37edba8dbc Improve comments 2025-05-21 14:10:46 +02:00
github-actions[bot]
3d6be96f7d Fix code style (php-cs-fixer) 2025-05-21 12:05:11 +00:00
lukinovec
640ba9e7f1 Correct terminology, add test for throwing exceptions 2025-05-21 14:03:51 +02:00
lukinovec
adfddab951 Make path skipping logic more explicit 2025-05-21 14:03:51 +02:00
lukinovec
349ac6e9fc Simplify and clarify comment-related TableRLSManager code 2025-05-21 14:03:51 +02:00
lukinovec
f65c64c9c7 Correct comment functionality, add comment constraint exception 2025-05-21 14:03:51 +02:00
github-actions[bot]
a52745704e Fix code style (php-cs-fixer) 2025-05-20 11:59:09 +00:00
lukinovec
c80b28cf00 Add option to provide constraint information in column comment 2025-05-20 13:58:33 +02:00
lukinovec
588d1fcc0d
[4.x] Make TableRLSManager skip foreign keys with 'no-rls' comment right away (#1352)
* When a foreign key has no-rls comment (or no comment when scopeByDefault is false), skip path generation earlier

* Fix column definitions
2025-05-15 14:54:04 +02:00
27685ffe5a improve sample RootUrlBootstrapper config 2025-05-09 15:15:22 +02:00
lukinovec
dc90e60a2f
[4.x] Make ScopeSessions usable on universal routes (#1342)
* Skip ScopeSessions MW if the current context is central and the route is universal

* Add regressiont test

* Simplify code

---------

Co-authored-by: Samuel Štancl <samuel@archte.ch>
2025-04-04 03:15:37 +02:00
lukinovec
8cd15db1fc
[4.x] Make RemoveStorageSymlinksAction able to delete broken symlinks (#1323)
* Add regression test for removing invalid symlinks

* Move commented RemoveStorageSymlinks job to the DeletingTenant pipeline (better default - the symlinks will be removed *before* deleting tenant storage)

* Remove symlink validity check from symlinkExists() (only check for the symlink's existence)

* Delete complete todo0

* Make the symlink assertions more explicit

* update test name

---------

Co-authored-by: Samuel Štancl <samuel@archte.ch>
2025-03-18 21:27:27 +01:00
Alexandru Bucur
8d87ee9dfc
[4.x] Add ULIDGenerator (#1332)
* feat: introduce a simple ULID generator

* add test

---------

Co-authored-by: Samuel Štancl <samuel@archte.ch>
2025-03-18 19:00:35 +01:00
Sergio Peris
84a2863d2d
[4.x] Fix fully qualified name at TenancyServiceProvider.stub.php (#1334) 2025-03-18 18:56:29 +01:00
95dd906de2
[4.x] Make the ImpersonationToken model configurable (#1335)
* Make the ImpersonationToken model configurable, resolve #1315

* Add type definition

* Make phpstan happy
2025-03-18 18:42:08 +01:00
37a0f1a713
[4.x] Invalidate resolver cache on delete (#1329)
* Invalidate resolver cache on delete

* Fix code style (php-cs-fixer)

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-03-13 17:03:49 +01:00
8960a83047
[4.x] Laravel 12 support (#1321)
* Add Laravel 12 support, drop Laravel 11 support

* Fix RLS tree generation (specify schema name in generateTrees())

* ci fixes, use stable virtualcolumn version

---------

Co-authored-by: lukinovec <lukinovec@gmail.com>
2025-02-25 16:26:18 +01:00
657e165cc8
[4.x] Cleanup (#1317)
* cleanup, resolve todos, add immediate todos

* Improve path_identification_middleware docblock

* rename leave() method in tests

* wip fix hardcoded values making assumptions about the parameters used in routing

* defaultParameterNames

* fix CreatesDatabaseUsers return values

* $tenant -> tenant()

* resolve more todos

* make comment block a complete block

* Correct useTenantRoutesInFortify(), delete unused import

* test fixes

* remove todos

* remove JobPipeline todo

* simplify comment example

* remove todo

* fix VERSION_PREFIX in queue.yml

---------

Co-authored-by: lukinovec <lukinovec@gmail.com>
2025-02-20 20:49:09 +01:00
eac88dcc2a contributing note about mssql on Apple Silicon 2025-02-19 12:38:35 +01:00