1348 Commits

Author SHA1 Message Date
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
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
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
tomdds
dfee80680d Skip legacy azure csp tests 2020-01-14 16:36:16 -05:00
tomdds
7b2c77298d Fix app name collision errors in portfolio tests 2020-01-14 16:36:16 -05:00
tomdds
d81d953c31 Fix formatting and some typos 2020-01-14 16:36:16 -05:00
Philip Kalinsky
69bd2f43a5 provision portfolio state machine 2020-01-14 16:36:16 -05:00
leigh-mil
11b3120bfd Update filter functions to display properly when users env access has been revoked 2020-01-14 15:43:46 -05:00
leigh-mil
17864cc060 Add migration to change environment_roles role column from string to
enum type.
Fix tests and functions affected by the column type change.
2020-01-14 13:12:29 -05:00
leigh-mil
4d8d1d8ce0
Merge branch 'staging' into portfolio-admin-styling__part-2 2020-01-10 13:27:05 -05:00
leigh-mil
da398bf1ff Add status labels to portfolio managers table.
Update PortfolioRole.display_status() to return same type of data as
ApplicationRole.display_status().
2020-01-10 10:25:55 -05:00
leigh-mil
975d3d243b Delete tests and route associated with old portfolio member perms form 2020-01-10 10:25:55 -05:00
leigh-mil
79b2773852 Portfolio manager invite updates:
- Update the form to use BooleanFields for the permissions and make the
form more similar to the Application Members form
- Use MemberFormTemplate macro in the portfolio settings template
- fix tests affected by the form changes
2020-01-10 10:25:55 -05:00
dandds
1ab0c26365 Log details about user login and logout.
To satisfy security requirements, we need to explicitly track:

- when a user attempts to log in, successful or not
- when a user logs out
- whether or not the user associated with a request is logged in

The first two are satisfied by extra log statements and the last is a
new boolean field on the JSON logs.
2020-01-10 10:20:35 -05:00
leigh-mil
667554dba4 Update styling on portfolio admin page, update portfolio form to include description 2020-01-06 15:55:07 -05:00
leigh-mil
8710028256 Fix factories and seed sample script
Update display of defense component on portfolio settings page
2020-01-06 13:08:57 -05:00
graham-dds
aabedbcac4 Make PoP start and end dates inclusive.
Also removes the clock class.

Makes PoP date ranges inclusive such that a task order with:
-  a start date on or after the current date
and
- an end date on or before the current date
should be considered valid.

This commit also removes the Clock class. This class had two methods as
shortcuts for common uses of pendlum functions. But it wasn't being used
in very many places, and it took up about the same space as

    from pendulum import today()
    ...
    today(tz="UTC").date()

If we want to add this back in, it might be a good idea to extend it for
other time functions we have sprinkled around, like the random date
functions in our tests
2020-01-06 12:29:59 -05:00
graham-dds
490d778743 Better incorporate fixture data into reporting
Before this commit, if a portfolio wasn't present in the spending fixture
data, the reporting screen would be empty -- even if the portfolio had
applications and environments associated with it on the database. Now,
0s appear if an application and / or environment isn't present in the
fixture data.
2020-01-06 12:01:13 -05:00
leigh-mil
cbcac2b142 Rename review route and template to view because it better reflects the purpose of the route and template 2020-01-02 12:45:52 -05:00
dandds
3bfb6c9621 Basic implementation for a policy wrapper.
The implementation here is meant to wrap a library of JSON policy
documents. Policies should be added to directories corresponding to
where they will be defined (portfolio, application, environment).
Functionality for parsing portfolio policy definitions is included. When
the policies need to be defined on a management group, the
AzureCloudProvider can iterate the appropriate tier of the policy
manager and add those definitions.
2019-12-20 10:34:12 -05:00
dandds
b61956080e Initial policies and method for creating policy definition.
This adds some initial example policies:

- One for region restrictions
- One for service restrictions

Note that the MS ARM team has said that region restrictions may be
controlled by ARM, so that policy might prove unnecessary. The
parameters list for the service restrictions is stubbed for now, pending
the full list.

I also added an internal method for adding policy definitions to a
management group. This method is agnostic about what tier of management
group the policy is being defined at. It requires that a dictionary
representing the properties section of a valid Azure JSON policy
definition be passed as an argument.
2019-12-20 10:34:12 -05:00
leigh-mil
ff0abe7dce
Merge branch 'staging' into remove-delete-functionality 2019-12-18 15:20:41 -05:00
leigh-mil
2b884f2c85 Remove route, tests, and template code for deleting a portfolio 2019-12-18 12:22:14 -05:00
leigh-mil
5b55b5800e Remove route, tests, and template code for deleting an application 2019-12-18 12:18:43 -05:00
leigh-mil
d300ccf31b Catch error on update applications route when app name is duplicated within a portfolio 2019-12-18 10:54:18 -05:00
leigh-mil
63a5d9274b Update route to handle error when env names are duplicated 2019-12-18 10:54:17 -05:00
leigh-mil
812caf5d7d Update schema and create/update Environments domain methods to enforce environment name uniqueness within an application context. 2019-12-18 10:54:17 -05:00
leigh-mil
ffbf612290 Update route to catch error when app name uniqueness is violated and display a error message 2019-12-16 14:39:32 -05:00
leigh-mil
22dd5d7b85 Add migration for enforcing uniqueness of an application name within a portfolio and update create/update Applicaiton domain methods. 2019-12-16 14:39:32 -05:00
leigh-mil
78ef47f649 Update TO route helper function to catch error and display flash message when a user tries to save a TO with an existing number.
Update TaskOrderForm so that it converts empty string for number into None, this was causing an issue where new TOs were being saved with an empty string for the number, which violated the unique constraint.
2019-12-13 14:53:58 -05:00
leigh-mil
6446b4fbd0 Raise AlreadyExistsError if a task order is created or updated with a number of an existing task order 2019-12-13 14:53:58 -05:00
graham-dds
07b4238c2b Write tests for multi checkbox input vue component 2019-12-13 13:17:30 -05:00
graham-dds
a097a0ce61 Refactor New Portfolio page according to designs.
New designs call for a streamlined New Portfolio page, with far
fewer input options. This commit refactors that page according to those
designs.

Some of the route functions in this commit refer to a "step 1" of creating
a new Portfolio. Though there is no "step 2" right now, the designs call
for a multistep flow for Portfolio creation process, so this commit sets
the stage for that.
2019-12-13 13:17:30 -05:00
leigh-mil
1550f32b4c
Merge branch 'staging' into to-index-page-redesign_part-3 2019-12-13 13:01:11 -05:00
leigh-mil
2552d4c700 Styling for empty status accordion and update Not signed to Unsigned 2019-12-13 11:49:50 -05:00
dandds
8f94d9e6ec Log any CSP errors that occur when disabling a user.
When one user disables another's environment role in Azure, sometimes an
exception will be raised. Since we catch the exception and display an
error message to the user, we should also log the exception so that the
error is traceable later.
2019-12-13 11:41:18 -05:00
tomdds
8a1ed5b193 Sketch in Management Group integration for Azure
Add mocks and real implementations for creating nested management groups that reflect the Portfolio->Application->Environment->Subscription hierarchy.
2019-12-13 10:53:24 -05:00
leigh-mil
ac8dd662d1 Fake task order's expended funds, default task order start and end date to None, fix how task orders are sorted by status 2019-12-12 09:40:18 -05:00
leigh-mil
e32bad0d30 Display TOs grouped by status 2019-12-12 09:40:18 -05:00
leigh-mil
d3f757c649 Update test_for_user to make variables clearer and add in a test case that should not be included in the list returned.
Use list comprehension in portfolio_applications route to get list of all environments for a user
2019-12-11 10:35:42 -05:00