You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi all,
I need to specify X-Correlation-ID header in every management call, however, despite the fact that the low-level RestClient api allow to specify any request-header, the high-level ones don't.
As an example in users lib the method to get a user is:
def get(
self, id: str, fields: List[str] | None = None, include_fields: bool = True
) -> dict[str, Any]:
"""Get a user.
Args:
id (str): The user_id of the user to retrieve.
fields (list of str, optional): A list of fields to include or
exclude from the result (depending on include_fields). Leave empty to
retrieve all fields.
include_fields (bool, optional): True if the fields specified are
to be included in the result, False otherwise. Defaults to True.
See: https://auth0.com/docs/api/management/v2#!/Users/get_users_by_id
"""
params = {
"fields": fields and ",".join(fields) or None,
"include_fields": str(include_fields).lower(),
}
return self.client.get(self._url(id), params=params)
That doesn't allow to specify any request parameter.
Describe the ideal solution
What about change all the method signatures specifying an optional last parameter with the request_headers like this:
Checklist
Describe the problem you'd like to have solved
Hi all,
I need to specify
X-Correlation-ID
header in every management call, however, despite the fact that the low-levelRestClient
api allow to specify any request-header, the high-level ones don't.As an example in
users
lib the method to get a user is:That doesn't allow to specify any request parameter.
Describe the ideal solution
What about change all the method signatures specifying an optional last parameter with the request_headers like this:
Alternatives and current workarounds
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: