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

Unable to set ext::auth::client_token global #472

Closed
mrparalon opened this issue Jan 10, 2024 · 0 comments · Fixed by #474
Closed

Unable to set ext::auth::client_token global #472

mrparalon opened this issue Jan 10, 2024 · 0 comments · Fixed by #474
Labels
bug Something isn't working

Comments

@mrparalon
Copy link

Describe the bug

I'm following the instruction about auth extension

Example for js client from docs

const client = createClient().withGlobals({
  "ext::auth::client_token": auth_token,
});

But python client return an error "Illegal name" when I set global like this

client = edgedb.asyncio_client.create_async_client().with_globals({
    "ext::auth::client_token": "example"
    })

It happens in resolve function, because it expects 1 or 2 :: in module path

If it will be useful for someone, I have workaround

client = edgedb.asyncio_client.create_async_client().with_module_aliases(
    {"auth": "ext::auth"}.with_globals({"auth::client_token": edgedb_auth_token}))

Reproduction
Include the code that is causing the error:

import edgedb
client = edgedb.asyncio_client.create_async_client().with_globals({
    "ext::auth::client_token": "example"
    })

Expected behavior
Setting global works according to docs

Versions (please complete the following information):

  • OS:
  • EdgeDB version: 4.4
  • EdgeDB CLI version: 4.0.2+500be79
  • edgedb-python version: 1.8.0
  • Python version:3.11.6
@raddevon raddevon added the bug Something isn't working label Jan 11, 2024
msullivan added a commit that referenced this issue Feb 1, 2024
msullivan added a commit that referenced this issue Feb 1, 2024
aljazerzen pushed a commit that referenced this issue Feb 15, 2024
aljazerzen added a commit that referenced this issue Feb 24, 2024
Fixes
=====

* Fix globals in nested modules (#474)
  (by @msullivan in ff08d9d for #474)

* Support passing dicts and namedtuples for namedtuple arguments (#473)
  (by @msullivan in 60da99a for #374)

* Expose the error details field. (#479)
  (by @vpetrovykh in 113ed0d for #472)
aljazerzen added a commit that referenced this issue Feb 26, 2024
Fixes
=====

* Fix globals in nested modules (#474)
  (by @msullivan in ff08d9d for #474)

* Support passing dicts and namedtuples for namedtuple arguments (#473)
  (by @msullivan in 60da99a for #374)

* Expose the error details field. (#479)
  (by @vpetrovykh in 113ed0d for #472)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants