1389 Commits

Author SHA1 Message Date
leigh-mil
0a7541ef99 Remove unused mock csp routes, templates, and images. Remove unused JEDIhierarchy image 2020-01-30 14:09:12 -05:00
tomdds
6480060b8d
Merge branch 'staging' into azure-admin-provisioning 2020-01-30 11:17:33 -05:00
graham-dds
05ef9131dd
Merge branch 'staging' into safe_redirect 2020-01-30 10:42:33 -05:00
tomdds
33c6e8c68c Merge CSP secret handling implementations and refine updating. 2020-01-29 18:22:21 -05:00
tomdds
0bc0e15134 Merge branch 'staging' into azure-config-values 2020-01-29 16:50:44 -05:00
tomdds
d4dd581b7a Implement principal creation and admin elevation provisioning features. 2020-01-29 16:17:28 -05:00
leigh-mil
f48404215a
Merge branch 'staging' into to-builder-previous-button 2020-01-29 15:09:27 -05:00
graham-dds
82ef8f3574 Add fn to ensure a url matches an app url pattern
In some functions, we redirect a user based on a parameter in a query
string.  This commit adds a function that checks to see if a given url
matches a url pattern of a view function. This will help us ensure that
the url passed  as the next parameter isn't malicious.
2020-01-29 13:24:12 -05:00
dandds
63b5ddbdd4 Merge branch 'staging' into app-env-provisioning 2020-01-29 11:16:55 -05:00
dandds
abd03be806 Store and pull tenant creds from Key Vault.
The tenant ID should be hashed and used as the key for the JSON blob of
relevant creds for any given tenant. Azure CSP interface methods that
need to source creds should call the internal `_source_creds` method,
either with a `tenant_id` or no parameters. That method will source the
creds. If a tenant ID is provided, it will source them from the Key
Vault. If not provided, it will return the default creds for the app
registration in the home tenant.
2020-01-29 10:49:27 -05:00
tomdds
144312863c Draft implementations of remote admin creation and root management group ownership. 2020-01-28 20:14:50 -05:00
tomdds
7bf6b9addc Remove creds from payloads and passthroughs. 2020-01-28 14:12:04 -05:00
dandds
67bfe09bbf
Merge branch 'staging' into alpha-numeric-to-numbers 2020-01-28 11:24:40 -05:00
tomdds
475ceaed7c Source Azure Environment Values from Config
This commit switches a few previously hardcoded values to be parsed from configuration, either from the SDK or current consts.
2020-01-27 16:49:19 -05:00
leigh-mil
99edf3df90 Save valid TO form fields when clicking previous in TO builder 2020-01-27 11:56:09 -05:00
dandds
a10d733fb7 Fix test and LGTM warnings.
- Fixes LGTM warnings for an unused import and equality comparisons to
  None in SQLAlchemy filters.
- Removes part of a unit test asserting that the claimed_until locking
  mechanism works correctly. If I recall correctly, this does not work
  in unit tests because the test takes place inside a transaction, and
  the database provider does evaluate the current time until the
  transaction is written.
2020-01-27 06:27:18 -05:00
dandds
ef8f92b678 Merge branch 'staging' into app-env-provisioning 2020-01-26 18:56:29 -05:00
dandds
37a5218a1d Split and barrel cloud module for merge. 2020-01-26 18:38:02 -05:00
tomdds
5b0a523e92 Use more specific imports for cloud models and exceptions. 2020-01-26 15:52:55 -05:00
tomdds
466a575229 Move portfolio state machine helpers directly to model file to prevent import issues.
Having `get_stage_csp_class` in the csp module meant that any file that interacted with that import path would throw an error in a REPL. This will allow importing of the Azure and Mock providers for interactive dev.
2020-01-26 15:17:53 -05:00
tomdds
d02d47615e First step in breaking out cloud.py
Move cloud.py to a module init. Move policy with it. Update related unit tests. Also adds a patch to state machine test to prevent randomness in mock from failing test.
2020-01-26 14:03:09 -05:00
dandds
8810a59e0a Orchestration for creating app management groups.
This adds:
- A Celery beat task for enqueuing application creation tasks
- A Celery task for creating the application
- Payload and Response dataclasses for creating management groups

It also does some incidental cleanup.
2020-01-26 12:23:33 -05:00
dandds
bfc0692063 Remove multiple job failure tables in favor of one.
We don't know yet how useful the job failue tables will be, and
maintaining multiple failure tables--one for every entity involved in
CSP provisioning--is burdensome. This collapses them all into a single
table that track the entity type (environment, portfolio, etc.) and the
entity ID. That way we can construct queries when needed to find task
results.
2020-01-25 15:50:01 -05:00
dandds
02438dc39b Query for applications that need to be provisioned.
Adds a method to the Applications domain class that can return a list of
UUIDs for applications that are ready to be provisioned. It requires
that:

- the associated portfolio and state machine have a state of COMPLETED
- the application not have been marked deleted
- the application not have an existing cloud_id
- the application does not have an existing claim on it
2020-01-25 14:30:17 -05:00
tomdds
f08d53d7a0 Transition all Cloud Interface Methods to use Dataclasses 2020-01-24 15:42:23 -05:00
tomdds
b9206ed7be Some more LGTM fixes 2020-01-24 13:35:46 -05:00
tomdds
35eea8e31c
Merge branch 'staging' into azure-custom-integration 2020-01-24 11:16:11 -05:00
tomdds
e9d03ec68b Fix some LGTM errors and start sketching in credential update functionality 2020-01-24 11:15:35 -05:00
tomdds
910920af44 Formatting fixes 2020-01-24 11:03:38 -05:00
tomdds
ea040a914e Properly report initial clin information
Includes fixed up state machine test as well as adds some missing dependencies
2020-01-24 11:01:53 -05:00
leigh-mil
b20e2971d7 Update TO number validator to account for dashes and variable character length 2020-01-24 09:18:22 -05:00
leigh-mil
84d0a32694 Update TO form to account for new TO rules: alpha numeric, between 13 and 17 characters, dashes should be stripped, and coerce to uppercase 2020-01-24 09:18:22 -05:00
leigh-mil
31b7e2f589 Create route and domain method for creating a subscription 2020-01-23 16:44:07 -05:00
dandds
944c5d3c9f Forcibly destroy existing session on logout.
To comply with security guidelines, we need to destroy the session when
a user logs out. This means that the session's key in the Redis cache
needs to be deleted. Flask expects to _always_ have a session object. If
the current session object does not exist in the Redis cache, Flask will
reserialize and store it at the end of the request. In order for
session deletion to work, we need to delete the key for the existing
session and then replace the session object with a new, empty one.

This also updates the SessionLimiter class so that the session prefix is
configurable.
2020-01-23 10:31:20 -05:00
597ea32e42 portfolio provision process. add logging, __repr___ method, fix broken tests 2020-01-23 10:14:22 -05:00
leigh-mil
bdc03fb0a2 Remove /help route and templates 2020-01-22 16:53:11 -05:00
leigh-mil
36fe777230 Remove delete environments from app members form 2020-01-22 15:53:40 -05:00
graham-dds
156d733aee Add missing regex and validation for StringFields
This commit adds further validation for StringFields that were missing
it. This mostly amounted to being Regex patters and max lengths.
2020-01-22 15:20:18 -05:00
graham-dds
b3dd32f3f7 Allow Falsey values for IsNumber validator
We should use Required() instead to ensure data is present, if that's the
desired behavior
2020-01-22 15:18:42 -05:00
graham-dds
c460f91045 CLIN data should be submitted with {prefix}-number 2020-01-22 15:18:42 -05:00
tomdds
e5332897f1 Fix formatting 2020-01-22 14:52:06 -05:00
tomdds
1b1a20cf52 Restore implementations for policies and management group creation
These were accidentally stripped out during a rebase.
2020-01-22 14:39:30 -05:00
tomdds
f5e4b603cb Bring naming conventions for methods and classes related to CSP provisioning in line with state machine 2020-01-22 13:39:41 -05:00
tomdds
d646c3c00f Updates from Production Scripts
Made a bunch of tweaks when using these tests to run production scripts for initial setup, this brings over a bunch of those changes
2020-01-22 13:39:41 -05:00
tomdds
b1adaf771d state machine integration wip 2020-01-22 13:39:35 -05:00
leigh-mil
d550b4108e Remove update ppoc route from the blueprint and skip related tests 2020-01-17 10:49:05 -05:00
leigh-mil
4f345b462f Add resend invite form/modal, update routes and tests as necessary. 2020-01-17 10:49:05 -05:00
leigh-mil
56c213285f Add route to update portfolio manager perms, add modal form to update in the UI 2020-01-17 10:49:05 -05:00
leigh-mil
05e7dab673 Delete ppoc related tests 2020-01-17 10:49:05 -05:00
187ee0033e state machine unit tests 2020-01-16 10:32:30 -05:00