72 Commits

Author SHA1 Message Date
leigh-mil
06a36f23bc Raise error when a user attempts to update a disabled env role 2019-11-12 17:02:57 -05:00
leigh-mil
e8f21acf5b PR fixes 2019-11-12 16:59:22 -05:00
leigh-mil
d33fcb6073 Fix issues with deleting roles:
1. Prevents roles from being created with the role 'None'
2. Only call EnvironmentRoles.delete() if the env_role exists
3. Update the filter on the role field of the app member form to return
'No Access'. This fixed an issue where if a role was deleted, then other
env roles belonging to the app member could not be updated because the
role field of the deleted env_role was invalid
2019-11-12 16:54:46 -05:00
leigh-mil
d40c11a8f6 Change how env_roles are updated
This change makes it so that when an env_role is updated to be None, the
role property on the env_role is changed to be None in addition to being
marked as deleted. This also adds in a check so that previously deleted
env_roles cannot be reassigned a role.
2019-11-12 16:54:46 -05:00
richard-dds
6ea17bb4f8 Merge create_environment and create_environment_baseline 2019-10-28 13:39:40 -04:00
richard-dds
6c7667b7fc Filter out deleted envs in dispatch_create_environment 2019-09-19 14:24:39 -04:00
dandds
3a23c54723 Add a beat processing schedule for environment provisioning jobs.
The beat schedule is set to once per minute for each of the three
environment provisioning tasks.

Adding a beat schedule surfaced two problems that are addressed here
with the following changes:
- Commit the SQLALchemy session in order to release the environment
  lock. Otherwise the change to the `claimed_until` field is not
  persisted.
- Set `none_as_null` on the JSOB fields on the `Environment`. This
  avoids problems with querying on Postgres JSON fields that are empty.

This also adds a small change to the development command for the Celery
worker. Multiple child processes were executing the beat jobs, which
lead to exceptions for environment locks and confusing log output. This
contrains the dev command to a single Celery worker.
2019-09-18 16:34:56 -04:00
richard-dds
ade7dc08fd Only fetch environment_id in provisioning queries 2019-09-17 15:27:03 -04:00
richard-dds
53e993ea34 Filter out claimed environments 2019-09-17 11:54:18 -04:00
richard-dds
030d67719b Remove unused imports 2019-09-16 16:52:54 -04:00
richard-dds
2bbe974755 Implement simple locking system for environments 2019-09-16 16:39:37 -04:00
richard-dds
79c8e4fc63
Merge pull request #1062 from dod-ccpo/env-provisioning-task
Environment provisioning background jobs
2019-09-16 09:58:18 -04:00
leigh-mil
ddcd91964f Remove route 'applications.update_env_roles' and related functions and tests 2019-09-11 15:29:09 -04:00
richard-dds
1a9c34d856 Fix and test environment dispatch tasks 2019-09-11 11:43:06 -04:00
richard-dds
f6cb6f2a31 Change Environment.creator relation from ApplicationRole to User 2019-09-11 11:42:59 -04:00
richard-dds
c00f13de2c Add query for getting environments pending baseline creation 2019-09-11 11:41:10 -04:00
richard-dds
13861ad998 Add query for getting environments pending atat user creation 2019-09-11 11:41:10 -04:00
richard-dds
e3ea2d2fe5 Move "envs pending creation" query to Environments domain 2019-09-11 11:41:10 -04:00
tomdds
1fe9399f99 Update CloudProviderInterface for provision job consumption 2019-08-29 14:06:18 -04:00
George Drummond
37a1ab14b0
Remove Environments.add_member 2019-06-13 15:20:21 -04:00
dandds
df06d1b62f Use application_role_id on environment_roles.
In the future, an `application_invitation1 will not refer to a `user` until
someone accepts the invitation; they'll only reference an
`application_role`. When a user is invited to an application, the
inviter can specify the environments the invitee should have access to.
For this to be possible, an `environment_role` should reference an
`application_role`, because no `user` entity will be known at that time.

In addition to updating all the models and domain methods necessary for
this change, this commit deletes unused code and tests that were
dependent on `environment_roles` having a `user_id` foreign key.
2019-05-31 11:21:20 -04:00
dandds
43ea922218 Simplify environment role updates in app settings.
Use ApplicationRole.id instead of User.id in forms. This eliminates the
need for the function that checks whether a user is in a given
application, because looking up the application role will raise an error
if the user is not.
2019-05-24 13:35:00 -04:00
dandds
129f5e3031 Rewrite function that builds form data for app environment roles form.
- Adds a property to ApplicationRole model so that it knows its related
  EnvironmentRole models.
- Rewrite the form data builder in the routes file so that it loops the
  application members and their environment roles to build the data
  structure.
2019-05-24 13:34:53 -04:00
leigh-mil
546e04555d Update role div height
Move serialization into the route
change member.role to member.role_name in form and route
Return 400 for invalid form submission
2019-05-14 11:00:14 -04:00
George Drummond
fd84e902e3 Use is rather than == 2019-05-14 11:00:14 -04:00
leigh-mil
319cc17c1c Start vue component for edit-environment-role 2019-05-14 10:58:22 -04:00
leigh-mil
addf2e97a1 Update form to nest all envs in one form 2019-05-14 10:58:22 -04:00
leigh-mil
060c6834bf Add save button and temp member role toggle to env member form 2019-05-14 10:58:22 -04:00
George Drummond
079672c818
Update application environments 2019-04-29 10:46:21 -04:00
leigh-mil
1f7b5469de remove unnecessary if statement 2019-04-25 10:47:39 -04:00
leigh-mil
5e415edaef Update form to handle No access 2019-04-25 10:47:39 -04:00
leigh-mil
c085f27af8 Update env roles by environment 2019-04-25 10:47:39 -04:00
dandds
e4c50da363 push environment deletion info to CSP 2019-04-15 16:03:32 -04:00
dandds
0bde431a70 extend soft delete functionality to app and env roles 2019-04-15 15:58:38 -04:00
dandds
b58aef2c6b domain methods for deleting apps and environments 2019-04-15 15:58:38 -04:00
dandds
1c0c5dd9c5 soft deletes available for applications and environments
- parent relation will not include applications or environments marked
  as deleted
- domain classes will exclude deleted objects from selections
- changed some test factories to use domain_word for resource names,
  because they were using person names and it bugged me
2019-04-15 15:58:38 -04:00
dandds
4a0dd2d432 remove unused domain methods and arguments 2019-03-22 06:31:20 -04:00
dandds
0ea21fbb9b remove access checks from domain methods 2019-03-22 06:30:02 -04:00
dandds
44a4d98978 switch portfolio authorization to rely on new permission sets 2019-03-15 07:14:49 -04:00
dandds
48954ded11 update foreign key names; workspace_id -> portfolio_id, project_id -> application_id 2019-01-14 16:00:17 -05:00
dandds
d3d36822df workspace -> portfolio everywhere 2019-01-14 16:00:17 -05:00
dandds
3fc323d785 project -> application everywhere 2019-01-14 16:00:17 -05:00
Patrick Smith
87a7dede6c Resurrect erroneously removed session commit 2019-01-08 16:34:27 -05:00
Patrick Smith
0798ce4019 Add hook to CSP when creating environment role 2019-01-07 17:30:34 -05:00
Patrick Smith
334babe5ff Hook into cloud provider when creating an env/app 2019-01-07 17:30:34 -05:00
dandds
a5009ec130 do not commit environment role updates unless an update happened 2018-12-12 13:09:48 -05:00
dandds
8754a74613 environment role deletion method should also return a bool 2018-12-12 13:01:26 -05:00
dandds
a75c19188f display message for successfully updating environment role / access 2018-12-12 11:39:58 -05:00
richard-dds
54aa10275f Check workspace permission, not ATAT permission 2018-11-29 10:37:20 -05:00
richard-dds
218ec5d66a Implement Environments.revoke_access 2018-11-29 10:37:20 -05:00