-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into marrobi/issue3761
- Loading branch information
Showing
17 changed files
with
151 additions
and
107 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "0.15.19" | ||
__version__ = "0.15.20" |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import pytest | ||
from mock import patch | ||
from mock import call, patch | ||
|
||
from models.domain.authentication import User, RoleAssignment | ||
from models.domain.workspace import Workspace, WorkspaceRole | ||
|
@@ -554,6 +554,66 @@ def test_get_workspace_role_assignment_details_with_groups_and_users_assigned_re | |
assert "[email protected]" in role_assignment_details["WorkspaceOwner"] | ||
|
||
|
||
@patch("services.aad_authentication.AzureADAuthorization._get_auth_header") | ||
@patch("services.aad_authentication.AzureADAuthorization._get_batch_users_by_role_assignments_body") | ||
@patch("requests.post") | ||
def test_get_user_emails_with_batch_of_more_than_20_requests(mock_graph_post, mock_get_batch_users_by_role_assignments_body, mock_headers): | ||
# Arrange | ||
access_service = AzureADAuthorization() | ||
roles_graph_data = [{"id": "role1"}, {"id": "role2"}] | ||
msgraph_token = "token" | ||
batch_endpoint = access_service._get_batch_endpoint() | ||
|
||
# mock the response of _get_auth_header | ||
headers = {"Authorization": f"Bearer {msgraph_token}"} | ||
mock_headers.return_value = headers | ||
headers["Content-type"] = "application/json" | ||
|
||
# mock the response of the get batch request for 30 users | ||
batch_request_body_first_20 = { | ||
"requests": [ | ||
{"id": f"{i}", "method": "GET", "url": f"/users/{i}"} for i in range(20) | ||
] | ||
} | ||
|
||
batch_request_body_last_10 = { | ||
"requests": [ | ||
{"id": f"{i}", "method": "GET", "url": f"/users/{i}"} for i in range(20, 30) | ||
] | ||
} | ||
|
||
batch_request_body = { | ||
"requests": [ | ||
{"id": f"{i}", "method": "GET", "url": f"/users/{i}"} for i in range(30) | ||
] | ||
} | ||
|
||
mock_get_batch_users_by_role_assignments_body.return_value = batch_request_body | ||
|
||
# Mock the response of the post request | ||
mock_graph_post_response = {"responses": [{"id": "user1"}, {"id": "user2"}]} | ||
mock_graph_post.return_value.json.return_value = mock_graph_post_response | ||
|
||
# Act | ||
users_graph_data = access_service._get_user_emails(roles_graph_data, msgraph_token) | ||
|
||
# Assert | ||
assert len(users_graph_data["responses"]) == 4 | ||
calls = [ | ||
call( | ||
f"{batch_endpoint}", | ||
json=batch_request_body_first_20, | ||
headers=headers | ||
), | ||
call( | ||
f"{batch_endpoint}", | ||
json=batch_request_body_last_10, | ||
headers=headers | ||
) | ||
] | ||
mock_graph_post.assert_has_calls(calls, any_order=True) | ||
|
||
|
||
def get_mock_batch_response(user_principals, group_principals): | ||
response_body = {"responses": []} | ||
for user_principal in user_principals: | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Airlock Troubleshooting | ||
|
||
## Users cannot create Review VMs | ||
|
||
If a user sees an error when creating Review VMs, this most likely means that the configuration isn't correct. | ||
Double-check that all GUIDs don't have any symbols missing, and the names of templates are correct. | ||
|
||
[![Review VM Error](../assets/using-review-vm-errors.png)](../assets/using-review-vm-errors.png) | ||
|
||
|
||
## Files do not appear in Review Data folder on the VM | ||
|
||
If the Review Data folder is empty, it's likely because the review VM can't connect to the storage account. Import requests must be reviewed using a VM inside the workspace, and export requests must be reviewed using a VM outside the workspace. | ||
|
||
For imports ensure that the `airlock-import-review` workspace template is being used and configured in the airlock configuration for the workspace. | ||
|
||
|
||
## Airlock request does not move through the workflow as expected | ||
|
||
If the Airlock request does not move through the workflow as expected, it's likely an issue with the Azure Function that processes airlock requests. This function is deployed as part of the TRE, and can be found in the Azure Portal under the name `func-airlock-processor-<tre_id>`. | ||
|
||
To troubleshoot, view the function invocations starting with the StatusChangedQueue Trigger, then the other functions as shown in the image below: | ||
|
||
[![Function details](../assets/airlock_functions.png)](../assets/airlock_functions.png) | ||
|
||
Look for errors in the function invocations in the same time frame that the airlock request was created. Even if the function executed successfully, there may still be errors within the function invocation details. Invocations that take longer can also be a sign of an issue. For example: | ||
|
||
[![Functions error](../assets/airlock_functions_error.png)](../assets/airlock_functions_error.png) | ||
|
||
If this error should have been handled please create an issue on the GitHub repository for the Azure TRE. |
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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