You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
with all the credentials provided, the client is returnning something error
Steps to Reproduce
from conjur_api.providers.authn_authentication_strategy import AuthnAuthenticationStrategy
from conjur_api.providers.simple_credentials_provider import SimpleCredentialsProvider
from conjur_api.models import SslVerificationMode,ConjurConnectionInfo,CredentialsData
from conjur_api.client import Client
from dotenv import load_dotenv, find_dotenv
import os
ENV_FILE = find_dotenv()
if ENV_FILE:
load_dotenv(ENV_FILE)
it should return the login info, not the error info
Actual Results
ubuntu@host:/data/dev/conjur_api$ python3.10 auth.py
/data/dev/conjur_api/auth.py:36: RuntimeWarning: coroutine 'Client.login' was never awaited
client.login()
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Reproducible
Always
Sometimes
Non-Reproducible
Version/Tag number
What version of the product are you running? Any version info that you can
share is helpful. For example, you might give the version from Docker logs,
the Docker tag, a specific download URL, the output of the /info route, etc.
Environment setup
Can you describe the environment in which this product is running? Is it running on a VM / in a container / in a cloud?
Which cloud provider? Which container orchestrator (including version)?
The more info you can share about your runtime environment, the better we may be able to reproduce the issue.
Additional Information
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Traceback (most recent call last):
File "/data/dev/conjur_api/auth.py", line 39, in
asyncio.run(login())
File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
return future.result()
File "/data/dev/conjur_api/auth.py", line 37, in login
await client.login()
File "/home/ubuntu/.local/lib/python3.10/site-packages/conjur_api/client.py", line 92, in login
return await self._api.login()
File "/home/ubuntu/.local/lib/python3.10/site-packages/conjur_api/http/api.py", line 100, in login
return await self.authn_strategy.login(
File "/home/ubuntu/.local/lib/python3.10/site-packages/conjur_api/providers/authn_authentication_strategy.py", line 47, in login
raise MissingRequiredParameterException("password is required for login")
conjur_api.errors.errors.MissingRequiredParameterException: password is required for login
I fell into the same "trap", not knowing there was such a thing as the asyncio library. You need to wrap your logic into an async def function and use await on client methods. Something like this:
import asyncio
def main():
client = asyncio.run(get_client())
async def get_client():
# Setup your conjur client here
return await client.login()
if __name__ == "__main__":
main()
Summary
with all the credentials provided, the client is returnning something error
Steps to Reproduce
from conjur_api.providers.authn_authentication_strategy import AuthnAuthenticationStrategy
from conjur_api.providers.simple_credentials_provider import SimpleCredentialsProvider
from conjur_api.models import SslVerificationMode,ConjurConnectionInfo,CredentialsData
from conjur_api.client import Client
from dotenv import load_dotenv, find_dotenv
import os
ENV_FILE = find_dotenv()
if ENV_FILE:
load_dotenv(ENV_FILE)
conjur_url = os.getenv("CONJUR_URL")
account = os.getenv("ACCOUNT")
username = os.getenv("CONJUR_LOGIN_ID")
api_key = os.getenv("API_KEY")
ssl_verification_mode = SslVerificationMode.TRUST_STORE
connection_info = ConjurConnectionInfo(conjur_url=conjur_url,account=account,cert_file=None)
credentials = CredentialsData(username=username, api_key=api_key, machine=conjur_url)
credentials_provider = SimpleCredentialsProvider()
credentials_provider.save(credentials)
del credentials
authn_provider = AuthnAuthenticationStrategy(credentials_provider)
client = Client(connection_info,
authn_strategy=authn_provider,
ssl_verification_mode=ssl_verification_mode)
client.login()
Expected Results
it should return the login info, not the error info
Actual Results
ubuntu@host:/data/dev/conjur_api$ python3.10 auth.py
/data/dev/conjur_api/auth.py:36: RuntimeWarning: coroutine 'Client.login' was never awaited
client.login()
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Reproducible
Version/Tag number
What version of the product are you running? Any version info that you can
share is helpful. For example, you might give the version from Docker logs,
the Docker tag, a specific download URL, the output of the
/info
route, etc.Environment setup
Additional Information
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: