Skip to content
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 .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ PYTEST_ADMIN_PASSWORD=start123
PYTEST_DEFAULT_MASTER_IMAGE=python/base
PYTEST_ASYNC_MAX_RETRIES=5
PYTEST_ASYNC_RETRY_DELAY_MILLIS=500
PYTEST_HUB_VERSION=0.13.0
PYTEST_HUB_VERSION=0.15.0
PYTEST_RESPONSE_TIMEOUT=5
9 changes: 5 additions & 4 deletions docs/user_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -379,11 +379,12 @@ possible, including status code and additional information in the response body.

.. code-block:: console

received status code 400 (undefined): Can't find realm entity by realmId
received status code 500 (internal_error): Can't find realm entity by realmId
{
"status_code": 400,
"code": "undefined",
"message": "Can't find realm entity by realmId"
"code": "internal_error",
"status_code": 500,
"message": "Can't find realm entity by realmId",
"issues": []
}

In this example a :py:exc:`.HubAPIError` is raised because there is no realm with an ID that matches the dynamically
Expand Down
16 changes: 14 additions & 2 deletions flame_hub/_auth_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ class CreateClient(AuthBaseModel):
grant_types: str | None
auth_method: ClientAuthMethod
token_binding_method: ClientTokenBindingMethod
backchannel_logout_uri: str | None
post_logout_redirect_uri: str | None
realm_id: t.Annotated[uuid.UUID, Field(), WrapValidator(uuid_validator)]


Expand All @@ -208,9 +210,9 @@ class Client(AuthBaseModel):
secret_hashed: bool
grant_types: str | None
secret_encrypted: bool
scope: str | None
backchannel_logout_uri: str | None
post_logout_redirect_uri: str | None
Comment thread
pbrassel marked this conversation as resolved.
base_url: str | None
root_url: str | None
auth_method: ClientAuthMethod
token_binding_method: ClientTokenBindingMethod
created_at: datetime
Expand All @@ -231,6 +233,8 @@ class UpdateClient(AuthBaseModel):
grant_types: str | None | UNSET_T = UNSET
auth_method: ClientAuthMethod | UNSET_T = UNSET
token_binding_method: ClientTokenBindingMethod | UNSET_T = UNSET
backchannel_logout_uri: str | None | UNSET_T = UNSET
post_logout_redirect_uri: str | None | UNSET_T = UNSET


class AuthClient(BaseClient):
Expand Down Expand Up @@ -605,6 +609,8 @@ def create_client(
grant_types: str | None = None,
auth_method: ClientAuthMethod = "secret",
token_binding_method: ClientTokenBindingMethod = "none",
post_logout_redirect_uri: str | None = None,
backchannel_logout_uri: str | None = None,
**params: te.Unpack[BaseKwargs],
) -> Client:
return self._create_resource(
Expand All @@ -622,6 +628,8 @@ def create_client(
grant_types=grant_types,
auth_method=auth_method,
token_binding_method=token_binding_method,
post_logout_redirect_uri=post_logout_redirect_uri,
backchannel_logout_uri=backchannel_logout_uri,
),
"clients",
**params,
Expand Down Expand Up @@ -657,6 +665,8 @@ def update_client(
grant_types: str | None | UNSET_T = UNSET,
auth_method: ClientAuthMethod | UNSET_T = UNSET,
token_binding_method: ClientTokenBindingMethod | UNSET_T = UNSET,
post_logout_redirect_uri: str | None | UNSET_T = UNSET,
backchannel_logout_uri: str | None | UNSET_T = UNSET,
**params: te.Unpack[BaseKwargs],
) -> Client:
return self._update_resource(
Expand All @@ -673,6 +683,8 @@ def update_client(
grant_types=grant_types,
auth_method=auth_method,
token_binding_method=token_binding_method,
post_logout_redirect_uri=post_logout_redirect_uri,
backchannel_logout_uri=backchannel_logout_uri,
),
"clients",
client_id,
Expand Down
3 changes: 0 additions & 3 deletions tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,6 @@ def test_find_project_nodes(core_client, project_node, project_node_includables)
)


@pytest.mark.xfail(reason="node and project are not included in this case")
def test_get_project_node(core_client, project_node, project_node_includables):
project_node_get = core_client.get_project_node(project_node.id)

Expand Down Expand Up @@ -561,7 +560,6 @@ def test_find_analysis_nodes(core_client, analysis_node, analysis_node_includabl
)


@pytest.mark.xfail(reason="node and analysis are not included in this case")
def test_get_analysis_node(core_client, analysis_node, analysis_node_includables):
analysis_node_get = core_client.get_analysis_node(analysis_node.id)

Expand Down Expand Up @@ -640,7 +638,6 @@ def test_find_analysis_buckets(core_client, analysis_code_bucket, analysis_bucke
)


@pytest.mark.xfail(reason="analysis and analysis bucket are not included in this case")
def test_get_analysis_bucket_file(core_client, analysis_bucket_file, analysis_bucket_file_includables):
analysis_bucket_file_get = core_client.get_analysis_bucket_file(analysis_bucket_file.id)

Expand Down
4 changes: 2 additions & 2 deletions tests/test_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def test_password_auth_reissue_raise_error(password_auth, auth_base_url):
with pytest.raises(HubAPIError) as e:
new_client.get(auth_base_url)

assert "The JWT is invalid" in str(e.value)
assert "invalid_grant" in str(e.value)
assert e.value.error_response.status_code == httpx.codes.BAD_REQUEST.value


Expand Down Expand Up @@ -128,4 +128,4 @@ def test_static_auth_raise_error(auth_base_url):
client.get_users()

assert "The JWT is invalid" in str(e.value)
assert e.value.error_response.status_code == httpx.codes.BAD_REQUEST.value
assert e.value.error_response.status_code == httpx.codes.UNAUTHORIZED.value