Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User/Role/Feature lookup improvements #888

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Commits on Jan 29, 2021

  1. [BaseController::Authentication] Use :api_includes

    Use the new `:lookup_scope` argument for `.authenticate` and
    `.lookup_by_identity` to reduce the number of user based queries on
    every request.
    NickLaMuro committed Jan 29, 2021
    Configuration menu
    Copy the full SHA
    d1c9e09 View commit details
    Browse the repository at this point in the history
  2. [BaseController::Logger] Use miq_user_role.name

    While `virtual_delegates` can be used to improve performance via a
    single attribute in a query, we already bring back the `miq_user_role`
    (via the lookup_scope), so it is better to just use that.
    
    And currently virtual_delegates don't support already loaded
    relationships.
    NickLaMuro committed Jan 29, 2021
    Configuration menu
    Copy the full SHA
    4810302 View commit details
    Browse the repository at this point in the history
  3. Various user_or_id fixes

    There are a few places in the API where we re-fetch the User when it is
    already available.
    
    These fixes allow for making use of the existing user that already
    exists instead of calling another lookup.  The two places involved are:
    
    - When authenticating using .basic_authentication
    - When generating a token for the user (on login)
    NickLaMuro committed Jan 29, 2021
    Configuration menu
    Copy the full SHA
    db287af View commit details
    Browse the repository at this point in the history