forked from galaxyproject/galaxy
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request galaxyproject#9801 from VJalili/azure_authz
Make AuthN attribute optional for Azure and GCP.
- Loading branch information
Showing
5 changed files
with
55 additions
and
22 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
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
Empty file.
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,40 @@ | ||
""" | ||
You may run this test using the following command: | ||
./run_tests.sh test/integration/cloudauthz/test_cloudauthz.py:DefineCloudAuthzTestCase.test_post_cloudauthz_without_authn -s | ||
""" | ||
|
||
import json | ||
|
||
from galaxy_test.driver import integration_util | ||
|
||
|
||
class DefineCloudAuthzTestCase(integration_util.IntegrationTestCase): | ||
framework_tool_and_types = True | ||
|
||
def test_post_cloudauthz_without_authn(self): | ||
""" | ||
This test asserts if a cloudauthz object | ||
can be successfully posted to the cloudauthz API | ||
(i.e., api/cloud/authz). | ||
""" | ||
provider = "azure" | ||
tenant_id = "abc" | ||
client_id = "def" | ||
client_secret = "ghi" | ||
with self._different_user("[email protected]"): | ||
|
||
# The payload for the POST API. | ||
payload = { | ||
"provider": provider, | ||
"config": json.dumps({ | ||
"tenant_id": tenant_id, | ||
"client_id": client_id, | ||
"client_secret": client_secret | ||
}) | ||
} | ||
|
||
response = self._post(path="cloud/authz", data=payload) | ||
response.raise_for_status() | ||
cloudauthz = response.json() | ||
|
||
assert cloudauthz["provider"] == provider |