Skip to content

Commit

Permalink
doc patches
Browse files Browse the repository at this point in the history
  • Loading branch information
fmigneault committed Oct 29, 2020
1 parent 3f40dc4 commit 15ba47f
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 29 deletions.
15 changes: 0 additions & 15 deletions docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,6 @@ at the start of the `Configuration`_ section.
within the `themes`_ subdirectory.


.. _themes: https://github.com/Ouranosinc/Magpie/tree/master/magpie/ui/home/static/themes


Security Settings
~~~~~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -768,18 +765,6 @@ this :term:`Authentication` procedure.
Websites), rarely used authentication bridges by the developers could break without prior notice. If this is the
case and you use one of the broken connectors, summit a new `issue`_.

.. _OpenID: https://openid.net/
.. _ESGF: https://esgf.llnl.gov/
.. _DKRZ: https://esgf-data.dkrz.de
.. _IPSL: https://www.ipsl.fr/
.. _BADC: http://data.ceda.ac.uk/badc
.. _CEDA: https://esgf-index1.ceda.ac.uk
.. _LLNL: https://www.llnl.gov/
.. _PCMDI: http://pcmdi.llnl.gov
.. _SMHI: https://www.smhi.se
.. _GitHub: https://developer.github.com/v3/#authentication
.. _WSO2: https://wso2.com/
.. _MagpieSecurity: https://github.com/Ouranosinc/Magpie/tree/master/magpie/security.py

GitHub Settings
~~~~~~~~~~~~~~~~~
Expand Down
2 changes: 0 additions & 2 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ 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
--------------------------
Expand Down
11 changes: 6 additions & 5 deletions docs/permissions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
Permissions
===========

.. _permission_types:

Types of Permissions
-----------------------

Expand Down Expand Up @@ -173,7 +175,6 @@ value that implicitly retrieves the :term:`Request User` as the :term:`Context U
some additional request-specific logic (depending on its purpose and resulting actions) for special-cases that is
not explicitly detailed in above steps. Some of these special behaviors can be observed across the various `tests`_.

.. _tests: https://github.com/Ouranosinc/Magpie/tree/master/tests

Finally, it is worth further detailing the small distinction between
:py:data:`magpie.constants.MAGPIE_LOGGED_PERMISSION` and :py:data:`magpie.constants.MAGPIE_CONTEXT_PERMISSION`,
Expand Down Expand Up @@ -236,7 +237,7 @@ to execute `Magpie` application. Effectively, when the active session correspond
Example to distinguish Applied, Inherited and Effective Permissions
--------------------------------------------------------------------------------------

This section intends to provide more insight on the different :ref:`Types of Permissions` using a simplified
This section intends to provide more insight on the different :ref:`permission_types` using a simplified
demonstration of interaction between defined :term:`Service`, :term:`Resource`, :term:`Group`, :term:`User` and
:term:`Permission` elements.

Expand Down Expand Up @@ -312,7 +313,7 @@ On the other hand, using ``effective`` would result in the following:
/users/example-user/resources/resource-B1/permissions?effective=true => [read] (2)
/users/example-user/resources/resource-B2/permissions?effective=true => [read, write] (4)
In this case, :term:`Resource`s that had :term:`Permission` directly set on them :sup:`(2)`, whether through
In this case, all :term:`Resource` entries that had :term:`Permission` directly set on them :sup:`(2)`, whether through
:term:`User` or :term:`Group` combination, all return the exact same set of :term:`Permission`. This is because
`Effective Permissions`_ always imply `Inherited Permissions`_ (i.e.: using both query simultaneously is redundant).
The reason why we obtain these sets for cases :sup:`(2)` is also because there is no other :term:`Permission` applied
Expand Down Expand Up @@ -358,7 +359,7 @@ This query can be extremely useful to quickly answer *"does the user have any pe
without needing to manually execute multiple successive lookup requests with all combinations of :term:`Resource`
identifiers in the hierarchy.

.. _permission_modifiers::
.. _permission_modifiers:

Permissions Definition and Modifiers
--------------------------------------
Expand Down Expand Up @@ -483,4 +484,4 @@ Therefore, it can be noted that all API responses that contain details about per

It can be noted that the JSON representation also provides a fourth ``type`` parameter which serves as indicative
detail about the kind of :term:`Permission` being displayed, in attempt to reduce the ambiguity described in
:ref:`Types of Permissions`.
:ref:`permission_types`.
19 changes: 19 additions & 0 deletions docs/references.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,29 @@
.. _Waitress: https://github.com/Pylons/waitress
.. _Ziggurat-Foundations: https://github.com/ergo/ziggurat_foundations

.. external providers
.. _OpenID: https://openid.net/
.. _ESGF: https://esgf.llnl.gov/
.. _DKRZ: https://esgf-data.dkrz.de
.. _IPSL: https://www.ipsl.fr/
.. _BADC: http://data.ceda.ac.uk/badc
.. _CEDA: https://esgf-index1.ceda.ac.uk
.. _LLNL: https://www.llnl.gov/
.. _PCMDI: http://pcmdi.llnl.gov
.. _SMHI: https://www.smhi.se
.. _GitHub: https://developer.github.com/v3/#authentication
.. _WSO2: https://wso2.com/

.. file/source references
.. _configuration: configuration.rst
.. _constants.py: https://github.com/Ouranosinc/Magpie/tree/master/magpie/constants.py
.. _`docker-compose.yml.example`: https://github.com/Ouranosinc/Magpie/tree/master/docker-compose.yml.example
.. _magpie-con: https://github.com/Ouranosinc/Magpie/tree/master/magpie-cron
.. _magpie.env.example: https://github.com/Ouranosinc/Magpie/tree/master/env/magpie.env.example
.. _magpie.ini: https://github.com/Ouranosinc/Magpie/tree/master/config/magpie.ini
.. _MagpieSecurity: https://github.com/Ouranosinc/Magpie/tree/master/magpie/security.py
.. _permissions.cfg: https://github.com/Ouranosinc/Magpie/tree/master/config/permissions.cfg
.. _postgres.env.example: https://github.com/Ouranosinc/Magpie/tree/master/env/postgres.env.example
.. _providers.cfg: https://github.com/Ouranosinc/Magpie/tree/master/config/permissions.cfg
.. _themes: https://github.com/Ouranosinc/Magpie/tree/master/magpie/ui/home/static/themes
.. _tests: https://github.com/Ouranosinc/Magpie/tree/master/tests
10 changes: 5 additions & 5 deletions docs/services.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
.. _services:
.. include:: references.rst

.. employ the permissions as base for this chapter to ease reading by shorter reference definitions
.. py:currentmodule:: magpie.permissions
===========
Services
===========
Expand All @@ -25,7 +22,7 @@ Therefore, they can be listed and searched for either using ``/services`` API ro
On top of any :term:`Resource`'s metadata, a :term:`Service` provides specific information about its location, its
remote synchronization method (if any), and its exposed endpoint. Another important detail about the :term:`Service`
is its ``type``. This will not only dictate its purpose, but also define the whole schema of allowed :term:`Resource`
under it (if any), as well as every one of their :ref:`Allowed Permissions`.
under it (if any), as well as every one of their :term:`Allowed Permissions`.

The final distinction between a :term:`Service` and generic :term:`Resource` is their position in the hierarchy. Only
:term:`Service`-specialized :term:`Resource` (literally ``resource_type = "service"``) are allowed to be placed at the
Expand Down Expand Up @@ -89,6 +86,9 @@ On top of the above methods, the following attributes must be defined.
Available Services
-------------------

.. employ the permissions as base for this section to ease reading by shorter reference definitions
.. py:currentmodule:: magpie.permissions
.. seealso::
Module :py:mod:`magpie.services` contains the implementation of every :term:`Service` presented below.

Expand Down Expand Up @@ -148,7 +148,7 @@ each sub-:term:`Resource` as presented below.
Every :class:`magpie.models.Route` as well as the :term:`Service` itself can have the :term:`Permission` based on the
HTTP method of the incoming request. All :class:`Access` and :class:`Scope` modifiers are also supported for highly
customizable :term:`ACL` combinations. See `permission_modifiers`_ for further details.
customizable :term:`ACL` combinations. See :ref:`permission_modifiers` for further details.

ServiceTHREDDS
~~~~~~~~~~~~~~~~~~~~~
Expand Down
2 changes: 0 additions & 2 deletions docs/utilities.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ Available helpers:
- | Synchronizes local and remote resources based on `Magpie` service's ``sync-type`` methodology.
| See also `magpie-con`_.
.. _configuration: configuration.rst
.. _magpie-con: https://github.com/Ouranosinc/Magpie/tree/master/magpie-cron

For convenience, a generic CLI ``magpie_helper`` is also provided which allows calling each of the other helper
operations as *mode*. You can therefore do as follows.
Expand Down

0 comments on commit 15ba47f

Please sign in to comment.