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

Fix SSO config removal in quilt3.admin.sso_config.set() #4098

Merged
merged 3 commits into from
Aug 15, 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
10 changes: 6 additions & 4 deletions api/python/quilt3/admin/_graphql_client/client.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 11 additions & 6 deletions api/python/quilt3/admin/_graphql_client/sso_config_set.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions api/python/quilt3/admin/sso_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ def get() -> T.Optional[types.SSOConfig]:
return None if result is None else types.SSOConfig(**result.model_dump())


def set(config: T.Optional[str]) -> types.SSOConfig:
def set(config: T.Optional[str]) -> T.Optional[types.SSOConfig]:
"""
Set the SSO configuration.
Set the SSO configuration. Pass `None` to remove SSO configuration.
"""
return types.SSOConfig(**util.handle_errors(util.get_client().sso_config_set(config)).model_dump())
result = util.get_client().sso_config_set(config)
return None if result is None else types.SSOConfig(**util.handle_errors(result).model_dump())
1 change: 1 addition & 0 deletions api/python/tests/test_admin_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ def test_sso_config_get(data, result):
"data,result",
[
(SSO_CONFIG, admin.SSOConfig(**_as_dataclass_kwargs(SSO_CONFIG))),
(None, None),
*MUTATION_ERRORS,
],
)
Expand Down
2 changes: 1 addition & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Entries inside each section should be ordered by type:
# unreleased - YYYY-MM-DD
## Python API

* [Added] New `quilt3.admin.sso_config` sub-module for management of SSO configuration ([#4065](https://github.com/quiltdata/quilt/pull/4065))
* [Added] New `quilt3.admin.sso_config` sub-module for management of SSO configuration ([#4065](https://github.com/quiltdata/quilt/pull/4065), [#4098](https://github.com/quiltdata/quilt/pull/4098))

## CLI

Expand Down
4 changes: 2 additions & 2 deletions docs/api-reference/Admin.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ __Arguments__
Get the current SSO configuration.


## set(config: Optional[str]) -> quilt3.admin.types.SSOConfig {#set}
## set(config: Optional[str]) -> Optional[quilt3.admin.types.SSOConfig] {#set}

Set the SSO configuration.
Set the SSO configuration. Pass `None` to remove SSO configuration.

2 changes: 1 addition & 1 deletion shared/graphql/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,7 @@ union SetSsoConfigResult = SsoConfig | InvalidInput | OperationError

type AdminMutations {
user: UserAdminMutations!
setSsoConfig(config: String): SetSsoConfigResult!
setSsoConfig(config: String): SetSsoConfigResult
}

type Mutation {
Expand Down