Commit graph

28 commits

Author SHA1 Message Date
Reinoud van Leeuwen
dc321ef79c
add /api endpoint for automated flows (#316)
* add /api endpoint

* pass password in request body when using API

* flake8 fixed; tests added

* flake8 fixed test.py

---------

Co-authored-by: Reinoud van Leeuwen <reinoud.van.leeuwen@itcreation.nl>
2024-02-26 15:22:40 -08:00
Yuru Shao
455db36189
Add health check endpoint (#329)
* Add health check endpoint

* Add assertion on  status
2024-02-02 16:14:51 -08:00
Jon Parise
2c702b0a39
Run flake8 across the entire code base (#163)
Also, make sure we're using a consistent version of flake8 in CI.
2022-05-17 11:41:01 -07:00
Jon Parise
68c5f14cd4
Remove dependency on six (#160)
We no longer need six now that we require Python 3.x.
2022-05-17 11:10:58 -07:00
Jon Parise
487d10231d
Remove mock and nose development dependencies (#158)
We don't need 'mock' now that we require Python 3.x.

... and nose is no longer used since we switched to pytest as our test
runner a long time ago.
2022-05-17 10:57:35 -07:00
Christian
3fbc018ff8
Adding json-output for api-like functionality (#147)
* adding json-template for api-like functionality

* removing content-block

* adding test

* changing to flask.jsonify

* deleting template

* change from POST-param to Accept-Header
2022-04-11 12:37:19 -07:00
Jon Parise
3d86f5395b
Use 'six' to import 'unquote' (#122) 2020-05-08 14:34:41 -07:00
Jeremiah Lee
2af7037feb
Adds option for two-week timeout. (#120)
Also includes:

- Updated the versions in the requirements, as MarkupSafe did not install cleanly.
- Integration test that sets a password via the website, and then
verifies the timeout on the backend.
- Basic Makefile, updates to the docs to use the Makefile.

The requirements file was updated using pip freeze after I had updated the version of MarkupSafe. I don't know what the usual process is for this repo, so please let me know if I should use a different process there (that is why there are a few additions).
2020-05-08 11:43:54 -07:00
vin01
5747ee2d14 Add url prefix for reverse proxies (#106) 2019-08-09 14:07:49 -07:00
vin01
054c61ae89 Migrate to fakeredis from mockredispy (#108) 2019-08-09 08:37:03 -07:00
Lauri Lubi
1ac262e34e Bots that prefetch should not destroy the secret (#100)
* Create preview view, remove sneaky-user-agents logic

* unit tests

* rename openSecret to viewSecret

* code clean-up and style

* rename view secret to reveal secret

* update authors list

* bump version to 1.5.0
2019-03-05 07:47:07 -08:00
Nicholas Charriere
386a378c5d Add prefix to memcache 2018-07-01 10:19:56 -07:00
Samuel Dion-Girardeau
80f77a6572 Fix assertEqual parameter order (expected, actual)
This ensures the failure message, if any, is reflective of the
intended value.
2018-05-07 21:27:13 -04:00
Samuel Dion-Girardeau
e6eca0daf8 Use assertion methods introduced in Python 2.7
Since Python 2.6 support was dropped, we can use all these:
https://docs.python.org/2/library/unittest.html#assert-methods
2018-05-07 21:20:54 -04:00
Nicholas Charriere
331d421e10 Mock redis in tests using mockredis 2018-05-06 14:29:48 -07:00
Nicholas Charriere
2b4a6a4b50 Merge pull request #65 from samueldg/feature/secure_password_storage
Feature/secure password storage
2017-05-16 10:08:17 -07:00
Guewen Baconnier
7b5f804551 Add Iframely in sneaky user-agents
This "embeds as a service" is used by many apps/websites. Discovered
when my pass got eaten by the HipChat preview.
2017-05-12 08:27:52 +02:00
Samuel Dion-Girardeau
076b271be2 Use assertEqual, not assertEquals (deprecated)
Removes the following warning:

```
tests.py:96: DeprecationWarning: Please use assertEqual instead.
  self.assertEquals(rv.status_code, 404)
```
2017-05-11 21:39:26 -04:00
Samuel Dion-Girardeau
e4f5aed4fa Add tests for the encryption
Check that:

- Password is not stored in plain text in Redis;
- The token returned has the expected format;
- The key returned is indeed the decryption key;
- API backwards compatibility is maintained: passwords stored in plain text
  can be retrieved via the original URL token.

`test_returned_token_format` superseeds `test_set_password`, which
was only validating the key length.

f
2017-05-11 21:38:43 -04:00
Carlos Moreno
e0a03dc484 added skype to sneaky_bots test 2017-02-17 21:48:10 -06:00
Joseph Boiteau
58f4658154
Fix code according to @jparise comments
- Refactor is_valid_request code
- Add "Facebot/1.0" User-Agent string
2017-01-11 13:50:42 +11:00
Joseph Boiteau
1651ac4bd5
Return 404 to UserAgents matching list
Empty User-Agent should not break
Add test for 404 response to /bot/
Wrap User-Agent check in `request_is_valid` method
2017-01-11 09:48:54 +11:00
Samuel Dion-Girardeau
5801007738 Add tests for password expiration 2016-10-24 19:21:08 -04:00
Samuel Dion-Girardeau
00f6964a90 Fix python2.6 support for tests
- "{}".format('foo') does not work on python2.6, as the index needs to be explicitly specified.
- assertIn(x, y) was only introduced in 2.7, reverting to assertTrue(x in y)

Updated test environments definitions and docs accordingly.
2016-08-12 18:47:02 -04:00
Samuel Dion-Girardeau
a46fc40aa3 Improve string encoding for password retrieval
- Prevent the password from displaying as b'...' in the app;
 - Use Flask's `get_data(as_test=True)` to read the data, in the tests;
 - Add test to ensure `get_password` is not returning bytes.
2016-08-11 22:05:35 -04:00
Nicholas Charriere
a9fc727240 Fix tests 2016-07-18 13:36:06 -07:00
Nicholas Charriere
db1ef7673e Make flake8 test pass 2016-07-18 11:53:34 -07:00
Dave Dash
eefe2bdc76 Prepare snappass for distribution. 2013-10-05 23:10:50 -07:00