Slackbot
06/12/2023, 11:55 AMOr Weis
06/12/2023, 12:17 PMMaxime Broussart
06/12/2023, 2:08 PMOr Weis
06/12/2023, 2:10 PMMaxime Broussart
06/14/2023, 10:05 AMOPAL_AUTH_MASTER_TOKEN=JwMXIIyrFR
, then with the cli : opal-client obtain-token JwMXIIyrFR --type datasource --server-url <http://localhost:7002>
gives me this error :
File "/home/maxime/.local/lib/python3.11/site-packages/opal_common/cli/commands.py", line 78, in fetch
return data["token"]
~~~~^^^^^^^^^
KeyError: 'token'
# I only pasted the last Tracedback error.
Any idea for this issue?
Thank you in advance for your help 😉Or Weis
06/14/2023, 10:22 AMBut, I am not really satisfied with this approach because I have to pass all the postgres credentials as plaintext in the body of the request. Do you think there is a more secure way?You can include user/password as part of the URL if you prefer https://github.com/permitio/opal-fetcher-postgres#-possible-user-issues And you can fork the data-provider, and create one that take credentials from elsewhere (e.g. an env var, a file) Re:
In the meantime, I am trying option 1 with CLI using token but I am stuck in getting a datasource identity token. I added an env variable on my docker compose for the OPAL server :I’m not sure what’s wrong, but it seems like the reply from the server side didn’t contain the token; you can probably debug it and see an error message from the server, then with the cli :OPAL_AUTH_MASTER_TOKEN=JwMXIIyrFR
gives me this error :opal-client obtain-token JwMXIIyrFR --type datasource --server-url <http://localhost:7002>
Or Weis
06/14/2023, 10:24 AM--no-just-the-token
to see the full returning objectMaxime Broussart
06/14/2023, 2:28 PM--no-just-the-token
, I get :
{'detail': 'opal server was not configured with security, cannot generate tokens!'}
and at the same time, the OPAL Server logs uvicorn.protocols.http.httptools_impl | INFO | 172.22.0.1:54224 - "POST /token HTTP/1.1" 503
However, on the docker-compose, I well added for the OPAL Server config : OPAL_AUTH_PRIVATE_KEY, OPAL_AUTH_PUBLIC_KEY, OPAL_AUTH_MASTER_TOKEN
Any ideas? 🤔Or Weis
06/14/2023, 3:05 PMAsaf Cohen
06/14/2023, 3:08 PMAsaf Cohen
06/14/2023, 3:09 PMMaxime Broussart
06/14/2023, 3:40 PM