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

KeyError: 'username' when authenticating with pulsar #373

Open
peterg1t opened this issue Sep 17, 2024 · 0 comments
Open

KeyError: 'username' when authenticating with pulsar #373

peterg1t opened this issue Sep 17, 2024 · 0 comments

Comments

@peterg1t
Copy link
Contributor

In the documentation an example of authentication and authorization is shown in https://pulsar.readthedocs.io/en/latest/configure.html

  authentication:
    - type: oidc
      oidc_jwks_url: https://login.microsoftonline.com/xxx/discovery/v2.0/keys
      oidc_provider: azure
      oidc_username_in_token: preferred_username
      oidc_username_template: *.
  authorization:
    - type: userlist
      userlist_allowed_users:
        - xxx

In my example I setup authorization only and when app.yml is configured with this I get the following error:

Sep 17 13:07:18 pulsar pulsar[176452]: Traceback (most recent call last):
Sep 17 13:07:18 pulsar pulsar[176452]:   File "/home/pulsar/venv/lib/python3.6/site-packages/pulsar/managers/stateful.py", line 135, in _handling_of_preprocessing_state
Sep 17 13:07:18 pulsar pulsar[176452]:     **launch_kwds
Sep 17 13:07:18 pulsar pulsar[176452]:   File "/home/pulsar/venv/lib/python3.6/site-packages/pulsar/managers/queued_drmaa.py", line 15, in launch
Sep 17 13:07:18 pulsar pulsar[176452]:     self._check_execution_with_tool_file(job_id, command_line)
Sep 17 13:07:18 pulsar pulsar[176452]:   File "/home/pulsar/venv/lib/python3.6/site-packages/pulsar/managers/base/directory.py", line 133, in _check_execution_with_tool_file
Sep 17 13:07:18 pulsar pulsar[176452]:     self._check_execution(job_id, tool_id, command_line)
Sep 17 13:07:18 pulsar pulsar[176452]:   File "/home/pulsar/venv/lib/python3.6/site-packages/pulsar/managers/base/__init__.py", line 183, in _check_execution
Sep 17 13:07:18 pulsar pulsar[176452]:     self.user_auth_manager.authorize(job_id, job_directory)
Sep 17 13:07:18 pulsar pulsar[176452]:   File "/home/pulsar/venv/lib/python3.6/site-packages/pulsar/user_auth/manager.py", line 42, in authorize
Sep 17 13:07:18 pulsar pulsar[176452]:     res = method.authorize(authentication_info)
Sep 17 13:07:18 pulsar pulsar[176452]:   File "/home/pulsar/venv/lib/python3.6/site-packages/pulsar/user_auth/methods/userlist.py", line 18, in authorize
Sep 17 13:07:18 pulsar pulsar[176452]:     return authentication_info["username"] in self._allowed_users
Sep 17 13:07:18 pulsar pulsar[176452]: KeyError: 'username'

This is my full config file:

amqp_publish_retry: true
amqp_publish_retry_interval_max: 60
amqp_publish_retry_interval_start: 10
amqp_publish_retry_interval_step: 10
amqp_publish_retry_max_retries: 5
user_auth:
    authorization:
        - type: userlist
          userlist_allowed_users:
              - pemartin
assign_ids: none
dependency_resolution:
    resolvers:
    -   auto_init: true
        auto_install: true
        type: conda
job_metrics_config_file: job_metrics_conf.xml
managers:
    _default_:
        production: true
        type: queued_drmaa
message_queue_url: pyamqp://?ssl=1
min_polling_interval: 0.5
persistence_directory: /home/pulsar/files/persisted_data
staging_directory: /home/pulsar/files/staging
tool_dependency_dir: /home/pulsar/deps

Is this a real issue or am I doing something wrong here? Thank you very much in advance for your help!

Pedro

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