-
Notifications
You must be signed in to change notification settings - Fork 47
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
add high-assurance placeholder option to endpoint configuration #1720
Open
LeiGlobus
wants to merge
1
commit into
main
Choose a base branch
from
ha-endpoints-sc-35308
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,6 +44,7 @@ def inner(cls, model: t.Optional[BaseModel]): | |
|
||
class BaseConfigModel(BaseModel): | ||
multi_user: t.Optional[bool] | ||
high_assurance: t.Optional[bool] | ||
Comment on lines
45
to
+47
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, need to rebase on |
||
display_name: t.Optional[str] | ||
allowed_functions: t.Optional[t.List[uuid.UUID]] | ||
authentication_policy: t.Optional[uuid.UUID] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,24 +60,33 @@ def test_double_configure(self): | |
with pytest.raises(Exception, match="ConfigExists"): | ||
manager.configure_endpoint(config_dir, None) | ||
|
||
@pytest.mark.parametrize("ha", [None, True, False]) | ||
@pytest.mark.parametrize("mu", [None, True, False]) | ||
def test_configure_multi_user_existing_config(self, mu): | ||
def test_configure_multi_user_ha_existing_config(self, ha, mu): | ||
manager = Endpoint() | ||
config_dir = pathlib.Path("/some/path/mock_endpoint") | ||
config_file = Endpoint._config_file_path(config_dir) | ||
config_copy = str(config_dir.parent / "config2.yaml") | ||
|
||
# First, make an entry with multi_user | ||
manager.configure_endpoint(config_dir, None, multi_user=True) | ||
# First, make an entry with multi_user/ha | ||
manager.configure_endpoint( | ||
config_dir, None, multi_user=True, high_assurance=False | ||
) | ||
shutil.move(config_file, config_copy) | ||
shutil.rmtree(config_dir) | ||
|
||
# Then, modify it with new setting | ||
manager.configure_endpoint(config_dir, config_copy, multi_user=mu) | ||
# Then, modify it with new settings | ||
manager.configure_endpoint( | ||
config_dir, config_copy, multi_user=mu, high_assurance=ha | ||
) | ||
|
||
with open(config_file) as f: | ||
config_dict = yaml.safe_load(f) | ||
assert "multi_user" in config_dict | ||
if ha is True: | ||
assert "high_assurance" in config_dict | ||
else: | ||
assert "high_assurance" not in config_dict | ||
Comment on lines
+86
to
+89
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This can be reduced to: assert ("high_assurance" in config_dict) is (ha is True) |
||
|
||
os.remove(config_copy) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it defaults to False, per
config.py
, why include this at all in thedefault_config.py
? Especially since this is yet a hidden feature (per "in-development!") givencli.py
?