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

MinVersion: lower it, and better error return #325

Merged
merged 6 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion diracx-cli/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies = [
"diracx-client",
"diracx-core",
"gitpython",
"pydantic",
"pydantic>=2.10",
"rich",
"typer",
"pyyaml",
Expand Down
12 changes: 9 additions & 3 deletions diracx-client/src/diracx/client/generated/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].0)
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.3, generator: @autorest/[email protected].5)
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
# pylint: disable=wrong-import-position

from ._client import Dirac
from typing import TYPE_CHECKING

if TYPE_CHECKING:
from ._patch import * # pylint: disable=unused-wildcard-import

Check warning on line 11 in diracx-client/src/diracx/client/generated/__init__.py

View check run for this annotation

Codecov / codecov/patch

diracx-client/src/diracx/client/generated/__init__.py#L11

Added line #L11 was not covered by tests

from ._client import Dirac # type: ignore

try:
from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
from ._patch import *
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk
Expand Down
2 changes: 1 addition & 1 deletion diracx-client/src/diracx/client/generated/_client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].0)
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.3, generator: @autorest/[email protected].5)
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].0)
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.3, generator: @autorest/[email protected].5)
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

Expand Down
16 changes: 8 additions & 8 deletions diracx-client/src/diracx/client/generated/_serialization.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pylint: disable=too-many-lines
# --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
Expand Down Expand Up @@ -536,7 +537,6 @@
def _classify(cls, response, objects):
"""Check the class _subtype_map for any child classes.
We want to ignore any inherited _subtype_maps.
Remove the polymorphic key from the initial data.

:param dict response: The initial data
:param dict objects: The class objects
Expand All @@ -548,9 +548,9 @@

if not isinstance(response, ET.Element):
rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1]
subtype_value = response.pop(
subtype_value = response.get(

Check warning on line 551 in diracx-client/src/diracx/client/generated/_serialization.py

View check run for this annotation

Codecov / codecov/patch

diracx-client/src/diracx/client/generated/_serialization.py#L551

Added line #L551 was not covered by tests
rest_api_response_key, None
) or response.pop(subtype_key, None)
) or response.get(subtype_key, None)
else:
subtype_value = xml_key_extractor(
subtype_key, cls._attribute_map[subtype_key], response
Expand Down Expand Up @@ -1802,13 +1802,13 @@
try:
readonly = [
k
for k, v in response._validation.items()
if v.get("readonly") # pylint: disable=protected-access
for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore
if v.get("readonly")
]
const = [
k
for k, v in response._validation.items()
if v.get("constant") # pylint: disable=protected-access
for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore
if v.get("constant")
]
kwargs = {
k: v
Expand All @@ -1819,7 +1819,7 @@
for attr in readonly:
setattr(response_obj, attr, attrs.get(attr))
if additional_properties:
response_obj.additional_properties = additional_properties
response_obj.additional_properties = additional_properties # type: ignore

Check warning on line 1822 in diracx-client/src/diracx/client/generated/_serialization.py

View check run for this annotation

Codecov / codecov/patch

diracx-client/src/diracx/client/generated/_serialization.py#L1822

Added line #L1822 was not covered by tests
return response_obj
except TypeError as err:
msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore
Expand Down
2 changes: 1 addition & 1 deletion diracx-client/src/diracx/client/generated/_vendor.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].0)
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.3, generator: @autorest/[email protected].5)
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

Expand Down
12 changes: 9 additions & 3 deletions diracx-client/src/diracx/client/generated/aio/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].0)
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.3, generator: @autorest/[email protected].5)
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
# pylint: disable=wrong-import-position

from ._client import Dirac
from typing import TYPE_CHECKING

Check warning on line 8 in diracx-client/src/diracx/client/generated/aio/__init__.py

View check run for this annotation

Codecov / codecov/patch

diracx-client/src/diracx/client/generated/aio/__init__.py#L8

Added line #L8 was not covered by tests

if TYPE_CHECKING:
from ._patch import * # pylint: disable=unused-wildcard-import

Check warning on line 11 in diracx-client/src/diracx/client/generated/aio/__init__.py

View check run for this annotation

Codecov / codecov/patch

diracx-client/src/diracx/client/generated/aio/__init__.py#L10-L11

Added lines #L10 - L11 were not covered by tests

from ._client import Dirac # type: ignore

Check warning on line 13 in diracx-client/src/diracx/client/generated/aio/__init__.py

View check run for this annotation

Codecov / codecov/patch

diracx-client/src/diracx/client/generated/aio/__init__.py#L13

Added line #L13 was not covered by tests

try:
from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
from ._patch import *

Check warning on line 17 in diracx-client/src/diracx/client/generated/aio/__init__.py

View check run for this annotation

Codecov / codecov/patch

diracx-client/src/diracx/client/generated/aio/__init__.py#L17

Added line #L17 was not covered by tests
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk
Expand Down
2 changes: 1 addition & 1 deletion diracx-client/src/diracx/client/generated/aio/_client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].0)
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.3, generator: @autorest/[email protected].5)
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].0)
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.3, generator: @autorest/[email protected].5)
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion diracx-client/src/diracx/client/generated/aio/_vendor.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].0)
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.3, generator: @autorest/[email protected].5)
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].0)
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.3, generator: @autorest/[email protected].5)
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
# pylint: disable=wrong-import-position

from ._operations import WellKnownOperations
from ._operations import AuthOperations
from ._operations import ConfigOperations
from ._operations import JobsOperations
from typing import TYPE_CHECKING

Check warning on line 8 in diracx-client/src/diracx/client/generated/aio/operations/__init__.py

View check run for this annotation

Codecov / codecov/patch

diracx-client/src/diracx/client/generated/aio/operations/__init__.py#L8

Added line #L8 was not covered by tests

if TYPE_CHECKING:
from ._patch import * # pylint: disable=unused-wildcard-import

Check warning on line 11 in diracx-client/src/diracx/client/generated/aio/operations/__init__.py

View check run for this annotation

Codecov / codecov/patch

diracx-client/src/diracx/client/generated/aio/operations/__init__.py#L10-L11

Added lines #L10 - L11 were not covered by tests

from ._operations import WellKnownOperations # type: ignore
from ._operations import AuthOperations # type: ignore
from ._operations import ConfigOperations # type: ignore
from ._operations import JobsOperations # type: ignore

Check warning on line 16 in diracx-client/src/diracx/client/generated/aio/operations/__init__.py

View check run for this annotation

Codecov / codecov/patch

diracx-client/src/diracx/client/generated/aio/operations/__init__.py#L13-L16

Added lines #L13 - L16 were not covered by tests

from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
from ._patch import *

Check warning on line 19 in diracx-client/src/diracx/client/generated/aio/operations/__init__.py

View check run for this annotation

Codecov / codecov/patch

diracx-client/src/diracx/client/generated/aio/operations/__init__.py#L19

Added line #L19 was not covered by tests
from ._patch import patch_sdk as _patch_sdk

__all__ = [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].0)
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.3, generator: @autorest/[email protected].5)
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
Expand Down Expand Up @@ -236,9 +236,25 @@ async def initiate_device_flow(
"""Initiate Device Flow.

Initiate the device flow against DIRAC authorization Server.
Scope must have exactly up to one ``group`` (otherwise default) and
one or more ``property`` scope.
If no property, then get default one.

Scope details:


*
If only VO is provided: Uses the default group and its properties for the VO.

*
If VO and group are provided: Uses the specified group and its properties for the VO.

*
If VO and properties are provided: Uses the default group and combines its properties with
the
provided properties.

*
If VO, group, and properties are provided: Uses the specified group and combines its
properties with the
provided properties.

Offers the user to go with the browser to
``auth/<vo>/device?user_code=XYZ``.
Expand Down Expand Up @@ -633,9 +649,9 @@ async def userinfo(self, **kwargs: Any) -> _models.UserInfoResponse:
async def authorization_flow(
self,
*,
response_type: Union[str, _models.Enum0],
response_type: str,
code_challenge: str,
code_challenge_method: Union[str, _models.Enum1],
code_challenge_method: str,
client_id: str,
redirect_uri: str,
scope: str,
Expand All @@ -648,16 +664,35 @@ async def authorization_flow(
It will redirect to the actual OpenID server (IAM, CheckIn) to
perform a authorization code flow.

Scope details:


*
If only VO is provided: Uses the default group and its properties for the VO.

*
If VO and group are provided: Uses the specified group and its properties for the VO.

*
If VO and properties are provided: Uses the default group and combines its properties with
the
provided properties.

*
If VO, group, and properties are provided: Uses the specified group and combines its
properties with the
provided properties.

We set the user details obtained from the user authorize flow in a cookie
to be able to map the authorization flow with the corresponding
user authorize flow.

:keyword response_type: "code" Required.
:paramtype response_type: str or ~generated.models.Enum0
:keyword response_type: Required.
:paramtype response_type: str
:keyword code_challenge: Required.
:paramtype code_challenge: str
:keyword code_challenge_method: "S256" Required.
:paramtype code_challenge_method: str or ~generated.models.Enum1
:keyword code_challenge_method: Required.
:paramtype code_challenge_method: str
:keyword client_id: Required.
:paramtype client_id: str
:keyword redirect_uri: Required.
Expand Down
99 changes: 50 additions & 49 deletions diracx-client/src/diracx/client/generated/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,54 +1,60 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].0)
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.3, generator: @autorest/[email protected].5)
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
# pylint: disable=wrong-import-position

from ._models import BodyAuthToken
from ._models import BodyAuthTokenGrantType
from ._models import DevelopmentSettings
from ._models import GroupInfo
from ._models import HTTPValidationError
from ._models import InitiateDeviceFlowResponse
from ._models import InsertedJob
from ._models import JobSearchParams
from ._models import JobSearchParamsSearchItem
from ._models import JobStatusReturn
from ._models import JobStatusUpdate
from ._models import JobSummaryParams
from ._models import JobSummaryParamsSearchItem
from ._models import LimitedJobStatusReturn
from ._models import Metadata
from ._models import SandboxDownloadResponse
from ._models import SandboxInfo
from ._models import SandboxUploadResponse
from ._models import ScalarSearchSpec
from ._models import ScalarSearchSpecValue
from ._models import SetJobStatusReturn
from ._models import SortSpec
from ._models import SupportInfo
from ._models import TokenResponse
from ._models import UserInfoResponse
from ._models import VOInfo
from ._models import ValidationError
from ._models import ValidationErrorLocItem
from ._models import VectorSearchSpec
from ._models import VectorSearchSpecValues
from typing import TYPE_CHECKING

from ._enums import ChecksumAlgorithm
from ._enums import Enum0
from ._enums import Enum1
from ._enums import Enum2
from ._enums import Enum3
from ._enums import Enum4
from ._enums import JobStatus
from ._enums import SandboxFormat
from ._enums import SandboxType
from ._enums import ScalarSearchOperator
from ._enums import SortDirection
from ._enums import VectorSearchOperator
if TYPE_CHECKING:
from ._patch import * # pylint: disable=unused-wildcard-import

Check warning on line 11 in diracx-client/src/diracx/client/generated/models/__init__.py

View check run for this annotation

Codecov / codecov/patch

diracx-client/src/diracx/client/generated/models/__init__.py#L11

Added line #L11 was not covered by tests


from ._models import ( # type: ignore
BodyAuthToken,
BodyAuthTokenGrantType,
DevelopmentSettings,
GroupInfo,
HTTPValidationError,
InitiateDeviceFlowResponse,
InsertedJob,
JobSearchParams,
JobSearchParamsSearchItem,
JobStatusReturn,
JobStatusUpdate,
JobSummaryParams,
JobSummaryParamsSearchItem,
LimitedJobStatusReturn,
Metadata,
SandboxDownloadResponse,
SandboxInfo,
SandboxUploadResponse,
ScalarSearchSpec,
ScalarSearchSpecValue,
SetJobStatusReturn,
SortSpec,
SupportInfo,
TokenResponse,
UserInfoResponse,
VOInfo,
ValidationError,
ValidationErrorLocItem,
VectorSearchSpec,
VectorSearchSpecValues,
)

from ._enums import ( # type: ignore
ChecksumAlgorithm,
JobStatus,
SandboxFormat,
SandboxType,
ScalarSearchOperator,
SortDirection,
VectorSearchOperator,
)
from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
from ._patch import *
from ._patch import patch_sdk as _patch_sdk

__all__ = [
Expand Down Expand Up @@ -83,11 +89,6 @@
"VectorSearchSpec",
"VectorSearchSpecValues",
"ChecksumAlgorithm",
"Enum0",
"Enum1",
"Enum2",
"Enum3",
"Enum4",
"JobStatus",
"SandboxFormat",
"SandboxType",
Expand Down
Loading