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

op client_db config bug? #109

Open
ImuruKevol opened this issue Aug 1, 2024 · 0 comments
Open

op client_db config bug? #109

ImuruKevol opened this issue Aug 1, 2024 · 0 comments

Comments

@ImuruKevol
Copy link

I'm set client_db config, but following error occurred:

  File "[MY_PROJECT_PATH]/server.py", line 187, in oph
    self.init_handler()
  File "[MY_PROJECT_PATH]/server.py", line 181, in init_handler
    server = Server(config, cwd=cwd)
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/oidc/lib/python3.12/site-packages/idpyoidc/server/__init__.py", line 77, in __init__
    self.context = EndpointContext(
                   ^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/oidc/lib/python3.12/site-packages/idpyoidc/server/endpoint_context.py", line 138, in __init__
    self.cdb = importer(_client_db["class"])(**_client_db["kwargs"])
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/oidc/lib/python3.12/site-packages/cryptojwt/utils.py", line 228, in importer
    _part = modsplit(name)
            ^^^^^^^^^^^^^^
  File "/opt/conda/envs/oidc/lib/python3.12/site-packages/cryptojwt/utils.py", line 213, in modsplit
    if ":" in name:
       ^^^^^^^^^^^
TypeError: argument of type 'type' is not iterable

my server config

from idpyoidc.server import Server

class ClientDB(object):
  ....

...
config = {
  ...
  "client_db": {
      "class": ClientDB,
      "kwargs": {},
  },
  ...
}
cwd = "/my/project/path"
server = Server(config, cwd=cwd)

In my case, edit idpyoidc/server/endpoint_context.py file.

            # line 136
            # self.cdb = importer(_client_db["class"])(**_client_db["kwargs"])
            try:
                self.cdb = importer(_client_db["class"])(**_client_db["kwargs"])
            except:
                self.cdb = _client_db["class"](**_client_db["kwargs"])

I'm not sure why you'd want to use the "importer" function to create a PR, so I'll leave an issue for now.

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant