Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First Release #25

Merged
merged 73 commits into from
Nov 3, 2021
Merged

First Release #25

merged 73 commits into from
Nov 3, 2021

Conversation

ltshb
Copy link
Contributor

@ltshb ltshb commented Nov 3, 2021

No description provided.

ltshb and others added 30 commits July 5, 2021 15:19
BGDIINF_SB-1890: Updated to latest Codebuild image aws/codebuild/standard:5.0
* now local containers for s3 bucket and dynamodb are provided and
  initialized in docker-compose.yml using mc and aws-cli
* for some reasons the mocked dynamodb only accepts existing regions
  and not fake regions, while s3 does accept fake region.
* in unit tests s3 bucket and dynamodb are completely mocked
* mock.start() and mock_dynamodb2 are placed in unit tests __init__.py
  to assure they are executed as early as possible
* for unit tests, a .env.testing is used and passed in the Makefile's
  test target to overwrite the service's env variables.
* added tearDown() to empty and delete the test bucket and DynamoDB table
* added unit test for posting an invalid kml_string
in case the bucket and the table that are mocked in the unit test already exist, an error is raised.
As the bucket and the table are deleted in the tearDown(), there should not be any existing bucket
and table in setUp(). This also makes sure that we do not accidentally use real resources.
BGDIINF SB-1799 Adding S3, DynamoDB and unittests
…ervice_problems

BGDIINF_SB-1800: remove access and secret access key
using the correct keys in the responses

corrections to logs, making messages clearer, small correction to test to account for changes

adding base test class for unit tests in routes

added missing underscore

removing unused field in json response
Also improved readme readability.
hansmannj and others added 26 commits July 24, 2021 21:42
* using 3 sample files for valid, invalid and updated kmls for unit tests
* added get_kml_dict in BaseRouteTestCase in base.py
* renamed kml_string to kml_dict, as now a dictionary is used to store all 3 kml strings
* added some docstrings in base.py
* added create_test_kml() in BaseRouteTestCase to create an initial kml via POST in s3 and DynamoDB
  that can be uses in unit tests, e.g. for PUT and GET requests, where it is guaranteed to already exist
  and hence prior POST requests are not needed any longer.
…rd alphabetically | changed name of kml file in curl sample in README.md
…l_contents in test_routes

* reorganized base.py to use setUpClass and tearDownClass, so that those methods are only called once per test class and not once per test
* moved helper functions formerly decorated as classfunction outside of BaseRouteTestCase where no class context needed
* added a missing check self.compare_kml_contents in test_routes.py for the GET endpoint test
This implement the new kml spec based on geoadmin/doc-api-spec

- POST api/kml/admin multipart/form-data kml=<kml-file>
- GET api/kml/admin/<kml_id>
- PUT api/kml/admin/<kml_id> mutlipart/form-data admin_id=<admin_id>
kml=<kml-file>
- DEL api/kml/admin/<kml_id> multipart/form-data admin_id=<admin_id>
Now the S3 file returns the correct content-type
In order to simplify the development of the web-mapviewer, made the
origin header configurable, this way on DEV staging it can allow
localhost.
Now in the POST request you can specify the KML author. This will allow
to differentiates KMLs created by user (map viewer) to the one created
by E2E tests.
Disabling the cache for KML file will avoid issue when modifying shared
kml drawing. The cache control can/could also be changed via environment
variable if needed.
…secure scheme header

The path prefix is now set by the deployment using the WSGI SCRIPT_NAME
environment variable.

Also configure gunicorn to use secure scheme header which allow us to
get rid of the middleware. This settings is needed in order to set the
correct http proto in generated urls in responses.

Change the default ALLOWED_ORIGIN to allow everything.
Use `SCRIPT_NAME` instead of route prefix & configure gunicorn for secure scheme header
@ltshb ltshb merged commit 65c811c into master Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants