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

Allow and deny list #35

Merged
merged 8 commits into from
May 19, 2022
Merged

Allow and deny list #35

merged 8 commits into from
May 19, 2022

Conversation

uhbrar
Copy link
Collaborator

@uhbrar uhbrar commented Mar 21, 2022

This implements the usage of the allow and deny list as discussed by the Operations and Workflows Working Group.

Currently, this utilizes the SmartAPI title for the service, as discussed during the last working group meeting. Before merging, it should be decided whether this is really the route to take, or whether or not it is more appropriate to use infores identifiers.

operation_services = []
runner_parameters = operation.pop("runner_parameters", {})
if "allowlist" in runner_parameters.keys():
for service in SERVICES[operation["id"]]:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need a safety check here that operation["id"] is present in SERVICES. #36

if service["id"] in runner_parameters["allowlist"]:
operation_services.append(service)
else:
for service in SERVICES[operation["id"]]:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

service_operation_responses = []
for service in SERVICES[operation["id"]]:
for service in operation_services:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should have a check prior to this line that we actually have any operation_services. If we don't we should send something helpful. See #36

@@ -7,9 +7,9 @@ httpcore==0.13.7
httpx==0.18.1
idna==3.3
pydantic==1.9.0
reasoner-pydantic==2.1.0
reasoner-pydantic==2.2.1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A new version of reasoner-pydantic will be out very soon. We might want to wait to merge this until after upgrading.

@@ -1,4 +1,4 @@
fastapi==0.63.0
httpx==0.18.1
reasoner-pydantic==2.1.0
reasoner-pydantic==2.2.1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait for new version. See above.

@uhbrar
Copy link
Collaborator Author

uhbrar commented May 19, 2022

I think it would be best to address these issues in a separate branch, for tracking purposes. This pull request is an enhancement. I plan on creating a separate pull request to handle bug fixes.

@kennethmorton
Copy link
Collaborator

Fair enough.

@kennethmorton kennethmorton merged commit 34bdf22 into main May 19, 2022
@kennethmorton kennethmorton deleted the allow_and_deny_list branch May 19, 2022 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants