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

[Azure:Python] Add audience kwarg to constructor #6811

Open
3 tasks done
lmazuel opened this issue Apr 1, 2025 · 0 comments
Open
3 tasks done

[Azure:Python] Add audience kwarg to constructor #6811

lmazuel opened this issue Apr 1, 2025 · 0 comments
Labels
emitter:client:python Issue for the Python client emitter: @typespec/http-client-python feature New feature or request

Comments

@lmazuel
Copy link
Member

lmazuel commented Apr 1, 2025

Clear and concise description of the problem

Today, we generate client constructor that takes credential_scopes as an array, for instance:

self.credential_scopes = kwargs.pop("credential_scopes", ["https://cognitiveservices.azure.com/.default"])

For Azure only, we want to add audience, that works this way:

  • It's a string parameter
  • It's optional, and default to the scope of the TypeSpec, but without /.default. For instance, https://cognitiveservices.azure.com
  • If credential_scopes xor audience are used, they are winning over the TypeSpec definition.
  • If both credential_scopes and audience are present as user input at the same time, log a warning and use credential_scopes (ignore audience
  • Document `audience as a docstring, and make it a kwarg only syntax

Checklist

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
@lmazuel lmazuel changed the title [Azure:Python] Add audience kwarg to connstructor [Azure:Python] Add audience kwarg to constructor Apr 1, 2025
@lmazuel lmazuel added emitter:client:python Issue for the Python client emitter: @typespec/http-client-python feature New feature or request and removed needs-area labels Apr 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
emitter:client:python Issue for the Python client emitter: @typespec/http-client-python feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant