Skip to content

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

Description

@mrparalon

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions