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

Python SDK incorrect typing in Access Manager #198

Open
vatssur opened this issue Oct 5, 2024 · 0 comments
Open

Python SDK incorrect typing in Access Manager #198

vatssur opened this issue Oct 5, 2024 · 0 comments

Comments

@vatssur
Copy link

vatssur commented Oct 5, 2024

I was migrating Pubnub access manager to V3 when I referred to the official docs provided here and here.
Referring to this code:

channels = [
    Channel.id("channel-a").read(),
    Channel.pattern("channel-[A-Za-z0-9]").read(),
    Channel.id("channel-b").read().write(),
    Channel.id("channel-c").read().write(),
    Channel.id("channel-d").read().write()
]

It is very unsure about where the Channel Entity exists. It is not clarified even in the docs around Channel as an entity. After multiple cycles in the docs, I referred to the code on GitHub for clarification.
In the GrantToken file, we can see that channels is defined as Union[str, List[str]] but if we look inside the build_data function, it expects a PNResource instead of str for all of the resources that can be defined.
Final solution of how to properly define a grant_token as per access manager V3 was found in the test file here. Here we have easy to read code, replicable and complete with all the imports.
Hope this helps with any poor souls like me stuck in the migration. Will update here with more clarifications if I face further issues.

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