aplos-nca-saas-sdk 0.0.2__tar.gz → 0.0.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. {aplos_nca_saas_sdk-0.0.2 → aplos_nca_saas_sdk-0.0.4}/.vscode/settings.json +1 -2
  2. aplos_nca_saas_sdk-0.0.4/PKG-INFO +92 -0
  3. aplos_nca_saas_sdk-0.0.4/README.md +66 -0
  4. {aplos_nca_saas_sdk-0.0.2 → aplos_nca_saas_sdk-0.0.4}/devops/pypi/build.py +3 -3
  5. {aplos_nca_saas_sdk-0.0.2 → aplos_nca_saas_sdk-0.0.4}/pyproject.toml +22 -3
  6. aplos_nca_saas_sdk-0.0.4/readme.md +66 -0
  7. {aplos_nca_saas_sdk-0.0.2 → aplos_nca_saas_sdk-0.0.4}/requirements.txt +2 -0
  8. {aplos_nca_saas_sdk-0.0.2 → aplos_nca_saas_sdk-0.0.4}/src/aplos_nca_saas_sdk/aws_resources/aws_cognito.py +7 -5
  9. aplos_nca_saas_sdk-0.0.4/src/aplos_nca_saas_sdk/integration_testing/configs/_config_base.py +13 -0
  10. aplos_nca_saas_sdk-0.0.4/src/aplos_nca_saas_sdk/integration_testing/configs/app_settings.py +60 -0
  11. aplos_nca_saas_sdk-0.0.4/src/aplos_nca_saas_sdk/integration_testing/configs/config_sample.json +105 -0
  12. aplos_nca_saas_sdk-0.0.4/src/aplos_nca_saas_sdk/integration_testing/configs/login.py +105 -0
  13. aplos_nca_saas_sdk-0.0.4/src/aplos_nca_saas_sdk/integration_testing/integration_test_base.py +70 -0
  14. aplos_nca_saas_sdk-0.0.4/src/aplos_nca_saas_sdk/integration_testing/integration_test_configurations.py +38 -0
  15. aplos_nca_saas_sdk-0.0.4/src/aplos_nca_saas_sdk/integration_testing/integration_test_response.py +28 -0
  16. aplos_nca_saas_sdk-0.0.4/src/aplos_nca_saas_sdk/integration_testing/integration_test_suite.py +98 -0
  17. aplos_nca_saas_sdk-0.0.4/src/aplos_nca_saas_sdk/integration_testing/main.py +61 -0
  18. aplos_nca_saas_sdk-0.0.4/src/aplos_nca_saas_sdk/integration_testing/tests/app_configuration_test.py +43 -0
  19. aplos_nca_saas_sdk-0.0.4/src/aplos_nca_saas_sdk/integration_testing/tests/app_login_test.py +48 -0
  20. {aplos_nca_saas_sdk-0.0.2 → aplos_nca_saas_sdk-0.0.4}/src/aplos_nca_saas_sdk/nca_resources/nca_executions.py +3 -0
  21. {aplos_nca_saas_sdk-0.0.2 → aplos_nca_saas_sdk-0.0.4}/src/aplos_nca_saas_sdk/nca_resources/nca_login.py +1 -1
  22. {aplos_nca_saas_sdk-0.0.2 → aplos_nca_saas_sdk-0.0.4}/src/aplos_nca_saas_sdk/utilities/environment_vars.py +2 -2
  23. {aplos_nca_saas_sdk-0.0.2 → aplos_nca_saas_sdk-0.0.4}/src/aplos_nca_saas_sdk/version.py +1 -1
  24. aplos_nca_saas_sdk-0.0.2/PKG-INFO +0 -57
  25. aplos_nca_saas_sdk-0.0.2/README.md +0 -33
  26. aplos_nca_saas_sdk-0.0.2/devops/code_artifacts/check_and_setup.py +0 -44
  27. aplos_nca_saas_sdk-0.0.2/devops/code_artifacts/environment_vars.py +0 -36
  28. aplos_nca_saas_sdk-0.0.2/devops/code_artifacts/local_test_support.py +0 -68
  29. aplos_nca_saas_sdk-0.0.2/devops/code_artifacts/main.py +0 -224
  30. aplos_nca_saas_sdk-0.0.2/devops/code_artifacts/pip_code_artifact_setup.py +0 -66
  31. aplos_nca_saas_sdk-0.0.2/readme.md +0 -33
  32. aplos_nca_saas_sdk-0.0.2/src/aplos_nca_saas_sdk/integration_testing/integration_test_base.py +0 -34
  33. aplos_nca_saas_sdk-0.0.2/src/aplos_nca_saas_sdk/integration_testing/integration_test_suite.py +0 -84
  34. aplos_nca_saas_sdk-0.0.2/src/aplos_nca_saas_sdk/integration_testing/main.py +0 -28
  35. aplos_nca_saas_sdk-0.0.2/src/aplos_nca_saas_sdk/integration_testing/tests/app_configuration_test.py +0 -30
  36. aplos_nca_saas_sdk-0.0.2/src/aplos_nca_saas_sdk/integration_testing/tests/app_login_test.py +0 -32
  37. {aplos_nca_saas_sdk-0.0.2 → aplos_nca_saas_sdk-0.0.4}/.gitignore +0 -0
  38. {aplos_nca_saas_sdk-0.0.2 → aplos_nca_saas_sdk-0.0.4}/.pypirc +0 -0
  39. {aplos_nca_saas_sdk-0.0.2 → aplos_nca_saas_sdk-0.0.4}/.vscode/launch.json +0 -0
  40. {aplos_nca_saas_sdk-0.0.2 → aplos_nca_saas_sdk-0.0.4}/LICENSE +0 -0
  41. {aplos_nca_saas_sdk-0.0.2 → aplos_nca_saas_sdk-0.0.4}/devops/pypi/readme.md +0 -0
  42. {aplos_nca_saas_sdk-0.0.2 → aplos_nca_saas_sdk-0.0.4}/devops/requirements.txt +0 -0
  43. {aplos_nca_saas_sdk-0.0.2 → aplos_nca_saas_sdk-0.0.4}/docs/images/API_Configuration_blur.png +0 -0
  44. {aplos_nca_saas_sdk-0.0.2 → aplos_nca_saas_sdk-0.0.4}/docs/images/aplos-nca-commandline-cropped.png +0 -0
  45. {aplos_nca_saas_sdk-0.0.2 → aplos_nca_saas_sdk-0.0.4}/docs/images/aplos-nca-commandline.png +0 -0
  46. {aplos_nca_saas_sdk-0.0.2 → aplos_nca_saas_sdk-0.0.4}/mypy.ini +0 -0
  47. {aplos_nca_saas_sdk-0.0.2 → aplos_nca_saas_sdk-0.0.4}/mypy_checks.py +0 -0
  48. {aplos_nca_saas_sdk-0.0.2 → aplos_nca_saas_sdk-0.0.4}/run-checks.sh +0 -0
  49. {aplos_nca_saas_sdk-0.0.2 → aplos_nca_saas_sdk-0.0.4}/src/aplos_nca_saas_sdk/__init__.py +0 -0
  50. {aplos_nca_saas_sdk-0.0.2 → aplos_nca_saas_sdk-0.0.4}/src/aplos_nca_saas_sdk/aws_resources/aws_s3_presigned_payload.py +0 -0
  51. {aplos_nca_saas_sdk-0.0.2 → aplos_nca_saas_sdk-0.0.4}/src/aplos_nca_saas_sdk/aws_resources/aws_s3_presigned_upload.py +0 -0
  52. {aplos_nca_saas_sdk-0.0.2 → aplos_nca_saas_sdk-0.0.4}/src/aplos_nca_saas_sdk/files/analysis_files/single_ev/configuration_single_ev.json +0 -0
  53. {aplos_nca_saas_sdk-0.0.2 → aplos_nca_saas_sdk-0.0.4}/src/aplos_nca_saas_sdk/files/analysis_files/single_ev/meta_data.json +0 -0
  54. {aplos_nca_saas_sdk-0.0.2 → aplos_nca_saas_sdk-0.0.4}/src/aplos_nca_saas_sdk/files/analysis_files/single_ev/single_ev.csv +0 -0
  55. {aplos_nca_saas_sdk-0.0.2 → aplos_nca_saas_sdk-0.0.4}/src/aplos_nca_saas_sdk/integration_testing/integration_test_factory.py +0 -0
  56. {aplos_nca_saas_sdk-0.0.2 → aplos_nca_saas_sdk-0.0.4}/src/aplos_nca_saas_sdk/integration_testing/readme.md +0 -0
  57. {aplos_nca_saas_sdk-0.0.2 → aplos_nca_saas_sdk-0.0.4}/src/aplos_nca_saas_sdk/integration_testing/tests/app_execution_test.py +0 -0
  58. {aplos_nca_saas_sdk-0.0.2 → aplos_nca_saas_sdk-0.0.4}/src/aplos_nca_saas_sdk/integration_testing/tests/app_validation_test.py +0 -0
  59. {aplos_nca_saas_sdk-0.0.2 → aplos_nca_saas_sdk-0.0.4}/src/aplos_nca_saas_sdk/nca_resources/nca_app_configuration.py +0 -0
  60. {aplos_nca_saas_sdk-0.0.2 → aplos_nca_saas_sdk-0.0.4}/src/aplos_nca_saas_sdk/nca_resources/nca_endpoints.py +0 -0
  61. {aplos_nca_saas_sdk-0.0.2 → aplos_nca_saas_sdk-0.0.4}/src/aplos_nca_saas_sdk/utilities/commandline_args.py +0 -0
  62. {aplos_nca_saas_sdk-0.0.2 → aplos_nca_saas_sdk-0.0.4}/src/aplos_nca_saas_sdk/utilities/environment_services.py +0 -0
  63. {aplos_nca_saas_sdk-0.0.2 → aplos_nca_saas_sdk-0.0.4}/src/aplos_nca_saas_sdk/utilities/http_utility.py +0 -0
  64. {aplos_nca_saas_sdk-0.0.2 → aplos_nca_saas_sdk-0.0.4}/tests/__init__.py +0 -0
@@ -11,8 +11,7 @@
11
11
  ],
12
12
  "python.testing.cwd": "${workspaceFolder}",
13
13
  "python.analysis.extraPaths": [
14
- "${workspaceFolder}/src",
15
- "${workspaceFolder}/src/aplos_nca_saas_sdk",
14
+ "${workspaceFolder}/src",
16
15
  "${workspaceFolder}/tests",
17
16
  "${workspaceFolder}/devops",
18
17
  "${workspaceFolder}/devops/cdk",
@@ -0,0 +1,92 @@
1
+ Metadata-Version: 2.3
2
+ Name: aplos_nca_saas_sdk
3
+ Version: 0.0.4
4
+ Summary: Aplos NCA SaaS SDK
5
+ Project-URL: Homepage, https://aplosanalytics.com/
6
+ Project-URL: Documentation, https://docs.aplosanalytics.com/
7
+ Project-URL: Repository, https://github.com/AplosAnalytics/Aplos-NCA-SaaS-SDK
8
+ Project-URL: Issues, https://github.com/AplosAnalytics/Aplos-NCA-SaaS-SDK/issues
9
+ Author-email: Eric Wilson <eric.wilson@aplosanalytics.com>
10
+ License: MIT License
11
+ Keywords: Bioavailability Studies,Bioequivalence Studies,Clinical Pharmacology,Clinical Trials,Dose-Proportionality Studies,Drug Interaction Studies,NCA,Non-Compartmental Analysis,PK Analysis,PK modeling,Pharma Data Analysis,Pharmacokinetic Analysis,Pharmacokinetics,Pharmacokinetics Software,SaaS
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Topic :: Software Development :: Libraries
18
+ Requires-Python: >=3.10
19
+ Requires-Dist: aws-lambda-powertools>=3.3.0
20
+ Requires-Dist: boto3==1.34.110
21
+ Requires-Dist: mypy-boto3-cognito-idp>=1.35.68
22
+ Requires-Dist: pyjwt==2.9.0
23
+ Requires-Dist: python-dotenv==1.0.1
24
+ Requires-Dist: requests==2.31.0
25
+ Description-Content-Type: text/markdown
26
+
27
+ # Aplos NCA SaaS SDK for python
28
+
29
+ Welcome to the Aplos NCA SaaS SDK for automating your PK Analyis. A secure set of API's to connect to our Cloud System and automate your PK analysis.
30
+
31
+ This SDK works for our
32
+ - Trial Accounts (Multi Tenancy)
33
+ - Academic Accounts (Multi Tenancy)
34
+ - Professional Accounts (Multi Tenancy)
35
+ - Team Accounts (Single Tenancy)
36
+ - Enterprise Accounts (Single Tenancy)
37
+
38
+ ## Use 🐍 python to perform an NCA Analysis with the Aplos NCA SaaS Solution.
39
+ If you can make HTTPS 🔐 request 🛜 - you can automation your PK Analysis Workflow Systems.
40
+
41
+ ## 👉 We use this for our demos 🚀🚀 👈
42
+ > We'll keep this maintained as we use it for our customer demo as well as Integration Testings.
43
+ > So keep coming back for new features.
44
+ >
45
+ > If you're not sure how to get started, kick off the Integration Test Suite, set some break points
46
+ > and you'll see a wide range of example use cases.
47
+
48
+ ## API Settings 🛑 A valid Aplos NCA Account is required. 🛑
49
+
50
+
51
+ > In order to run the executions and connect to our system, you will need a valid account with an active subscription (reach out for a trial subscription if you are evaluating our solutions).
52
+ >
53
+ > You'll need your username (email address and a password), a Cognito Client Id
54
+ > which allows the USER_PASSWORD_AUTH flow, and your API URL.
55
+ >
56
+ > Technically if you have your API Domain (from your account), you can use this to query for your Cognito Client Id
57
+ >
58
+ > Otherwise, the Client Id (aka Cognito Client Key) and API URL can be found in your user account.
59
+ >
60
+ > Your username is your email address and your password would have been provided to you during your
61
+ > onboarding or with a "forgot password" request and reset.
62
+
63
+
64
+ ## API
65
+ You can use the API to integrate the Aplos NCA SaaS Cloud Solution into your workflow.
66
+ You can perform:
67
+ - Logins
68
+ - File Uploads
69
+ - PK Analysis Executions
70
+ - PK Analysis Results
71
+ - File Downloads
72
+ - PK Validations (run validations against our calculations engine)
73
+ - Tenant & User Management (for Team & Enterprise Accounts)
74
+ - and more...
75
+
76
+
77
+ ## API Integration Testing
78
+ You can use the integration testing to test your environment. You can also use the Integration Testing modules
79
+ to learn how to use the API.
80
+
81
+ ## Source
82
+ Full source code can also be found on [GitHub](https://github.com/AplosAnalytics/Aplos-NCA-SaaS-SDK)
83
+
84
+ ## Documentation
85
+ [The Docs](https://docs.aplosanalytics.com/)
86
+
87
+ ## Corporate Home Page
88
+ [Aplos Analytics](https://aplosanalytics.com/)
89
+
90
+
91
+
92
+
@@ -0,0 +1,66 @@
1
+ # Aplos NCA SaaS SDK for python
2
+
3
+ Welcome to the Aplos NCA SaaS SDK for automating your PK Analyis. A secure set of API's to connect to our Cloud System and automate your PK analysis.
4
+
5
+ This SDK works for our
6
+ - Trial Accounts (Multi Tenancy)
7
+ - Academic Accounts (Multi Tenancy)
8
+ - Professional Accounts (Multi Tenancy)
9
+ - Team Accounts (Single Tenancy)
10
+ - Enterprise Accounts (Single Tenancy)
11
+
12
+ ## Use 🐍 python to perform an NCA Analysis with the Aplos NCA SaaS Solution.
13
+ If you can make HTTPS 🔐 request 🛜 - you can automation your PK Analysis Workflow Systems.
14
+
15
+ ## 👉 We use this for our demos 🚀🚀 👈
16
+ > We'll keep this maintained as we use it for our customer demo as well as Integration Testings.
17
+ > So keep coming back for new features.
18
+ >
19
+ > If you're not sure how to get started, kick off the Integration Test Suite, set some break points
20
+ > and you'll see a wide range of example use cases.
21
+
22
+ ## API Settings 🛑 A valid Aplos NCA Account is required. 🛑
23
+
24
+
25
+ > In order to run the executions and connect to our system, you will need a valid account with an active subscription (reach out for a trial subscription if you are evaluating our solutions).
26
+ >
27
+ > You'll need your username (email address and a password), a Cognito Client Id
28
+ > which allows the USER_PASSWORD_AUTH flow, and your API URL.
29
+ >
30
+ > Technically if you have your API Domain (from your account), you can use this to query for your Cognito Client Id
31
+ >
32
+ > Otherwise, the Client Id (aka Cognito Client Key) and API URL can be found in your user account.
33
+ >
34
+ > Your username is your email address and your password would have been provided to you during your
35
+ > onboarding or with a "forgot password" request and reset.
36
+
37
+
38
+ ## API
39
+ You can use the API to integrate the Aplos NCA SaaS Cloud Solution into your workflow.
40
+ You can perform:
41
+ - Logins
42
+ - File Uploads
43
+ - PK Analysis Executions
44
+ - PK Analysis Results
45
+ - File Downloads
46
+ - PK Validations (run validations against our calculations engine)
47
+ - Tenant & User Management (for Team & Enterprise Accounts)
48
+ - and more...
49
+
50
+
51
+ ## API Integration Testing
52
+ You can use the integration testing to test your environment. You can also use the Integration Testing modules
53
+ to learn how to use the API.
54
+
55
+ ## Source
56
+ Full source code can also be found on [GitHub](https://github.com/AplosAnalytics/Aplos-NCA-SaaS-SDK)
57
+
58
+ ## Documentation
59
+ [The Docs](https://docs.aplosanalytics.com/)
60
+
61
+ ## Corporate Home Page
62
+ [Aplos Analytics](https://aplosanalytics.com/)
63
+
64
+
65
+
66
+
@@ -4,8 +4,8 @@ import shutil
4
4
  import subprocess
5
5
  from pathlib import Path
6
6
  from typing import List
7
- import toml
8
7
 
8
+ import toml
9
9
  from aws_lambda_powertools import Logger
10
10
 
11
11
  logger = Logger()
@@ -35,8 +35,8 @@ def main():
35
35
 
36
36
  def run_local_clean_up():
37
37
  """run a local clean up and remove older items in the dist directory"""
38
- root = Path(__file__).parent.parent
39
- dist_dir = os.path.join(root, "dist")
38
+ project_root = Path(__file__).parents[2]
39
+ dist_dir = os.path.join(project_root, "dist")
40
40
  if os.path.exists(dist_dir):
41
41
  # clear it out
42
42
  shutil.rmtree(dist_dir)
@@ -8,7 +8,25 @@ packages = ["src/aplos_nca_saas_sdk"]
8
8
  [project]
9
9
  name = "aplos_nca_saas_sdk"
10
10
  source = "src/aplos_nca_saas_sdk"
11
- version = "0.0.2"
11
+ keywords = [
12
+ "PK Analysis",
13
+ "Pharmacokinetics",
14
+ "Non-Compartmental Analysis",
15
+ "NCA",
16
+ "PK modeling",
17
+ "SaaS",
18
+ "Clinical Pharmacology",
19
+ "Bioequivalence Studies",
20
+ "Bioavailability Studies",
21
+ "Dose-Proportionality Studies",
22
+ "Drug Interaction Studies",
23
+ "Pharmacokinetic Analysis",
24
+ "Pharmacokinetics Software",
25
+ "Pharma Data Analysis",
26
+ "Clinical Trials"
27
+ ]
28
+
29
+ version = "0.0.4"
12
30
  authors = [
13
31
  { name="Eric Wilson", email="eric.wilson@aplosanalytics.com" }
14
32
  ]
@@ -28,11 +46,12 @@ classifiers = [
28
46
  ]
29
47
 
30
48
  dependencies = [
31
- "aws-lambda-powertools==2.38.1",
49
+ "aws-lambda-powertools>=3.3.0",
32
50
  "requests==2.31.0",
33
51
  "boto3==1.34.110",
34
52
  "python-dotenv==1.0.1",
35
- "PyJWT==2.9.0"
53
+ "PyJWT==2.9.0",
54
+ "mypy_boto3_cognito_idp>=1.35.68"
36
55
  ]
37
56
 
38
57
  [project.urls]
@@ -0,0 +1,66 @@
1
+ # Aplos NCA SaaS SDK for python
2
+
3
+ Welcome to the Aplos NCA SaaS SDK for automating your PK Analyis. A secure set of API's to connect to our Cloud System and automate your PK analysis.
4
+
5
+ This SDK works for our
6
+ - Trial Accounts (Multi Tenancy)
7
+ - Academic Accounts (Multi Tenancy)
8
+ - Professional Accounts (Multi Tenancy)
9
+ - Team Accounts (Single Tenancy)
10
+ - Enterprise Accounts (Single Tenancy)
11
+
12
+ ## Use 🐍 python to perform an NCA Analysis with the Aplos NCA SaaS Solution.
13
+ If you can make HTTPS 🔐 request 🛜 - you can automation your PK Analysis Workflow Systems.
14
+
15
+ ## 👉 We use this for our demos 🚀🚀 👈
16
+ > We'll keep this maintained as we use it for our customer demo as well as Integration Testings.
17
+ > So keep coming back for new features.
18
+ >
19
+ > If you're not sure how to get started, kick off the Integration Test Suite, set some break points
20
+ > and you'll see a wide range of example use cases.
21
+
22
+ ## API Settings 🛑 A valid Aplos NCA Account is required. 🛑
23
+
24
+
25
+ > In order to run the executions and connect to our system, you will need a valid account with an active subscription (reach out for a trial subscription if you are evaluating our solutions).
26
+ >
27
+ > You'll need your username (email address and a password), a Cognito Client Id
28
+ > which allows the USER_PASSWORD_AUTH flow, and your API URL.
29
+ >
30
+ > Technically if you have your API Domain (from your account), you can use this to query for your Cognito Client Id
31
+ >
32
+ > Otherwise, the Client Id (aka Cognito Client Key) and API URL can be found in your user account.
33
+ >
34
+ > Your username is your email address and your password would have been provided to you during your
35
+ > onboarding or with a "forgot password" request and reset.
36
+
37
+
38
+ ## API
39
+ You can use the API to integrate the Aplos NCA SaaS Cloud Solution into your workflow.
40
+ You can perform:
41
+ - Logins
42
+ - File Uploads
43
+ - PK Analysis Executions
44
+ - PK Analysis Results
45
+ - File Downloads
46
+ - PK Validations (run validations against our calculations engine)
47
+ - Tenant & User Management (for Team & Enterprise Accounts)
48
+ - and more...
49
+
50
+
51
+ ## API Integration Testing
52
+ You can use the integration testing to test your environment. You can also use the Integration Testing modules
53
+ to learn how to use the API.
54
+
55
+ ## Source
56
+ Full source code can also be found on [GitHub](https://github.com/AplosAnalytics/Aplos-NCA-SaaS-SDK)
57
+
58
+ ## Documentation
59
+ [The Docs](https://docs.aplosanalytics.com/)
60
+
61
+ ## Corporate Home Page
62
+ [Aplos Analytics](https://aplosanalytics.com/)
63
+
64
+
65
+
66
+
@@ -3,3 +3,5 @@ boto3
3
3
  python-dotenv # load env values
4
4
  PyJWT # jwt in the imports
5
5
  requests
6
+ boto3-stubs[cognito]
7
+ mypy_boto3_cognito_idp
@@ -4,9 +4,11 @@ All Rights Reserved. www.aplosanalytics.com LICENSED MATERIALS
4
4
  Property of Aplos Analytics, Utah, USA
5
5
  """
6
6
 
7
+ from typing import Optional
8
+
7
9
  import boto3
8
10
  import jwt as jwt_lib
9
- from typing import Optional
11
+ from mypy_boto3_cognito_idp.client import CognitoIdentityProviderClient
10
12
  from aplos_nca_saas_sdk.nca_resources.nca_app_configuration import (
11
13
  NCAAppConfiguration,
12
14
  )
@@ -31,7 +33,7 @@ class CognitoAuthenication:
31
33
  self.__access_token: Optional[str] = None
32
34
  self.__refresh_token: Optional[str] = None
33
35
  self.__region: str = region or "us-east-1"
34
- self.__client: Optional[boto3.client] = None
36
+ self.__client: Optional[CognitoIdentityProviderClient] = None
35
37
  self.__user_id: Optional[str] = None
36
38
  self.__tenant_id: Optional[str] = None
37
39
  self.__config: Optional[NCAAppConfiguration] = None
@@ -40,7 +42,7 @@ class CognitoAuthenication:
40
42
  self.__validate_parameters()
41
43
 
42
44
  @property
43
- def client(self) -> boto3.client:
45
+ def client(self) -> CognitoIdentityProviderClient:
44
46
  """
45
47
  Get the boto3 client
46
48
 
@@ -53,7 +55,7 @@ class CognitoAuthenication:
53
55
  return self.__client
54
56
 
55
57
  @property
56
- def client_id(self) -> str:
58
+ def client_id(self) -> str | None:
57
59
  """
58
60
  Client Id
59
61
  Returns:
@@ -62,7 +64,7 @@ class CognitoAuthenication:
62
64
  return self.__client_id
63
65
 
64
66
  @property
65
- def region(self) -> str:
67
+ def region(self) -> str | None:
66
68
  """
67
69
  Region
68
70
  Returns:
@@ -0,0 +1,13 @@
1
+ from typing import Dict
2
+ from typing import Any
3
+
4
+
5
+ class ConfigBase:
6
+ """Base Configuration Class"""
7
+
8
+ def __init__(self, enabled: bool = True):
9
+ self.enabled: bool = enabled
10
+
11
+ def load(self, test_config: Dict[str, Any]):
12
+ """Load the configuration from a dictionary"""
13
+ self.enabled = test_config.get("enabled", True)
@@ -0,0 +1,60 @@
1
+ """
2
+ Copyright 2024 Aplos Analytics
3
+ All Rights Reserved. www.aplosanalytics.com LICENSED MATERIALS
4
+ Property of Aplos Analytics, Utah, USA
5
+ """
6
+
7
+ from typing import List, Dict, Any
8
+ from aplos_nca_saas_sdk.integration_testing.configs._config_base import ConfigBase
9
+
10
+
11
+ class ApplicationDomain(ConfigBase):
12
+ """
13
+ Application Domain: Defines the domains that the application configuration tests will check against
14
+
15
+ """
16
+
17
+ def __init__(self):
18
+ super().__init__()
19
+ self.__domain: str | None = None
20
+
21
+ @property
22
+ def domain(self) -> str:
23
+ """The domain to validate"""
24
+ if self.__domain is None:
25
+ raise RuntimeError("Domain is not set")
26
+ return self.__domain
27
+
28
+ @domain.setter
29
+ def domains(self, value: str):
30
+ self.__domain = value
31
+
32
+
33
+ class ApplicationSettings:
34
+ """
35
+ Application Settings: Defines the domains that the application settings (configuration endpoint) tests will check against
36
+
37
+ """
38
+
39
+ def __init__(self):
40
+ self.__domains: List[ApplicationDomain] = []
41
+
42
+ @property
43
+ def domains(self) -> List[ApplicationDomain]:
44
+ return self.__domains
45
+
46
+ @domains.setter
47
+ def domains(self, value: List[ApplicationDomain]):
48
+ self.__domains = value
49
+
50
+ def load(self, test_config: Dict[str, Any]):
51
+ """Load the domains from the config"""
52
+ domains: List[Dict[str, Any]] = test_config.get("domains", [])
53
+
54
+ domain: Dict[str, Any]
55
+ for domain in domains:
56
+ app_domain = ApplicationDomain()
57
+ app_domain.domains = domain.get("domain", None)
58
+ app_domain.enabled = bool(domain.get("enabled", True))
59
+
60
+ self.__domains.append(app_domain)
@@ -0,0 +1,105 @@
1
+ {
2
+ "application_config_test": {
3
+ "purpose": "Tests the application configuration endpoints",
4
+ "domains": [
5
+ {
6
+ "domain": "api.example.com",
7
+ "expected_results" : {
8
+ "status_code": 200
9
+ },
10
+ "enabled": true
11
+ },
12
+ {
13
+ "domain": "XXXXXXXXXXXXXXXXXXXXX",
14
+ "expected_results" : {
15
+ "status_code": 403
16
+ },
17
+ "enabled": false
18
+ }
19
+ ]
20
+ },
21
+ "login_test": {
22
+ "purpose": "Tests the login endpoints",
23
+ "logins": [
24
+ {
25
+ "username": "foo",
26
+ "password": "barr",
27
+ "domain": "api.example.com",
28
+ "roles": []
29
+
30
+ },
31
+ {
32
+ "username": "XXXXXXXXXXXXXXXXXXXXX",
33
+ "password": "XXXXXXXXXXXXXXXXXXXXX",
34
+ "domain": "XXXXXXXXXXXXXXXXXXXXX",
35
+ "roles": [
36
+ "XXXXXXXXXXXXXXXXXXXXX"
37
+ ],
38
+ "enabled" : false,
39
+ "expected_results" : {
40
+ "exception": "InvalidCredentialsException"
41
+ }
42
+ }
43
+ ]
44
+ },
45
+ "file_upload_test": {
46
+ "purpose": "Tests the file upload endpoints.",
47
+ "notes": "a file can be on the local drive or pulled from a public https source.",
48
+ "login": {
49
+ "purpose": "optional: if present this login is used, unless a specific login is defined for the test",
50
+ "username": "foo",
51
+ "password": "bar",
52
+ "domain": "api.example.com"
53
+ },
54
+ "files": [
55
+ {
56
+ "file": "XXXXXXXXXXXXXXXXXXXXX",
57
+ "expected_results" : {
58
+ "status_code": 200
59
+ }
60
+ },
61
+ {
62
+ "file": "XXXXXXXXXXXXXXXXXXXXX",
63
+ "login" : {
64
+ "purpose": "optional: if present tests an upload for a specific user",
65
+ "username": "XXXXXXXXXXXXXXXXXXXXX",
66
+ "password": "XXXXXXXXXXXXXXXXXXXXX",
67
+ "domain": "XXXXXXXXXXXXXXXXXXXXX"
68
+ },
69
+ "expected_results" : {
70
+ "status_code": 403
71
+ }
72
+ }
73
+ ]
74
+ },
75
+ "analysis_execution_test": {
76
+ "purpose": "Tests the analysis execution endpoints.",
77
+ "login": {
78
+ "username": "XXXXXXXXXXXXXXXXXXXXX",
79
+ "password": "XXXXXXXXXXXXXXXXXXXXX",
80
+ "domain": "XXXXXXXXXXXXXXXXXXXXX"
81
+ },
82
+ "analyses": [
83
+ {
84
+ "file": "XXXXXXXXXXXXXXXXXXXXX",
85
+ "meta": {},
86
+ "config": {},
87
+ "expected_results" : {
88
+ "status_code": 200
89
+ }
90
+ }
91
+ ]
92
+ },
93
+ "validation_test": {
94
+ "purpose": "Tests the validation execution.",
95
+ "login": {
96
+ "username": "XXXXXXXXXXXXXXXXXXXXX",
97
+ "password": "XXXXXXXXXXXXXXXXXXXXX",
98
+ "domain": "XXXXXXXXXXXXXXXXXXXXX"
99
+ },
100
+ "expected_results": {
101
+ "status_code": 200
102
+ }
103
+ }
104
+
105
+ }
@@ -0,0 +1,105 @@
1
+ """
2
+ Copyright 2024 Aplos Analytics
3
+ All Rights Reserved. www.aplosanalytics.com LICENSED MATERIALS
4
+ Property of Aplos Analytics, Utah, USA
5
+ """
6
+
7
+ from typing import List, Optional, Dict, Any
8
+ from aplos_nca_saas_sdk.integration_testing.configs._config_base import ConfigBase
9
+
10
+
11
+ class Login(ConfigBase):
12
+ """
13
+ Application Login: Defines the login that the application configuration tests will check against
14
+
15
+ """
16
+
17
+ def __init__(
18
+ self,
19
+ username: Optional[str] = None,
20
+ passord: Optional[str] = None,
21
+ domain: Optional[str] = None,
22
+ roles: Optional[List[str]] = None,
23
+ ):
24
+ super().__init__()
25
+ self.__username: Optional[str] = username
26
+ self.__password: Optional[str] = passord
27
+ self.__domain: Optional[str] = domain
28
+ self.__roles: List[str] = roles if roles is not None else []
29
+
30
+ @property
31
+ def username(self) -> str:
32
+ if self.__username is None:
33
+ raise RuntimeError("Username is not set")
34
+ return self.__username
35
+
36
+ @username.setter
37
+ def username(self, value: str):
38
+ self.__username = value
39
+
40
+ @property
41
+ def password(self) -> str:
42
+ if self.__password is None:
43
+ raise RuntimeError("Password is not set")
44
+ return self.__password
45
+
46
+ @password.setter
47
+ def password(self, value: str):
48
+ self.__password = value
49
+
50
+ @property
51
+ def domain(self) -> str:
52
+ if self.__domain is None:
53
+ raise RuntimeError("Domain is not set")
54
+ return self.__domain
55
+
56
+ @domain.setter
57
+ def domain(self, value: str):
58
+ self.__domain = value
59
+
60
+ @property
61
+ def roles(self) -> List[str]:
62
+ """A list of roles to check for"""
63
+ return self.__roles
64
+
65
+ @roles.setter
66
+ def roles(self, value: List[str] | None):
67
+ if value is None:
68
+ value = []
69
+ self.__roles = value
70
+
71
+
72
+ class Logins(ConfigBase):
73
+ """
74
+ Application Logins: Defines the logins that the application configuration tests will check against
75
+
76
+ """
77
+
78
+ def __init__(self):
79
+ super().__init__()
80
+ self.__logins: List[Login] = []
81
+
82
+ @property
83
+ def list(self) -> List[Login]:
84
+ """List the logins"""
85
+ return self.__logins
86
+
87
+ def add(self, *, username: str, password: str, domain: str, enabled: bool = True):
88
+ """Add a loging"""
89
+ login = Login()
90
+ login.username = username
91
+ login.password = password
92
+ login.domain = domain
93
+ login.enabled = enabled
94
+ self.__logins.append(login)
95
+
96
+ def load(self, test_config: Dict[str, Any]):
97
+ """Load the logins from a list of dictionaries"""
98
+ self.enabled = bool(test_config.get("enabled", True))
99
+ logins: List[Dict[str, str]] = test_config.get("logins", [])
100
+ for login in logins:
101
+ self.add(
102
+ username=login["username"],
103
+ password=login["password"],
104
+ domain=login["domain"],
105
+ )