Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request juju#17292 from manadart/dqlite-check-creds
juju#17292 This patch constitutes some progress towards using the permissions domain for login authorisation. It is necessarily large due to the number of tests affected by changing the data source for this logic. We use the `ID` method instead of the `Name` method on user tags in order to preserve the `@domain` section for external users. Such users will reside in the user table, where under Mongo they had an entry only in the model or controller users collections. In several places we have migrated permission checks to the new access service backing. - The permission delegator now uses the access service. - The login authenticator now uses the access service - Introspection auth checking now shims the access service for permissions checking. There are a couple of to-do comments regarding: - Checking for controller access by controller tag (UUID). - Having to check access for `everyone@external` by direct service access. The commented block for testing the last user login will be reinstated in a patch to come. To keep this patch manageable, these changes should follow: - Rework of the last user login so that a failed login does not indicate a connection to the controller. - Work towards removal of `state.State` and legacy state model from `serveConn` down through `apiHandler`. - Ensuring that we can add external users implicitly when they are granted permissions. - Refactoring common `UserAccessFunc` to use a signature compatible with the access service. ## QA steps - `juju bootstrap lxd lxd --debug --build-agent` - `juju add-model work` - `juju change-user-password admin` - `juju add-user joe` - `juju change-user-password joe` - `juju logout` - `juju login -u joe -c lxd` - Should not be able to see any models. - `juju logout` - `juju login -u admin -c lxd` - `juju grant joe admin work` - `juju logout` - `juju login -u joe -c lxd` - Should now be able to access model. ## Documentation changes None. ## Links **Jira card:** [JUJU-5913](https://warthogs.atlassian.net/browse/JUJU-5913) [JUJU-5913]: https://warthogs.atlassian.net/browse/JUJU-5913?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
- Loading branch information