tenancy | Automatic multi-tenancy for Laravel No code changes needed | Authorization library

 by   archtechx PHP Version: v3.7.0 License: MIT

kandi X-RAY | tenancy Summary

kandi X-RAY | tenancy Summary

tenancy is a PHP library typically used in Security, Authorization applications. tenancy has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

You won't have to change a thing in your application's code. Documentation can be found here: The repository with the documentation source code can be found here: stancl/tenancy-docs.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              tenancy has a medium active ecosystem.
              It has 2975 star(s) with 358 fork(s). There are 70 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 7 open issues and 649 have been closed. On average issues are closed in 39 days. There are 8 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of tenancy is v3.7.0

            kandi-Quality Quality

              tenancy has no bugs reported.

            kandi-Security Security

              tenancy has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              tenancy is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              tenancy releases are available to install and integrate.

            Top functions reviewed by kandi - BETA

            kandi has reviewed tenancy and discovered the below as its top functions. This is intended to give you an instant insight into tenancy implemented functionality, and help decide if they suit your requirements.
            • Register the tenant services .
            • Update the resource in the central database .
            • Run for multiple tenants .
            • Creates a new tenant database user .
            • Handles tenant migrations .
            • Get the tenant configuration .
            • Resolve tenant .
            • Set the original configuration .
            • Revert the application .
            • Set up the listener for the job .
            Get all kandi verified functions for this library.

            tenancy Key Features

            No Key Features are available at this moment for tenancy.

            tenancy Examples and Code Snippets

            No Code Snippets are available at this moment for tenancy.

            Community Discussions

            QUESTION

            stancl/tenancy: How to fetch data from tenant db globally?
            Asked 2021-Jun-09 at 11:41

            I used to fetch data from db and make available in all View through ServiceProvider, But now, I am using stancl/tenancy for multi-tenant system. And I need to pass some global data to all view files, writing the fetch data in ServiceProvider returns data from central database only. So, how can I fetch data from tenant DB to all view files globally before requesting any other requests?

            ...

            ANSWER

            Answered 2021-Jun-09 at 11:41

            Service Providers run before the tenant is identified and can therefore not be used to make configurations like sharing data to all views.

            Instead, you can make a custom tenancy bootstrapper by creating a class that implements the Stancl\Tenancy\Contracts\TenancyBootstrapper interface.

            Source https://stackoverflow.com/questions/67902063

            QUESTION

            Oracle NoSQL Cloud Service - Is it possible to do a connection using instance-principal instead of creating config files?
            Asked 2021-Jun-03 at 12:36

            I am using Oracle NoSQL Cloud Service on OCI and I want to write a program using the Oracle NoSQL Database Python SDK.

            I did a test using the OCI SDK, I am using instance-principal IAM vs creating config files with tenancy/user ocid and API private keys on the nodes which invoke the noSQL api calls

            Is it possible to do a connection using instance-principal instead of creating config files with tenancy/user ocid and API private keys with the Oracle NoSQL Database Python SDK.

            I read the examples provided in the documentation https://github.com/oracle/nosql-python-sdk but I cannot find information about instance-principal support

            ...

            ANSWER

            Answered 2021-Jun-03 at 12:36

            The Oracle NoSQL Database Python SDK works with instance-principals and resource principals. See the documentation https://nosql-python-sdk.readthedocs.io/en/stable/api/borneo.iam.SignatureProvider.html

            Here an example using resource principals and Oracle functions

            Source https://stackoverflow.com/questions/67820099

            QUESTION

            Azure Bot App Registration requiring multi-tenancy when single-tenant is prefered
            Asked 2021-Jun-03 at 01:26

            I have an application I need to deploy that is requiring the App Registration to be "Accounts in any organizational directory (Any Azure AD directory - Multitenant)". What would the implication of setting this be? The application does not work if I set it to just "Accounts in this organizational directory only ( only - Single tenant)". The application using this App Registration is a Bot Framework application.

            Where in the Bot framework code would there be some dependency on multi-tenancy? I would prefer to keep it as single tenant.

            Thanks in advance, Jake.

            ...

            ANSWER

            Answered 2021-Jun-03 at 01:26

            The multi-tenant organization is what enables the Azure Bot Service servers (in the botframework.com tenant) to authenticate requests coming from the bot (registered in the customer's tenant) through our servers. It's part of our service to service authentication protocol. it is not used for other purposes, and not to have any claims added to it for other access.

            So don't worry about that your tenant's data will be leaked to other tenants.

            See a similar post here.

            Source https://stackoverflow.com/questions/67811870

            QUESTION

            Why is Google Firebase not recommended by Google - in their own documentation - for multi-tenant applications?
            Asked 2021-Jun-02 at 06:00

            There is a warning on the Firebase best practices documentation against using Firebase with multi-tenant applications: https://firebase.google.com/docs/projects/learn-more#multi-tenancy

            This is what I am most concerned about: "Multi-tenancy can lead to serious configuration and data privacy concerns problems, including unintended issues with analytics aggregation, shared authentication, overly-complex database structures, and difficulties with security rules."

            There is also plenty of official Google documentation supporting the use of Firebase for multi-tenancy, for instance: https://cloud.google.com/identity-platform/docs/multi-tenancy-authentication .

            Do you know why they would have these conflicting recommendations and examples? Does use of Google Identity Platform fix the core security deficits mentioned in the warning?

            I am re-posting this question, with additional clarification in the title, and a few edits/removals from the body, to specify that I am only looking for why this widely used product has this particular warning in its official documentation. I have removed most subjective content. I have no opinion on this that is relevant to the question - I am only looking to understand the warning. It seemed there was one good answer before the previous question was closed, so I will link that here for reference: Why is Google Firebase not recommended by Google in their own documentation for multi-tenant applications?

            ...

            ANSWER

            Answered 2021-Jun-02 at 06:00

            That does make sense if you manage 2 separate applications which have no relation with each other. Let's say you have an app that manages a school's information and other one is a restaurant management app. Now in this case I don't see any event that the school app might need access to restaurant data.

            If you use the same project, then all the firebase services (auth, database, analytics, etc) will be shared among them. It'll be hard for you to separate analytics for each of the app. As the database is shared, you'll have to explicitly separate data of both apps by separating the path in db. (/apps/school for school, /apps/restaurant for restaurant).

            That being said, any user registered on the school app can login on restaurant app without creating a new account there as you are sharing the same project among them.

            Now if your client pays you a the Firebase costs every month, you cannot distinguish between how much should the school client pay. Now even if both the apps are your, the complexity will increase significantly if you go on using it.

            https://firebase.google.com/docs/projects/learn-more#multi-tenancy <-- this explains how "Firebase Projects" works and https://cloud.google.com/identity-platform/docs/multi-tenancy-authentication explains about "Google Identity Kit" multi-tenant auth. So that's not a Firebase-only thing.

            Source https://stackoverflow.com/questions/67798744

            QUESTION

            Why is Google Firebase not recommended by Google in their own documentation for multi-tenant applications?
            Asked 2021-Jun-01 at 20:34

            There is a warning on the Firebase best practices documentation against using Firebase with multi-tenant applications: https://firebase.google.com/docs/projects/learn-more#multi-tenancy

            This is what I am most concerned about: "Multi-tenancy can lead to serious configuration and data privacy concerns problems, including unintended issues with analytics aggregation, shared authentication, overly-complex database structures, and difficulties with security rules." Identity Platform looks like it should cover everything except analytics aggregation and database structures, but I can control analytics logging and my database structure is simple enough, being divided cleanly by tenant. My application is one common application, but has tenanted client data and users (managed via Google Identity Platform).

            There is also plenty of official Google documentation supporting the use of Firebase for multi-tenancy: https://cloud.google.com/identity-platform/docs/multi-tenancy-authentication . There are also dozens of examples out there for how to set up multi-tenancy with Firebase and Google Identity Provider.

            Do you know why they would have these conflicting recommendations and examples? Does use of Google Identity Platform fix the core security deficits mentioned in the warning? It has me strongly considering abandoning Firebase, which would be a shame given the features it gives me.

            ...

            ANSWER

            Answered 2021-May-28 at 07:44

            The recommendation is not bind to Firebase, or GCP, or Google. It's generic. If you put all your data in the same bag, with only a logical isolation, it's only logical, not strong as different projects.

            Thus, it's easy to make a mistake and to use, delete, update, make the mess, in all the tenant data. In case of attacks, leak, major bug, you can reduce the blast radius by having several small tenant.

            It's a tradeoff between more management to perform (because you have a lot of tenant) and a higher risk (multi-tenant project, the crash is dramatic). It also depends on your application type and context. It's a recommendation, not an obligation!

            Source https://stackoverflow.com/questions/67727539

            QUESTION

            Azure Powershell - AzureAdUser V AzAdUser
            Asked 2021-May-25 at 00:58

            I have the free developer E5 subscription and have setup a tenancy, created users etc. I have tried creating a second directory that I am planning to use to test the Azure AD Connect tool on a local server. I can switch between the tenants on the Azure Portal with the "Switch tenant" button however can't seem to figure it out with the Powershell cmdlets.

            Connect-AzureAD

            Set-AzContext -TenantId "My new tenant/directory"

            Following these two commands is where the confusion starts. The first commands lists the users from the first directory and the second command shows the users from the directory I have switched too.

            Get-AzureAdUser (Shows the first directory, not the one switched too)

            Get-AzAdUser (Shows the users of the directory switched too)

            Not sure if there is something I am missing here?

            ...

            ANSWER

            Answered 2021-May-25 at 00:58

            Thats because those are commands from 2 different modules:

            First one are from AzureAD which is a module designed for tasks within AzureAD

            Ths second one are from Az With is designed to handle most, if not all of Azure's resources. The AD functionality is mostly for the module to handle lookups of azure ad objects when checking rbac and assigning access, and not really created to manage AzureAD in any meaningful way (even tho you can do some tasks).

            For your task you can use the az module easliy if you just want to look up the users, but if you need to actually administer azure ad i suggest you go for azuread. To connect to a specified tenant with azuread use connect-azuread -tenantId 'tenant id'. I also think it support that you use domain name aswell

            Source https://stackoverflow.com/questions/67673373

            QUESTION

            AttributeError: 'NoneType' object has no attribute 'attname'
            Asked 2021-May-20 at 23:13

            I am using this django_multitenant library to implement multi tenancy. I tried creating an object in python manage.py shell using the below code

            ...

            ANSWER

            Answered 2021-May-20 at 22:07

            I suspect the problem is due to the tenant_id model field you declared in your ApplicationSetting model. Internally, the package you are using appears to use tenant_id as a reference to the field name of the tenant-related foreign key.

            Since you declared tenant_id as a nullable field, the original tenant_id='organization_id' no longer exists. When you initialize your ApplicationSetting, the TenantManager looks for a field named None and tries to find it's related name (via the attname property), hence the error.

            To fix this, remove the tenant_id field.

            After, you will probably get different exception, because your ApplicationSetting model doesn't contain a field named organization. To fix this, you will need to rename your org field:

            Source https://stackoverflow.com/questions/67628299

            QUESTION

            Ecto Referencing Another Schema During Migration for Foreign-Key Relationship
            Asked 2021-May-16 at 17:21

            We are working with a schema-based multi-tenancy database. We are on an Elixir stack, using Postgres, Ecto, and Triplex within a Phoenix Framework project.

            We are using the default schema public to store common data, such as users and organisations. In particular, we have within the Organisations table a tenant_prefix column which we use to map a user to their tenancy.

            Within a tenancy, we tenant-specific tables. As an example, we have a Products table. When a new organisation is created, we use Triplex to create the schema and run tenant migrations, which create the tenant-specific tables such as Products.

            As a visual, the database looks like this:

            ...

            ANSWER

            Answered 2021-May-16 at 17:21

            I am not sure if it helps but I think that you should be using prefix option with your references. You can checkout the docs for further references.

            https://hexdocs.pm/ecto_sql/Ecto.Migration.html#references/2

            As of my understanding line 8 should be something like this

            Source https://stackoverflow.com/questions/67476330

            QUESTION

            How to add additional tag for EBS volume base on variable?
            Asked 2021-May-16 at 17:03

            I'm using this EC2 module with lite alteration to create EC2 instances and EBS volumes, Code is working without an issue, But I have requirement to add mount point as a tag in EBS, So I can use data filter to get that value and mount it using Ansible. Im trying to add tag value to "dynamic "ebs_block_device" through depoy-ec2.tf configuration file. As per the Terraform documentation tags is an optional value. Anyway, when I executing this it provided Unsupported argument error for tags value. Appreciate your support to understand issue here.

            My Code as below.

            Module main.tf

            ...

            ANSWER

            Answered 2021-May-16 at 17:03

            The issue with AWS provider, which didn't have much options, So I have upgraded to terraform-provider-aws_3.24.0_linux_amd64.zip and now can be added specific tags for each EBS volume

            Source https://stackoverflow.com/questions/67515385

            QUESTION

            Issue using Laravel Passport with Tenancy for Laravel
            Asked 2021-May-10 at 05:10

            I am creating a subdomain-based multi-tenant laravel project using Tenancy For Laravel, everything is working fine except when trying to authenticate my API requests using Passport. How it works now is that I have a main database (multi-tenants) in which I declare tenants and specify the respective subdomain, and then each tenant has its own database (tenantfoo). I get through the Auth::check and credentials are checked in the correct database but when I try to create the token it stops using the tenant database (tenantfoo) and tries to create the token in the main database (multi-tenant) and gives the following exception.

            ...

            ANSWER

            Answered 2021-May-10 at 05:10

            So I ended up creating a middleware and manually changing the database on the fly to the correct one. And added the middleware to the Passport::routes(); initiation. This way all the passport routes will be checked against the correct database.

            Middleware Class:

            Source https://stackoverflow.com/questions/67330916

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install tenancy

            You can download it from GitHub.
            PHP requires the Visual C runtime (CRT). The Microsoft Visual C++ Redistributable for Visual Studio 2019 is suitable for all these PHP versions, see visualstudio.microsoft.com. You MUST download the x86 CRT for PHP x86 builds and the x64 CRT for PHP x64 builds. The CRT installer supports the /quiet and /norestart command-line switches, so you can also script it.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/archtechx/tenancy.git

          • CLI

            gh repo clone archtechx/tenancy

          • sshUrl

            git@github.com:archtechx/tenancy.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Authorization Libraries

            casbin

            by casbin

            RxPermissions

            by tbruyelle

            opa

            by open-policy-agent

            cancan

            by ryanb

            Try Top Libraries by archtechx

            enums

            by archtechxPHP

            laravel-seo

            by archtechxPHP

            airwire

            by archtechxPHP

            money

            by archtechxPHP

            laravel-pages

            by archtechxPHP