Update role_mappings to avoid data loss

Created on 13 November 2024, 3 months ago

Problem/Motivation

✨ Allow to turn off roles mapping Active updates the config format to avoid data loss (removing all assigned roles for a given user). But existing installations, did not get an update for the new configuration.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany webflo

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @webflo
  • πŸ‡©πŸ‡ͺGermany webflo
  • Pipeline finished with Success
    3 months ago
    Total: 263s
    #336970
  • πŸ‡°πŸ‡·South Korea keithkhl

    Does this update help auto-mapping new openID users to existing user's roles?

  • πŸ‡°πŸ‡·South Korea keithkhl

    Just tested out the overnight dev version. confirm that it works

  • πŸ‡ΊπŸ‡ΈUnited States qqmyers

    FWIW: As a work-around for those seeing permissions disappearing, adding a role mapping in the openid_connect/settings page, saving, and then removing it and saving again updates the settings to remove all empty values (as the patch does) and avoids the problem.

  • πŸ‡ΊπŸ‡ΈUnited States dcam

    We didn't experience this problem until after updating to 3.0.0-alpha4. The change introduced by πŸ› Mapped user roles are not always revoked Active caused the issue to manifest. Since we don't use the role mapping feature they were all empty. After the restriction of checking for checking to see if the user has groups was removed it suddenly started removing all roles from everyone upon login. The conclusion I'm drawing from this is that you may be about to have a whole lot more people reporting data loss problems to you if this isn't patched.

    That said, I reviewed the patch. The changes to the configuration are pretty simple. So I tested it out on one of our broken sites. It worked to fix the issue. Also, the changes to the configuration are the same as if you follow the workaround steps in #6. So this is RTBC to me unless you want an update path test. I'd work on writing one for you, but creating the test is going to be pretty involved since you don't already have a test fixture set up and I need to go patch 15 websites now before anyone else tries to log in.

    By the way, it's unnecessary to add a mapping, save, remove the mapping, and save again for the workaround. You can just resave the form once without entering anything.

  • Pipeline finished with Failed
    about 1 month ago
    Total: 186s
    #379980
  • Pipeline finished with Failed
    about 1 month ago
    Total: 156s
    #379981
  • Pipeline finished with Failed
    about 1 month ago
    Total: 187s
    #379986
  • Pipeline finished with Failed
    about 1 month ago
    Total: 228s
    #380001
  • Pipeline finished with Failed
    about 1 month ago
    Total: 194s
    #380013
  • Pipeline finished with Failed
    about 1 month ago
    Total: 344s
    #380062
  • πŸ‡ΊπŸ‡ΈUnited States dcam

    The test is failing due to an issue with an externalauth view schema. I don't know why the test still fails even though I set the property to stop checking schemas. There's probably some nuance of the config checker I don't know about. But since that didn't work and it really ought to be fixed upstream I submitted πŸ“Œ Remove default_argument_skip_url key from views.view.authmap Active to the externalauth module in an effort to try and move past this. Hopefully they'll verify the bug and commit the change soon.

    I'm setting the status to Needs Review even though the test doesn't pass on GitLab CI so people will start looking at the test changes.

  • πŸ‡ΊπŸ‡ΈUnited States pfrilling Minster, OH

    Assigning myself as I review the issue.

  • πŸ‡ΊπŸ‡ΈUnited States dcam

    Let me know if you would like for me to work on any changes. I'm available to help this afternoon.

  • πŸ‡ΊπŸ‡ΈUnited States pfrilling Minster, OH

    I updated the tests to:

    1. Fix the externalauth schema error
    2. Added a test case that ensures an existing role mapping remains.
    3. Made the fixture a bit easier to read.

    I believe this all looks good. Would love someone to review my changes before I commit.

  • πŸ‡ΊπŸ‡ΈUnited States dcam

    Would love someone to review my changes before I commit.

    Please see the above comments.

  • πŸ‡ΊπŸ‡ΈUnited States dcam

    Oops, hit the submit button too soon.
     
    If you don't want to take any action on what I mentioned, then this is RTBC from me. I'll go ahead and set the status.

  • πŸ‡ΊπŸ‡ΈUnited States pfrilling Minster, OH

    I made the change you called out on the MR @dcam.

    Thanks everyone for your work! This has been merged.

  • πŸ‡ΊπŸ‡ΈUnited States dcam

    Cheers, thanks for working on this with us and getting it committed so quickly!

  • πŸ‡ΊπŸ‡ΈUnited States dcam

    Though I just noticed that I didn't get credited on the commit. Oh well. Could you add issue credit for me, please?

  • πŸ‡ΊπŸ‡ΈUnited States pfrilling Minster, OH

    Attributing credit to all who helped. Thanks again!

  • Status changed to Fixed 13 days ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024