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

New adapter #184

Merged
merged 6 commits into from
May 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions .bumpversion.cfg

This file was deleted.

25 changes: 14 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM python:2.7-alpine
LABEL maintainer="Francis Charette-Migneault <francis.charette-migneault@crim.ca>"
FROM python:3.7-alpine
LABEL Description="Runs Magpie AuthN/AuthZ service for REST-API and UI interfaces."
LABEL Maintainer="Francis Charette-Migneault <francis.charette-migneault@crim.ca>"
LABEL Vendor="CRIM"

# the cron service depends on the $MAGPIE_DIR environment variable
ENV MAGPIE_DIR=/opt/local/src/magpie
Expand All @@ -13,24 +15,25 @@ RUN touch ~/magpie_cron_status.log
# set /etc/environment so that cron runs using the environment variables set by docker
RUN env >> /etc/environment

COPY magpie/__init__.py magpie/__meta__.py ./magpie/
COPY requirements* setup.py README.rst HISTORY.rst ./
COPY magpie/__init__.py magpie/__meta__.py $MAGPIE_DIR/magpie/
COPY requirements* setup.py README.rst HISTORY.rst $MAGPIE_DIR/

RUN apk update && apk add \
RUN apk update \
&& apk add \
bash \
postgresql-libs \
py-pip \
libxslt-dev && \
apk add --virtual .build-deps \
libxslt-dev \
&& apk add --virtual .build-deps \
supervisor \
gcc \
libffi-dev \
python-dev \
musl-dev \
postgresql-dev && \
pip install --no-cache-dir --upgrade pip setuptools && \
pip install --no-cache-dir -e $MAGPIE_DIR && \
apk --purge del .build-deps
postgresql-dev \
&& pip install --no-cache-dir --upgrade pip setuptools \
&& pip install --no-cache-dir -e $MAGPIE_DIR \
&& apk --purge del .build-deps

COPY ./ $MAGPIE_DIR

Expand Down
34 changes: 34 additions & 0 deletions Dockerfile.adapter
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
## Builds 'Twitcher' image with 'MagpieAdapter' directly integrated and configured into it.
#
# docker run will need to override ini file with mounted volume
# using config 'twitcher.adapter = magpie.adapter.MagpieAdapter'
#
FROM birdhouse/twitcher:0.5.0
LABEL Description="Configures MagpieAdapter on top of Twitcher application."
LABEL Maintainer="Francis Charette-Migneault <francis.charette-migneault@crim.ca>"
LABEL Vendor="CRIM"

ENV MAGPIE_DIR=/opt/local/src/magpie
COPY magpie/__init__.py magpie/__meta__.py $MAGPIE_DIR/magpie/
COPY requirements* setup.py README.rst HISTORY.rst $MAGPIE_DIR/

# install dependencies used by Magpie
RUN apk update \
&& apk add \
bash \
postgresql-libs \
py-pip \
libxslt-dev \
&& apk add --virtual .build-deps \
supervisor \
gcc \
libffi-dev \
python-dev \
musl-dev \
postgresql-dev \
&& pip install --no-cache-dir --upgrade pip setuptools \
&& pip install --no-cache-dir -e $MAGPIE_DIR \
&& apk --purge del .build-deps

COPY ./ $MAGPIE_DIR/
RUN pip install --no-dependencies -e $MAGPIE_DIR
73 changes: 64 additions & 9 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,57 @@
History
=======

0.10.x
Unreleased
---------------------

Features / Changes
~~~~~~~~~~~~~~~~~~~~~
* add ``Dockerfile.adapter`` to build and configure ``MagpieAdapter`` on top of ``Twitcher >= 0.5.0``
* add auto-bump of history version
* update history with more specific sections
* improve ``Makefile`` targets with more checks and re-using variables
* add constant alternative search of variant ``magpie.[variable_name]`` for ``MAGPIE_[VARIABLE_NAME]``
* add tests for ``get_constant`` function

Bug Fixes
~~~~~~~~~~~~~~~~~~~~~
* use an already created configurator when calling ``MagpieAdapter.configurator_factory``
instead of recreating it from settings to preserve potential previous setup and includes
* use default ``WPSGet``/``WPSPost`` for ``magpie.owsrequest.OWSParser`` when no ``Content-Type`` header is specified
(``JSONParser`` was used by default since missing ``Content-Type`` was resolved to ``application/json``, which
resulted in incorrect parsing of `WPS` requests parameters)
* actually fetch required `JSON` parameter from the request body if ``Content-Type`` is ``application/json``
* convert ``Permission`` enum to string for proper ACL comparison in ``MagpieOWSSecurity``
* fix ``raise_log`` function to allow proper evaluation against ``Exception`` type instead of ``message`` property

0.10.0 (2019-04-15)
---------------------

Features / Changes
~~~~~~~~~~~~~~~~~~~~~
* refactoring of literal strings to corresponding ``Permission`` enum (#167)
* change all incorrect usages of ``HTTPNotAcceptable [406]`` to ``HTTPBadRequest [400]`` (#163)
* add ``Accept`` header type checking before requests and return ``HTTPNotAcceptable [406]`` if invalid
* code formatting changes for consistency and cleanup of redundant/misguiding names (#162)
* add option ``MAGPIE_UI_ENABLED`` allowing to completely disable all ``/ui`` route (enabled by default)
* add more unittests (#74)

Bug Fixes
~~~~~~~~~~~~~~~~~~~~~
* fix swagger responses status code and description and fix erroneous body (#126)
* fix invalid member count value returned on ``/groups/{id}`` request
* fix invalid ``DELETE /users/{usr}/services/{svc}/permissions/{perm}`` request not working
* add more unittests (#74)

0.9.x
---------------------

Features / Changes
~~~~~~~~~~~~~~~~~~~~~
* greatly reduce docker image size
* allow quick functional testing using sequences of local app form submissions
* fix UI add child button broken by introduced ``int`` resource id type checking
* add test methods for UI redirects to other views from button click in displayed page
* change resource response for generic ``resource: {<info>}`` instead of ``{resource-id}: {<info>}``
* add permissions config to auto-generate user/group rules on startup
* fix many invalid or erroneous swagger specifications
* attempt db creation on first migration if not existing
* add continuous integration testing and deployment (with python 2/3 tests)
* ensure python compatibility for Python 2.7, 3.5, 3.6 (via `Travis-CI`)
Expand All @@ -38,17 +66,24 @@ History
* add new route ``/services/types/{svc_type}/resources`` for details about child service type resources
* error handling of reserved route keywords service `types` and current user ``MAGPIE_LOGGED_USER``
* additional tests for new routes and operations previously left unevaluated
* fix invalid conflict service name check on service update request
* logging requests and exceptions according to `MAGPIE_LOG_REQUEST` and `MAGPIE_LOG_EXCEPTION` values
* better handling of ``HTTPUnauthorized [401]`` and ``HTTPForbidden [403]`` according to unauthorized view
(invalid access token/headers or forbidden operation under view)
* better handling of ``HTTPNotFound [404]`` and ``HTTPMethodNotAllowed [405]`` on invalid routes and request methods

Bug Fixes
~~~~~~~~~~~~~~~~~~~~~
* fix UI add child button broken by introduced ``int`` resource id type checking
* fix travis-ci test suite execution and enable PEP8 lint checks
* fix yaml security issue using updated package distribution
* fix invalid conflict service name check on service update request
* fix many invalid or erroneous swagger specifications

0.8.x
---------------------

Features / Changes
~~~~~~~~~~~~~~~~~~~~~
* update `MagpieAdapter` to match process store changes
* provide user ID on API routes returning user info

Expand All @@ -57,23 +92,30 @@ History

`Magpie REST API latest documentation`_

Features / Changes
~~~~~~~~~~~~~~~~~~~~~
* add service resource auto-sync feature
* return user/group services if any sub-resource has permissions
* add inherited resource permission with querystring (deprecate `inherited_<>` routes warnings)
* add flag to return `effective` permissions from user resource permissions requests
* hide service private URL on non administrator level requests
* fix external providers login support (validated for `DKRZ`, `GitHub` and `WSO2`)
* make cookies expire-able by setting ``MAGPIE_COOKIE_EXPIRE`` and provide cookie only on http (`JS CSRF` attack protection)
* update ``MagpieAdapter.MagpieOWSSecurity`` for `WSO2` seamless integration with Authentication header token
* update ``MagpieAdapter.MagpieProcess`` for automatic handling of REST-API WPS process route access permissions
* update ``MagpieAdapter.MagpieService`` accordingly to inherited resources and service URL changes
* bug fixes related to postgres DB entry conflicting inserts and validations

Bug Fixes
~~~~~~~~~~~~~~~~~~~~~
* fixes related to postgres DB entry conflicting inserts and validations
* fix external providers login support (validated for `DKRZ`, `GitHub` and `WSO2`)

0.6.x
---------------------

`Magpie REST API 0.6.x documentation`_

Features / Changes
~~~~~~~~~~~~~~~~~~~~~
* add ``/magpie/api/`` route to locally display the Magpie REST API documentation
* move many source files around to regroup by API/UI functionality
* auto-generation of swagger REST API documentation
Expand All @@ -89,6 +131,8 @@ History

`Magpie REST API 0.5.x documentation`_

Features / Changes
~~~~~~~~~~~~~~~~~~~~~
* independent user/group permissions, no more 'personal' group to reflect user permissions
* service specific resources with service*-typed* resource permissions
* more verification of resources permissions under specific services
Expand All @@ -101,6 +145,8 @@ History

`Magpie REST API 0.4.x documentation`_

Features / Changes
~~~~~~~~~~~~~~~~~~~~~
* default admin permissions
* block UI view permissions of all pages if not logged in
* signout clear header to forget user
Expand All @@ -111,6 +157,8 @@ History

`Magpie REST API 0.3.x documentation`_

Features / Changes
~~~~~~~~~~~~~~~~~~~~~
* `ncWMS` support for `getmap`, `getcapabilities`, `getmetadata` on ``thredds`` resource
* `ncWMS2` added to default providers
* add `geoserverwms` service
Expand All @@ -119,15 +167,20 @@ History
* major update of `Magpie REST API 0.2.x documentation`_ to match returned codes/messages from 0.2.0 changes
* normalise additional HTTP request responses omitted from 0.2.0 (404, 500, and other missed responses)
* remove internal api call, separate login external from local, direct access to `ziggurat` login
* fixes UI ``"Magpie Administration"`` to redirect toward home page instead of `PAVICS` platform

Bug Fixes
~~~~~~~~~~~~~~~~~~~~~
* fix UI ``"Magpie Administration"`` to redirect toward home page instead of `PAVICS` platform
* fix bug during user creation against preemptive checks
* bug fixes from `0.2.x` versions
* fix issues from `0.2.x` versions

0.2.0
---------------------

`Magpie REST API 0.2.0 documentation`_

Features / Changes
~~~~~~~~~~~~~~~~~~~~~
* Revamp HTTP standard error output format, messages, values and general error/exception handling.
* Update `Magpie REST API 0.2.0 documentation`_

Expand All @@ -136,6 +189,8 @@ History

`Magpie REST API 0.1.1 documentation`_

Features / Changes
~~~~~~~~~~~~~~~~~~~~~
* Add edition of service URL via ``PUT /{service_name}``.

0.1.0
Expand Down
Loading