codemation/easyauth

Import config api doesn't work

remydewa opened this issue · 2 comments

Hello everyone,

I have an issue with the export/import config api. When I export and import the default config I have an exception at the import.

File \"/usr/local/lib/python3.9/dist-packages/easyauth/api.py\", line 110, in import_auth_config\n for action in role[\"permissions\"][\"actions\"]:\nKeyError: 'permissions'"}
In my exported config my roles looks like:

"roles": [
    {
      "role": "admin",
      "actions": [
        {
          "action": "CREATE_USER",
          "details": "default action for creating users"
        }
      ]
    }
  ]

It's true I don't have the permissions key.

Hey @remydewa , thanks for reporting, I can see the bug in the code which is preventing the export. Will include fix in next release.

@remydewa - In version 2.0.0 this is now fixed, see documentation on syntax changes required to support latest fastapi version