46 Commits

Author SHA1 Message Date
leigh-mil
c2814416fb Update atst to atat 2020-03-04 11:51:15 -05:00
graham-dds
00a5a98577 Add Mailer class method to email TOs to MSFT 2020-01-31 13:17:00 -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
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
dandds
9ae20b4a2a JSON logging for Celery workers.
This enables JSON logging for Celery workers if the LOG_JSON conig value
is set. It uses the same JsonFormatter class used by the Flask
applications. That class has been updated in two ways:

- It takes a `source` kwarg to define the log source for the formatter.
- The `msg` attribute of the log record is formatted with any arguments
  that may have been passed. This is necessary for Celery to render task
  type, completion time, etc. into the log output.
2019-11-25 10:13:37 -05:00
dandds
d62027b2e7
Merge pull request #1046 from dod-ccpo/tests-debug
Enable debug mode in tests.
2019-09-03 16:08:42 -04:00
dandds
883947b75f Enable debug mode in tests.
Debug mode allows route integration tests to raise explicit exceptions on
errors, instead of returning error pages. Some portions of the test
suite need to be able to ignore exceptions (the response is not under
test) so they use a separate pytest fixture version of the app and
client that are configured with debug disabled, as it would be in
production.
2019-08-30 15:32:57 -04:00
dandds
d7478e322a Use Celery instead of RQ.
Celery provides a more robust set of queueing options for both tasks and
worker processes. Updates include:
- infrastructure necessary to run Celery, including celery entrypoint
- backgrounded functions are now imported directly from atst.jobs
- update tests as-needed
- update kubernetes worker pod command
2019-08-29 09:33:47 -04:00
George Drummond
9f274a7d1c
Script to find unused translations 2019-06-14 09:59:07 -04:00
dandds
717e996685 Remove unused utilities 2019-06-12 14:54:01 -04:00
dandds
d82fd46a3c Mock out g in logging utils test.
This gives us better test isolation. Previously, we were manually
setting `g.current_user` with a factory instance and not cleaning it up
properly, which could break later tests.
2019-05-28 15:04:03 -04:00
richard-dds
d2392cb3d0 Fix test 2019-05-28 10:45:36 -04:00
richard-dds
8fae9d0956 Tests for session_limiter 2019-05-28 10:45:36 -04:00
richard-dds
32df561c6d
Merge pull request #827 from dod-ccpo/stig-notifications
Create Notification System
2019-05-20 09:51:09 -04:00
George Drummond
b71402955c
Failing tests 2019-05-17 13:25:10 -04:00
richard-dds
d8e75668b0 Log notifications at the time of sending 2019-05-15 14:57:46 -04:00
richard-dds
9ba1def91c Use separate queue method for notifications 2019-05-15 14:57:46 -04:00
richard-dds
97b9d84c38 Select only recipient emails from the db 2019-05-15 14:57:46 -04:00
richard-dds
c03b69b351 More idiomatic initialization of notification_sender 2019-05-15 14:57:46 -04:00
richard-dds
a6c5f484b9 Add NotificationSender, one test 2019-05-15 14:57:46 -04:00
dandds
2d99b5cfc5 Permission-check for templates accounts for all permission levels.
`user_can` function built for Jinja template contexts should check
application, portfolio, and atat level permissions depending on what
resources are available on `g`.
2019-05-08 13:25:38 -04:00
dandds
42b912d4cb Look up major database resources in a before_request hook.
A `before_request` hook queries the database for portfolios, requests,
and task orders based on the route arguments. The resources are added as
attributes on `g`. The portfolio context processor and the access
decorator now rely on those resources being available on `g`.

WIP: find major resources in before_request hook, apply to g

WIP: use g.portfolio for portfolio context processor

WIP: the access decorator should rely on the resources being available on g
2019-05-06 16:32:55 -04:00
dandds
5d05c146d6 context filter for adding additional data to logs 2019-03-29 15:47:44 -04:00
dandds
34149de04d basic json log formatter 2019-03-29 14:05:26 -04:00
George Drummond
5572452cc0
Test for invalid signature 2019-03-20 15:24:48 -04:00
George Drummond
96355c4352
CRL checker handles expired certificates 2019-03-20 13:11:13 -04:00
George Drummond
eafb000d58
Just return a boolean response rather than a string 2019-03-20 13:11:13 -04:00
George Drummond
1024ee0cf2
Test is handed in CRL checker 2019-03-20 13:11:13 -04:00
George Drummond
3690d98260
CRL check is passed in and not hard coded 2019-03-20 13:11:13 -04:00
George Drummond
f2ae591c87
Verify PDF signatures 2019-03-20 13:11:12 -04:00
Patrick Smith
e51a9012fd Add custom JSON encoder to handle attachment objects 2019-01-23 14:57:14 -05:00
dandds
d3d36822df workspace -> portfolio everywhere 2019-01-14 16:00:17 -05:00
George Drummond
c274ad6d54
Remove LRU cache 2019-01-02 16:04:37 -05:00
George Drummond
f806425d91
Put app strings into a YAML file for easy editing by product owner 2019-01-02 16:04:36 -05:00
dandds
6527f72e78 pass file-like object to Docx.render method 2019-01-02 09:36:29 -05:00
dandds
718f88d828 download link for task order summary 2019-01-02 09:36:29 -05:00
dandds
59510819e7 docx utility 2019-01-02 09:36:29 -05:00
dandds
1dd2cdd48b add test, simpler kwargs for flash function signature 2018-12-10 12:31:41 -05:00
richard-dds
de12aee163 .read() should return an ImmutableMultiDict 2018-11-19 11:45:52 -05:00
richard-dds
7d78ba4d65 Use form_cache.from_request 2018-11-16 13:20:55 -05:00
richard-dds
5447be8b52 Use FormCache everywhere 2018-11-16 11:42:33 -05:00
dandds
fea85cb07b utility function for caching form data 2018-11-15 13:08:09 -05:00
richard-dds
b930c85c3f Idea for using composition rather than inheritance 2018-10-16 13:04:30 -04:00
dandds
df35725430 reformat files, add more tests 2018-10-15 11:38:34 -04:00
dandds
f7d8783349 implement mailer with task queue 2018-10-15 11:37:06 -04:00
dandds
0d9f1cd7e0 update mailer, add tests 2018-10-15 11:35:20 -04:00