Skip to content

Service bus cache of tokens doesn't support multiple creds in same app #68

@huguesv

Description

@huguesv

The cache of tokens '_tokens' in servicebus' init.py is a global variable (dictionary). A token is created based on the request host, path, issuer and account key. But the key for the cache is only using the request host and path. So if you try to use 2 instances of ServiceBusService, with different credentials, the cache will eventually return tokens for the wrong issuer/account key.

The key cache 'wrap_scope' should include the issuer and account_key, or the cache '_tokens' needs to be a field of ServiceBusService instead of a global variable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions