feat+fix: Pagination fix, SDK logging, OAuth1/DPoP types#785
feat+fix: Pagination fix, SDK logging, OAuth1/DPoP types#785fern-api[bot] wants to merge 1 commit intomasterfrom
Conversation
|
|
||
|
|
||
| class ILogger(typing.Protocol): | ||
| def debug(self, message: str, **kwargs: typing.Any) -> None: ... |
Check notice
Code scanning / CodeQL
Statement has no effect Note
Copilot Autofix
AI 1 day ago
Copilot could not generate an autofix suggestion
Copilot could not generate an autofix suggestion for this alert. Try pushing a new commit or if the problem persists contact support.
|
|
||
| class ILogger(typing.Protocol): | ||
| def debug(self, message: str, **kwargs: typing.Any) -> None: ... | ||
| def info(self, message: str, **kwargs: typing.Any) -> None: ... |
Check notice
Code scanning / CodeQL
Statement has no effect Note
Copilot Autofix
AI 1 day ago
Copilot could not generate an autofix suggestion
Copilot could not generate an autofix suggestion for this alert. Try pushing a new commit or if the problem persists contact support.
| class ILogger(typing.Protocol): | ||
| def debug(self, message: str, **kwargs: typing.Any) -> None: ... | ||
| def info(self, message: str, **kwargs: typing.Any) -> None: ... | ||
| def warn(self, message: str, **kwargs: typing.Any) -> None: ... |
Check notice
Code scanning / CodeQL
Statement has no effect Note
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 1 day ago
In general, when a function or method body consists solely of an expression like ..., that expression is evaluated and then discarded, giving no side effects. To fix this while preserving the intent of “no implementation,” replace the expression with pass, which explicitly indicates an empty body and has well‑defined semantics without being a useless computation.
Specifically in src/auth0/management/core/logging.py, inside the ILogger typing.Protocol, the methods debug, info, warn, and error are defined with ... on the same line as the signature. CodeQL flags the ... as a statement without effect. The best minimal fix is to give these methods a conventional empty body by putting pass on a new, indented line for each method. This keeps them unimplemented (which is appropriate for a Protocol), does not alter any runtime logic (these methods on the Protocol object are not called), and removes the useless expression statement.
Concretely:
- Change each of
def debug(self, message: str, **kwargs: typing.Any) -> None: ...def info(self, message: str, **kwargs: typing.Any) -> None: ...def warn(self, message: str, **kwargs: typing.Any) -> None: ...def error(self, message: str, **kwargs: typing.Any) -> None: ...
- To use a newline and an indented
pass:def debug(...):pass
and similarly for the others.
No new imports, methods, or other definitions are needed.
| @@ -14,12 +14,19 @@ | ||
|
|
||
|
|
||
| class ILogger(typing.Protocol): | ||
| def debug(self, message: str, **kwargs: typing.Any) -> None: ... | ||
| def info(self, message: str, **kwargs: typing.Any) -> None: ... | ||
| def warn(self, message: str, **kwargs: typing.Any) -> None: ... | ||
| def error(self, message: str, **kwargs: typing.Any) -> None: ... | ||
| def debug(self, message: str, **kwargs: typing.Any) -> None: | ||
| pass | ||
|
|
||
| def info(self, message: str, **kwargs: typing.Any) -> None: | ||
| pass | ||
|
|
||
| def warn(self, message: str, **kwargs: typing.Any) -> None: | ||
| pass | ||
|
|
||
| def error(self, message: str, **kwargs: typing.Any) -> None: | ||
| pass | ||
|
|
||
|
|
||
| class ConsoleLogger: | ||
| _logger: logging.Logger | ||
|
|
| def debug(self, message: str, **kwargs: typing.Any) -> None: ... | ||
| def info(self, message: str, **kwargs: typing.Any) -> None: ... | ||
| def warn(self, message: str, **kwargs: typing.Any) -> None: ... | ||
| def error(self, message: str, **kwargs: typing.Any) -> None: ... |
Check notice
Code scanning / CodeQL
Statement has no effect Note
Copilot Autofix
AI 1 day ago
Copilot could not generate an autofix suggestion
Copilot could not generate an autofix suggestion for this alert. Try pushing a new commit or if the problem persists contact support.
| from pydantic.v1.fields import ModelField as ModelField | ||
| from pydantic.v1.json import ENCODERS_BY_TYPE as encoders_by_type # type: ignore[attr-defined] | ||
| from pydantic.v1.typing import get_args as get_args | ||
| from pydantic.v1.typing import get_origin as get_origin |
Check notice
Code scanning / CodeQL
Unused import Note
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 1 day ago
To fix an unused import, you remove that specific import statement (or the unused name from a multi-name import) so that the code no longer declares a dependency on an unneeded symbol. This reduces noise and avoids misleading readers into thinking the symbol is used.
In this file, the problematic import is the get_origin symbol from pydantic.v1.typing inside the if IS_PYDANTIC_V2: branch. There is a corresponding get_origin import in the else branch from pydantic.typing, which CodeQL did not flag; this suggests that only the v2-specific one is unused. The minimal, behavior-preserving fix is to delete the single line:
from pydantic.v1.typing import get_origin as get_originand leave all other imports untouched. No additional methods, definitions, or imports are required to implement this change, since we are only removing an unused symbol.
Concretely, in src/auth0/management/core/pydantic_utilities.py, within the with warnings.catch_warnings(): block under if IS_PYDANTIC_V2:, remove the line 60 that imports get_origin. All other lines remain as-is.
| @@ -57,7 +57,6 @@ | ||
| from pydantic.v1.fields import ModelField as ModelField | ||
| from pydantic.v1.json import ENCODERS_BY_TYPE as encoders_by_type # type: ignore[attr-defined] | ||
| from pydantic.v1.typing import get_args as get_args | ||
| from pydantic.v1.typing import get_origin as get_origin | ||
| from pydantic.v1.typing import is_literal_type as is_literal_type | ||
| from pydantic.v1.typing import is_union as is_union | ||
| else: |
| from pydantic.v1.typing import get_args as get_args | ||
| from pydantic.v1.typing import get_origin as get_origin | ||
| from pydantic.v1.typing import is_literal_type as is_literal_type | ||
| from pydantic.v1.typing import is_union as is_union |
Check notice
Code scanning / CodeQL
Unused import Note
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 1 day ago
To fix an unused import, the safest general approach is to remove only the specific import that is not referenced anywhere in the file, leaving all other imports and functionality unchanged.
Concretely, in src/auth0/management/core/pydantic_utilities.py, in the if IS_PYDANTIC_V2: block inside the warnings.catch_warnings() context, delete the line that imports is_union from pydantic.v1.typing. Do not touch the corresponding non-v2 (else:) import of is_union, because we are not told it is unused, and we must avoid changing behavior for that branch. No additional methods, imports, or definitions are required.
| @@ -59,7 +59,6 @@ | ||
| from pydantic.v1.typing import get_args as get_args | ||
| from pydantic.v1.typing import get_origin as get_origin | ||
| from pydantic.v1.typing import is_literal_type as is_literal_type | ||
| from pydantic.v1.typing import is_union as is_union | ||
| else: | ||
| from pydantic.datetime_parse import parse_date as parse_date # type: ignore[no-redef] | ||
| from pydantic.datetime_parse import parse_datetime as parse_datetime # type: ignore[no-redef] |
Summary
This Fern regeneration includes several significant changes across 61 files:
Bug Fix: Pagination (Fixes #783)
raw_client.pyfilespage = page + len(_items or [])— skipped pages whenper_page > 1page = page + 1- correctly advances one page at a timeNew Feature: SDK Logging Infrastructure
loggingparameter on theAuth0clientcore/logging.pymodule withConsoleLogger,Logger,LogConfig, andILoggerprotocoldebug,info,warn,errorwith asilentmode (default)Authorization,Cookie,X-Api-Key, etc.) in log outputILoggerprotocolNew Types: OAuth1 & DPoP Connection Support
connection_access_token_url_oauth1,connection_client_id_oauth1,connection_scripts_oauth1, etc.)connection_dpop_signing_alg_enum,connection_dpop_signing_alg_values_supported)connection_options_oidc_metadata,connection_options_common_oidc)client_token_exchange_type_enumandresource_server_proof_of_possession_required_for_enumOther Changes
create,get,update) andself_service_profilemodelcore/custom_pagination.py(replaced by standard pagination)reference.mdand test configuration (conftest.py)Test Plan
per_page=2, verified 3 pages returned with all 5 roles