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

Milestone 2.0 - User scope views, Discoverable Groups & Patches #340

Merged
merged 138 commits into from
Sep 17, 2020
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
138 commits
Select commit Hold shift + click to select a range
279a66f
improve usage docs and guides in API swagger
fmigneault Jul 21, 2020
e5229a9
[wip] user info self-update
fmigneault Jul 22, 2020
3408b54
[wip] add /register/groups routes + setup test for user-view function…
fmigneault Jul 23, 2020
7c52da6
db migration for discoverable groups + UI improvements (CSS + error a…
fmigneault Jul 24, 2020
b4b761e
more config auto-setup with MAGPIE_CONFIG_PATH (fix #204, fix #47) + …
fmigneault Jul 25, 2020
d9db945
Update models.py
fmigneault Jul 24, 2020
1e490a4
disable UI non-editable users/groups + error API side (fixes #164)
fmigneault Jul 27, 2020
f327155
force non-default secret/admin-credentials (relates to #229) + update…
fmigneault Jul 28, 2020
3b98cc5
adjust ui theme + address codacy issues (fix #168)
fmigneault Jul 28, 2020
67106ed
ui style changes
fmigneault Jul 28, 2020
6c8864d
avoid reload page on cancel alert + fix add group error value warning
fmigneault Jul 28, 2020
1951d84
ui theme selection & fixes + config doc additions & fixes
fmigneault Jul 29, 2020
8aea835
update history with fix #204
fmigneault Jul 29, 2020
ae5cc5b
fix linting
fmigneault Jul 29, 2020
4a31513
improve UI buttons and icons
fmigneault Jul 29, 2020
33d4c0b
user input validation (fix #84, relates #171) + adjust input types + …
fmigneault Jul 29, 2020
c04754e
unify str formats
fmigneault Jul 29, 2020
e493be0
add version tag in UI + more input validation (#84) + tests
fmigneault Jul 30, 2020
0ce052e
fix typings & linting
fmigneault Jul 30, 2020
2cfe474
better document tests utils and minor fixes to them
fmigneault Jul 30, 2020
a91d452
more test cases and improvements
fmigneault Jul 30, 2020
6a6f111
impl discoverable groups tests
fmigneault Jul 30, 2020
627618c
helper CLI script updates + fixes 'discoverable' default + enforce/bl…
fmigneault Jul 30, 2020
cd0dba2
even more input validation
fmigneault Jul 30, 2020
46e8944
update changelog about fix #47 - user creation from config
fmigneault Jul 30, 2020
aaabe7b
enforce regex validation for any path var & body key from request-che…
fmigneault Jul 30, 2020
2459a43
more tests & update utils
fmigneault Jul 31, 2020
7d7c510
test fixes
fmigneault Jul 31, 2020
eda9c1c
Bump version: 1.11.0 → 2.0.0
fmigneault Jul 31, 2020
66ddc51
test patches + more implementations
fmigneault Jul 31, 2020
c012a82
update CLI tests & references + fixing tests
fmigneault Aug 1, 2020
917e3fc
fix batch-update-user script & tests
fmigneault Aug 3, 2020
7b1cf3d
add user/group effective permission test (fixes #207)
fmigneault Aug 3, 2020
436a209
improve docs + more test fixes
fmigneault Aug 3, 2020
d145c77
test fixes + UI fields for edit group
fmigneault Aug 18, 2020
157451f
change all PUT -> PATCH update methods + fix edit group UI fields
fmigneault Aug 18, 2020
44e76f4
fixes to tests and schema udpates
fmigneault Aug 18, 2020
1bbb4a1
updates to tests and fix discoverable group operations
fmigneault Aug 19, 2020
0bf4bd2
support accept-header/format-query for all responses (fix #194) + add…
fmigneault Aug 20, 2020
fb5d3b1
update changelog and fix swagger generation
fmigneault Aug 20, 2020
79529da
fix format type check for ui frontpage
fmigneault Aug 20, 2020
fd22952
fix login/logout header forwarding during content-type rewrite
fmigneault Aug 20, 2020
919bb3f
fix content-type for some ui-view + fix version position
fmigneault Aug 20, 2020
faab1fb
small adjustment to catch edge-case accept header from ui
fmigneault Aug 20, 2020
a58edce
improve html formatting and fix returned content-type in this case fo…
fmigneault Aug 20, 2020
d287f64
fix forwarded headers
fmigneault Aug 22, 2020
9ebe8d0
fix rebase
fmigneault Aug 20, 2020
3b8df7b
attempt using route factory
fmigneault Aug 19, 2020
4f655d3
testing out user-factory for route-access permission
fmigneault Aug 20, 2020
8165476
apply user-factory to user-routes
fmigneault Aug 20, 2020
0ffb597
get session-user auto-resolve allowed when current/self reference mat…
fmigneault Aug 20, 2020
f4b20af
documentation improvements (relates to #332 and #341)
fmigneault Aug 22, 2020
bf8b06f
remove json2xml for dicttoxml to avoid breaking install
fmigneault Aug 22, 2020
83e1289
make user-factory work for admins when non-existing user is reference…
fmigneault Aug 22, 2020
6d91c9c
finish perms docs + fixes for tests
fmigneault Aug 24, 2020
cd46634
add note about fix #337
fmigneault Aug 24, 2020
4322fba
more validations and test of schemas
fmigneault Aug 25, 2020
8a96ce3
update changelog fix #171 (via commit e493be0)
fmigneault Aug 25, 2020
19908a9
service listing (fix #345) + more response formatting tests
fmigneault Aug 25, 2020
4d2b1bb
add validation on input password missing
fmigneault Aug 25, 2020
fa645a0
more tests and validation checks + increase coverage
fmigneault Aug 25, 2020
87bec12
apply changes for flatten listing (#345) + align with eventual resour…
fmigneault Aug 25, 2020
7bb9b38
obsolete inherited_permissions routes + apply fixes to permissions docs
fmigneault Aug 26, 2020
230eecb
improve docs to use terms, notes, warnings across configuration details
fmigneault Aug 26, 2020
fbee608
add typing and docstring
fmigneault Aug 26, 2020
fc420a8
remove sync-service duplicate code
fmigneault Aug 26, 2020
c572c31
demystify docs about direct/immediate/applied/inherited permissions
fmigneault Aug 26, 2020
a2c5324
fix returned allowed permissions for services/reosources routes + mor…
fmigneault Aug 27, 2020
755a6f9
move resource util where it should be
fmigneault Aug 27, 2020
8096161
fix ui join discoverable group request
fmigneault Aug 27, 2020
708466a
ui return error code of api request
fmigneault Aug 27, 2020
8838e84
fix more tests and results
fmigneault Aug 27, 2020
9222e44
fix admin-user access when view requires MAGPIE_LOGGED_PERMISSION
fmigneault Aug 28, 2020
6976f1e
fixes + password min size check
fmigneault Aug 29, 2020
75fe08a
more fixes + plan extra tests of user services responses
fmigneault Aug 30, 2020
07e51e9
more tests & fixes
fmigneault Aug 30, 2020
f4e15df
more use-case test coverage + corresponding fixes
fmigneault Sep 1, 2020
a30583b
more test fixes
fmigneault Sep 1, 2020
fd42898
filter query user resources + more test cases & fixes
fmigneault Sep 2, 2020
30340fa
fix linting
fmigneault Sep 2, 2020
7083a40
Merge pull request #348 from Ouranosinc/fixes-and-checks
fmigneault Sep 2, 2020
c808f7a
patch sphinx docs version
fmigneault Sep 2, 2020
b3f28fe
remove redundant travis coverage job
fmigneault Sep 2, 2020
3c70263
more logging during database migration to investigate error
fmigneault Sep 2, 2020
930cd21
use low-level ziggurat models to avoid missing future fields definiti…
fmigneault Sep 2, 2020
c9a9084
make non-editable groups displayed as such in ui
fmigneault Sep 3, 2020
b6560e0
adjust migration script to base sql call to avoid future field errors…
fmigneault Sep 3, 2020
f0e4ed4
fix lint
fmigneault Sep 3, 2020
747b7a9
ui display & test typing fixes
fmigneault Sep 3, 2020
14c6786
avoid tests assuming test-admin user already exists
fmigneault Sep 3, 2020
e9df61c
fix enum future python 3.8 error
fmigneault Sep 3, 2020
568305c
use travis venv python to target good pip + skip reinstall conda/python
fmigneault Sep 3, 2020
aacddf1
other enum future python 3.8 fix
fmigneault Sep 3, 2020
b49dd6f
travis patches
fmigneault Sep 3, 2020
c6bf643
add supported python versions in setup & travis
fmigneault Sep 3, 2020
8b2ef51
fix active env resolution
fmigneault Sep 3, 2020
918dc31
pin pylint until const iterable with enum fixed (PyCQA/astroid#713)
fmigneault Sep 3, 2020
4bd4bfc
fix failing tests
fmigneault Sep 3, 2020
df49bbe
other attempt to make test run with venv
fmigneault Sep 4, 2020
10222cc
adjust travis export + fix test path
fmigneault Sep 4, 2020
386a1d7
adjust requirements for backward compatibility
fmigneault Sep 4, 2020
3db1dda
adjust docs requirement
fmigneault Sep 4, 2020
ff701e3
bw compat
fmigneault Sep 4, 2020
03af046
patch doc link to permisisons
fmigneault Sep 4, 2020
af877b2
Merge pull request #351 from Ouranosinc/doc-patches
fmigneault Sep 4, 2020
acdacca
patch invalid postgres.env created using magpie.env.example
fmigneault Sep 10, 2020
74369bc
avoid issue of database_exists check (introduced by kvesteri/sqlalche…
fmigneault Sep 10, 2020
3500436
extra docs according to PR feedback
fmigneault Sep 10, 2020
dcfc1bb
adjust handling of UI group discoverable checkbox
fmigneault Sep 10, 2020
fa93eb9
adjust default view decorator to wrap/redirect to error view all UI e…
fmigneault Sep 10, 2020
fc9439a
override param error details when not verbose
fmigneault Sep 10, 2020
172b199
fix UI button theme for add-resource + patches with param TWITCHER_HOST
fmigneault Sep 10, 2020
e64159a
add more generic ui checks for bad-request returned by api create use…
fmigneault Sep 10, 2020
0b7e5d0
fix spelling & security check
fmigneault Sep 10, 2020
b038ad8
update ui styles for better disabled vs cancel distinction
fmigneault Sep 10, 2020
308c1c8
fix package verison extraction in setup
fmigneault Sep 11, 2020
b95b9e4
add contextual user docs + patch context user resolution when unauthe…
fmigneault Sep 11, 2020
3cd4f7f
lint doc fix
fmigneault Sep 11, 2020
da16a7a
add test for no-auth user accessing other user details
fmigneault Sep 11, 2020
ba034d1
fix missing service type when none registered
fmigneault Sep 11, 2020
17b5423
fix backward compat of curl command message
fmigneault Sep 11, 2020
0c35953
patch test cookies
fmigneault Sep 11, 2020
59c534a
backward compat
fmigneault Sep 11, 2020
f41ea3f
improve typing + fix py2 bwcompat args by removing internal arg to fu…
fmigneault Sep 12, 2020
19cb344
default disable feature to push service updates to phoenix
fmigneault Sep 12, 2020
117b4a4
fix backport tempdir unittest
fmigneault Sep 12, 2020
a9711ef
fix bad requirement definition
fmigneault Sep 13, 2020
b101a99
python 2.7 & python 3.5 support notes
fmigneault Sep 14, 2020
e82e176
adjust pip install sys
fmigneault Sep 14, 2020
64b19ee
remove pip use-feature-2020-resolver breaking a lot
fmigneault Sep 14, 2020
c9b423a
re-add pip 2020-resolver + remove typing install in python 3
fmigneault Sep 14, 2020
ca06122
update linters to Python 3.7 with fixes to latest pylint & isort
fmigneault Sep 14, 2020
9a8f2f9
adjust docker image of adapter with python3 as base magpie
fmigneault Sep 14, 2020
d85347a
patch warning symbol on remove service
fmigneault Sep 14, 2020
fb52181
adjust compare validation
fmigneault Sep 15, 2020
4f9cb8c
patch extended enum impl to allow deepcopy (pickle)
fmigneault Sep 15, 2020
fa30df9
correctly ignore generated doc by autoapi + patch lint
fmigneault Sep 15, 2020
de0fe0e
update account-user page with immediate warning invalid field
fmigneault Sep 16, 2020
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
4 changes: 3 additions & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,14 @@ disable=C0111,missing-docstring,
R1721,unnecessary-comprehension,
R1725,super-with-arguments,
W0108,unnecessary-lambda,
W0143,comparison-with-callable,
W0232,no-init,
W0235,useless-super-delegation,
W0613,unused-argument,
W0640,cell-var-from-loop,
W0703,broad-except,
W0706,try-except-raise,
W0707,raise-missing-from,
W1508,invalid-envvar-default

# note: following errors are managed via isort tool, ignore false positives
Expand Down Expand Up @@ -468,7 +470,7 @@ valid-metaclass-classmethod-first-arg=cls

# List of modules that can be imported at any level, not just the top level
# one.
allow-any-import-level=
allow-any-import-level=magpie

# Allow wildcard imports from modules that define __all__.
allow-wildcard-with-all=no
Expand Down
12 changes: 7 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,28 +66,30 @@ stages:
- smoke-test # try running the built/packaged docker image
jobs:
allow_failures:
- python: "2.7" # deprecated support, but leave it while it remains easy to maintain
# leave versions while they remains easy to maintain
- python: "2.7" # deprecated support (January 2020)
- python: "3.5" # deprecated support (September 2020)
include:
# use stages to quick fail faster tests
# these are extra to default 'test' stage with auto-matrix/env extension
- stage: check
name: "Linter Checks"
python: "3.6"
python: "3.7"
os: linux
script: make check
- stage: check
name: "Documentation Check" # verify that build works
python: "3.6"
python: "3.7"
os: linux
script: make docs
- stage: test
name: "Coverage"
python: "3.6"
python: "3.7"
os: linux
script: make coverage
- stage: smoke-test
name: "Smoke Test"
python: "3.6"
python: "3.7"
os: linux
script: make test-docker
script:
Expand Down
9 changes: 9 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ Features / Changes
* Avoid returning ``Service`` entries where user, group or both (according to request path and query options) does not
actually have any permission set either directly on them or onto one of their respective children ``Resource``. This
avoids unnecessarily exposing all ``Service`` for which the user cannot (or should not) be interacting with anyway.
* Add ``TWITCHER_HOST`` as alternative configuration parameter to define the service public URL, to have a similar
naming convention as other use cases covered by ``MAGPIE_HOST`` and ``PHOENIX_HOST``.
* Modify ``PHOENIX_PUSH`` to be *disabled* by default to be consistent across all locations where corresponding
feature is referenced (startup registration, CLI utility, API requests and UI checkbox option) and because this
option is an advanced extension not to be considered as default behavior.
* Python 2.7 and Python 3.5 marked for deprecation (they remain in CI, but are not required to pass), as both
reached their EOL as of January/September 2020.

Bug Fixes
~~~~~~~~~~~~~~~~~~~~~
Expand All @@ -85,6 +92,8 @@ Bug Fixes
* Fix minor HTML issues in mako templates.
* Fix invalid generation of default ``postgres.env`` file from ``magpie.env.example``.
File ``postgres.env.example`` will now be correctly employed as documented.
* Make environment variable ``PHOENIX_PUSH`` refer to ``phoenix.push`` instead of ``magpie.phoenix_push`` to employ
same naming schema as all other variables.

`1.11.0 <https://github.com/Ouranosinc/Magpie/tree/1.11.0>`_ (2020-06-19)
------------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.adapter
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ RUN apk update \
supervisor \
gcc \
libffi-dev \
python-dev \
python3-dev \
musl-dev \
postgresql-dev \
&& pip install --no-cache-dir --upgrade pip setuptools \
Expand Down
28 changes: 18 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ endif
DOWNLOAD_CACHE ?= $(APP_ROOT)/downloads
REPORTS_DIR ?= $(APP_ROOT)/reports
PYTHON_VERSION ?= `python -c 'import platform; print(platform.python_version())'`
PIP_XARGS ?= --use-feature=2020-resolver

# choose conda installer depending on your OS
CONDA_URL = https://repo.continuum.io/miniconda
Expand Down Expand Up @@ -119,20 +120,20 @@ version: ## display current version

.PHONY: info
info: ## display make information
@echo "Informations about your make execution:"
@echo "Information about your make execution:"
@echo " OS Name $(OS_NAME)"
@echo " CPU Architecture $(CPU_ARCH)"
@echo " Conda Home $(CONDA_HOME)"
@echo " Conda Prefix $(CONDA_ENV_PATH)"
@echo " Conda Env Name $(CONDA_ENV_NAME)"
@echo " Conda Env Path $(CONDA_ENV_REAL_ACTIVE_PATH)"
@echo " Conda Binary $(CONDA_BIN)"
@echo " Conda Actication $(CONDA_ENV_MODE)"
@echo " Conda Activation $(CONDA_ENV_MODE)"
@echo " Conda Command $(CONDA_CMD)"
@echo " Application Root $(APP_ROOT)"
@echo " Application Name $(APP_NAME)"
@echo " Application Version $(APP_VERSION)"
@echo " Donwload Cache $(DOWNLOAD_CACHE)"
@echo " Download Cache $(DOWNLOAD_CACHE)"
@echo " Test Reports $(REPORTS_DIR)"
@echo " Docker Tag (magpie) $(MAGPIE_DOCKER_TAG)"
@echo " Docker Tag (twitcher) $(TWITCHER_DOCKER_TAG)"
Expand Down Expand Up @@ -241,7 +242,7 @@ endif
bump: ## bump version using VERSION specified as user input
@-echo "Updating package version ..."
@[ "${VERSION}" ] || ( echo ">> 'VERSION' is not set"; exit 1 )
@-bash -c '$(CONDA_CMD) test -f "$(CONDA_ENV_PATH)/bin/bump2version" || pip install bump2version'
@-bash -c '$(CONDA_CMD) test -f "$(CONDA_ENV_PATH)/bin/bump2version" || pip install $(PIP_XARGS) bump2version'
@-bash -c '$(CONDA_CMD) bump2version $(BUMP_XARGS) --new-version "${VERSION}" patch;'

## --- Installation targets --- ##
Expand All @@ -259,31 +260,38 @@ install: install-all ## alias for 'install-all' target
.PHONY: install-all
install-all: install-sys install-pkg install-dev install-docs ## install every dependency and package definition

# note: don't use PIP_XARGS for install system package as it could be upgrade of pip that doesn't yet have those options
.PHONY: install-sys
install-sys: clean conda-env ## install system dependencies and required installers/runners
@echo "Installing system dependencies..."
@bash -c '$(CONDA_CMD) pip install --upgrade -r "$(APP_ROOT)/requirements-sys.txt"'
@bash -c '$(CONDA_CMD) pip install gunicorn'
@bash -c '$(CONDA_CMD) pip install $(PIP_XARGS) gunicorn'

.PHONY: install-pkg
install-pkg: install-sys ## install the package to the active Python's site-packages
@echo "Installing Magpie..."
@bash -c '$(CONDA_CMD) python setup.py install_egg_info'
@bash -c '$(CONDA_CMD) pip install $(PIP_XARGS) --upgrade -e "$(APP_ROOT)" --no-cache'
# TODO: remove when merged
# --- ensure fix is applied
@bash -c '$(CONDA_CMD) \
pip install --force-reinstall "https://github.com/fmigneault/authomatic/archive/httplib-port.zip#egg=Authomatic"'
pip install $(PIP_XARGS) --force-reinstall \
"https://github.com/fmigneault/authomatic/archive/httplib-port.zip#egg=Authomatic"'
# ---
@bash -c '$(CONDA_CMD) python setup.py install_egg_info'
@bash -c '$(CONDA_CMD) pip install --upgrade -e "$(APP_ROOT)" --no-cache'

.PHONY: install-req
install-req: conda-env ## install package base requirements without installing main package
@bash -c '$(CONDA_CMD) pip install $(PIP_XARGS) -r "$(APP_ROOT)/requirements.txt"'
@echo "Successfully installed base requirements."

.PHONY: install-docs
install-docs: conda-env ## install package requirements for documentation generation
@bash -c '$(CONDA_CMD) pip install -r "$(APP_ROOT)/requirements-docs.txt"'
@bash -c '$(CONDA_CMD) pip install $(PIP_XARGS) -r "$(APP_ROOT)/requirements-doc.txt"'
@echo "Successfully installed docs requirements."

.PHONY: install-dev
install-dev: conda-env ## install package requirements for development and testing
@bash -c '$(CONDA_CMD) pip install -r "$(APP_ROOT)/requirements-dev.txt"'
@bash -c '$(CONDA_CMD) pip install $(PIP_XARGS) -r "$(APP_ROOT)/requirements-dev.txt"'
@echo "Successfully installed dev requirements."

## --- Launchers targets --- ##
Expand Down
2 changes: 1 addition & 1 deletion ci/magpie.env
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ MAGPIE_POSTGRES_PASSWORD=qwerty
MAGPIE_POSTGRES_HOST=localhost
MAGPIE_POSTGRES_PORT=5432
MAGPIE_POSTGRES_DB=magpie
MAGPIE_URL=localhost/magpie
MAGPIE_URL=http://localhost/magpie
MAGPIE_SECRET=magpie
MAGPIE_ADMIN_GROUP=administrators
MAGPIE_ADMIN_USER=admin
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@

# pylint: disable=C0103,invalid-name

import json
import os
import re
import sys
import json

# If extensions (or modules to document with autodoc) are in another
# directory, add these directories to sys.path here. If the directory is
Expand Down
25 changes: 22 additions & 3 deletions docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,25 @@ Following settings define parameters required by `Twitcher`_ (OWS Security Proxy

.. note::
Using this parameter to define `Twitcher`_'s path assumes that it resides under the same server domain as the
`Magpie` instance being configured (ie: hostname is inferred from resolved ``MAGPIE_URL`` or equivalent settings).
`Magpie` instance being configured (ie: hostname is inferred from resolved value amongst ``MAGPIE_URL``,
``MAGPIE_HOST``, ``TWITCHER_HOST`` and ``HOSTNAME`` settings or environment variables).

.. warning::
Path is intended to be employed with `Twitcher`_ residing side-by-side with `Magpie`. Therefore, prefix
``/twitcher`` is added unless already explicitly provided. To employ another path without prefix, consider
instead providing it with the full URL using ``TWITCHER_PROTECTED_URL`` parameter.

- | ``TWITCHER_HOST``
| (Default: None)

.. versionadded:: 2.0.0

Specifies the explicit hostname to employ in combination with ``TWITCHER_PROTECTED_PATH`` to form the complete base
service protected URL. Ignored if ``TWITCHER_PROTECTED_URL`` was provided directly.

.. note::
The resulting URL will take the form ``https://{TWITCHER_HOST}[/twitcher]{TWITCHER_PROTECTED_PATH}`` to imitate
the resolution of ``TWITCHER_PROTECTED_URL`` considering provided ``TWITCHER_PROTECTED_PATH``.

- | ``TWITCHER_PROTECTED_URL``
| (Default: *see note*)
Expand All @@ -592,8 +610,9 @@ Following settings define parameters required by `Twitcher`_ (OWS Security Proxy
specifying an alternative domain where a remote `Twitcher`_ instance could reside.

.. note::
When not provided, attempts to infer the value by combining the environment variable ``HOSTNAME``, an optional
``/twitcher`` prefix (as needed to match incoming request) and the value provided by ``TWITCHER_PROTECTED_PATH``.
When not provided, attempts to infer the value by combining the environment variable ``HOSTNAME`` or
``TWITCHER_HOSTNAME``, and an optional ``/twitcher`` prefix (as needed to match incoming request) and the
value provided by ``TWITCHER_PROTECTED_PATH``.


Please note that although `Twitcher`_ URL references are needed to configure interactive parameters with `Magpie`, the
Expand Down
26 changes: 21 additions & 5 deletions docs/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ Glossary
identified through :term:`Authentication` methods. This process typically falls into the hands of a
:term:`Proxy` application.

Context User
Specific :term:`User` that is being targeted by a request from specified value for the ``{user_name}`` request
path variable. The contextual :term:`User` of the request *could* correspond to the :term:`Logged User` if the
reference resolves to itself, but this is not necessarily the case. See further details and examples provided
in section :ref:`Route Access`.

Cookies
Set of :term:`Authentication` identifiers primarily employed by `Magpie` HTTP requests to determine the
:term:`Logged User`.
Expand Down Expand Up @@ -75,11 +81,13 @@ Glossary
:py:data:`magpie.constants.MAGPIE_DEFAULT_PROVIDER` constant.

Logged User
Specific :term:`User` that corresponds to the active request session. This :term:`User` can automatically be
referenced to (instead of usual ``{user_name}`` path variable) in applicable requests using special value
configured with :py:data:`magpie.constants.MAGPIE_LOGGED_USER`. When not logged in, this
:term:`User` is considered to be :py:data:`magpie.constants.MAGPIE_ANONYMOUS_USER`. Otherwise, it is whoever
the :term:`Authentication` mechanism identifies.
More specific use-case of :term:`Request User` that simultaneously corresponds to the active request session
:term:`User` as well at the referenced :term:`Context User` from the path variable. This :term:`User` can be
automatically retrieved in applicable requests using in the request path the special constant value defined by
:py:data:`magpie.constants.MAGPIE_LOGGED_USER`, or using its literal :term:`User` name.
When not logged in, this :term:`User` is considered to be equivalent to explicitly requesting
:py:data:`magpie.constants.MAGPIE_ANONYMOUS_USER`. Otherwise, it is whoever the
:term:`Authentication` mechanism identifies with token extracted from request :term:`Cookies`.

Permission
Element that defines which rules are applicable for a given combination of :term:`User` and/or :term:`Group`
Expand All @@ -104,6 +112,14 @@ Glossary
to make them available to anyone including even unauthenticated sessions. See also :ref:`Public Access` section
for implementation details to achieve this result.

Request User
Active request session :term:`User` that can be retrieved by calling ``request.user`` with resolution of
:term:`Authentication` headers within the request (:term:`User` is ``None`` if unauthenticated,
i.e.: :py:data:`magpie.constants.MAGPIE_ANONYMOUS_USER`). This is not the same as the :term:`Context User`
extracted from ``{user_name}`` path variable, except for the special case covered by :term:`Logged User`'s
definition. The request :term:`User` could send request that work on another :term:`Context User` than itself
if sufficient :term:`Access Permission` is granted. See also :ref:`Route Access` for further details.

Resource
Entity on which :term:`User` and :term:`Group` can be associated to applicable :term:`Permission` respectively
for the contextual :term:`Service` under which it resides. This element can represent relatively *anything*.
Expand Down
18 changes: 16 additions & 2 deletions docs/installation.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
.. _installation:
.. include:: references.rst

************
=============
Installation
************
=============

At the command line::

Expand All @@ -29,3 +29,17 @@ If you want the full setup for development (including dependencies for test exec
You can run the Magpie container with a ``docker-compose.yml`` for a local setup (see `docker-compose.yml.example`_)

.. _`docker-compose.yml.example`: https://github.com/Ouranosinc/Magpie/tree/master/docker-compose.yml.example


Backward Compatibility
--------------------------

`Magpie` remains available for following obsolete and backward compatible versions.

- Python 2.7 (end of life on January 1st, 2020)
- Python 3.5 (end of life on September 13th, 2020)

Older versions than ones listed above are unsupported. These oldest versions remain tested in `Travis-CI` and deployment
procedure for traceability, but are not guaranteed to work, nor provide all functional or security features and will not
be actively maintained. If you identify a easy fix for such an older version, please submit an `issue`_ to be considered
for integration. It is greatly recommended to upgrade your Python version to receive all applicable security patches.
Loading