mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 08:24:04 +00:00
Add more tenant key generators (#36)
* Add RandomHexGenerator, create new namespace * phpstan ignore * add base64 generator * add note about base64 being case sensitive * docblock updates * replace old UUIDGenerator with a class that throws an exception * replace base64 generator with a random string generator * Fix namespace * Fix code style (php-cs-fixer) * add test for the deprecated uuid generator * update comments --------- Co-authored-by: PHP CS Fixer <phpcsfixer@example.com>
This commit is contained in:
parent
bf1ba69fe3
commit
dc430666ba
7 changed files with 126 additions and 9 deletions
|
|
@ -5,6 +5,7 @@ declare(strict_types=1);
|
|||
use Stancl\Tenancy\Middleware;
|
||||
use Stancl\Tenancy\Resolvers;
|
||||
use Stancl\Tenancy\Enums\RouteMode;
|
||||
use Stancl\Tenancy\UniqueIdentifierGenerators;
|
||||
|
||||
return [
|
||||
/**
|
||||
|
|
@ -24,11 +25,16 @@ return [
|
|||
/**
|
||||
* Used for generating tenant IDs.
|
||||
*
|
||||
* - Feel free to override this with a custom class that implements the UniqueIdentifierGenerator interface.
|
||||
* - To use autoincrement IDs, set this to null and update the `tenants` table migration to use an autoincrement column.
|
||||
* SECURITY NOTE: Keep in mind that autoincrement IDs come with *potential* enumeration issues (such as tenant storage URLs).
|
||||
* - Feel free to override this with a custom class that implements the UniqueIdentifierGenerator interface.
|
||||
* - To use autoincrement IDs, set this to null and update the `tenants` table migration to use an autoincrement column.
|
||||
*
|
||||
* SECURITY NOTE: Keep in mind that autoincrement IDs come with potential enumeration issues (such as tenant storage URLs).
|
||||
*
|
||||
* @see \Stancl\Tenancy\UniqueIdentifierGenerators\UUIDGenerator
|
||||
* @see \Stancl\Tenancy\UniqueIdentifierGenerators\RandomHexGenerator
|
||||
* @see \Stancl\Tenancy\UniqueIdentifierGenerators\RandomStringGenerator
|
||||
*/
|
||||
'id_generator' => Stancl\Tenancy\UUIDGenerator::class,
|
||||
'id_generator' => UniqueIdentifierGenerators\UUIDGenerator::class,
|
||||
],
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue