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

Request Timeout cannot be set via an environment variable #391

Open
cmc333333 opened this issue Mar 8, 2024 · 0 comments
Open

Request Timeout cannot be set via an environment variable #391

cmc333333 opened this issue Mar 8, 2024 · 0 comments

Comments

@cmc333333
Copy link

I have the following environment variables set:

OKTA_CLIENT_SCOPES=okta.logs.read
OKTA_CLIENT_AUTHORIZATIONMODE=PrivateKey
OKTA_CLIENT_RATELIMIT_MAXRETRIES=4
OKTA_CLIENT_REQUESTTIMEOUT=300
OKTA_CLIENT_PRIVATEKEY=[snip]
OKTA_CLIENT_CLIENTID=[snip]
OKTA_CLIENT_CONNECTIONTIMEOUT=30
OKTA_CLIENT_ORGURL=[snip]

and the following Python script:

import asyncio

from okta.client import Client


async def main():
    client = Client({"raiseException": True})


if __name__ == "__main__":
    loop = asyncio.get_event_loop()
    loop.run_until_complete(main())

Unfortunately, when I run this script, an exception is raised:

/usr/src/app/main.py:11: DeprecationWarning: There is no current event loop
  loop = asyncio.get_event_loop()
Traceback (most recent call last):
  File "/usr/src/app/main.py", line 12, in <module>
    loop.run_until_complete(main())
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 685, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/usr/src/app/main.py", line 7, in main
    client = Client({"raiseException": True})
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/okta/client.py", line 147, in __init__
    user_config.get("requestExecutor", RequestExecutor)(
  File "/usr/local/lib/python3.12/site-packages/okta/request_executor.py", line 35, in __init__
    if self._request_timeout < 0:
       ^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: '<' not supported between instances of 'str' and 'int'

Looks like the env vars aren't converted to ints (at least in this case)?

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