Skip to content

Commit

Permalink
move STAC service Magpie definition under its component (#383)
Browse files Browse the repository at this point in the history
## Overview

Move STAC service definitions under `components/stac` configuration.

## Changes

**Non-breaking changes**
- Move initial ``stac`` service Magpie definition under its component configuration.
  - Before this change, ``optional-components/stac-public-access`` was mandatory since the ``stac`` service under
    Magpie was not created otherwise, leading to "*service not found*" error when requesting the ``/stac`` endpoint.
  - Ensure that the first ``stac`` resource under ``stac`` service in Magpie is created by default.
    Without this resource being defined initially, it is very easy to forget creating it, which would not take into
    account the required ``/stac/stac`` request path to properly resolve the real endpoints where STAC API is served.
- Remove `optional-components/stac-public-access` dependency under `optional-components/all-public-access`
  to avoid indirectly enforcing `components/stac` when `optional-components/all-public-access` is enabled.
  Users that desire using `optional-components/stac-public-access` will have to add it explicitly to the list
  of `EXTRA_CONF_DIRS`.

- Rename `optional-components/stac-public-access/config/magpie/config.yml.template` to
  `optional-components/stac-public-access/config/magpie/permissions.cfg` in order to align
  with permissions-specific contents as accomplished with other components.

**Breaking changes**
- n/a

## Related Issue / Discussion

- Relates to #382
  • Loading branch information
fmigneault authored Sep 21, 2023
2 parents f2f64c9 + e0a6e0d commit 7515db4
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 15 deletions.
18 changes: 17 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,23 @@
[Unreleased](https://github.com/bird-house/birdhouse-deploy/tree/master) (latest)
------------------------------------------------------------------------------------------------------------------

[//]: # (list changes here, using '-' for each new entry, remove this when items are added)
## Fixes

- Move initial ``stac`` service Magpie definition under its component configuration.
- Before this change, ``optional-components/stac-public-access`` was mandatory since the ``stac`` service under
Magpie was not created otherwise, leading to "*service not found*" error when requesting the ``/stac`` endpoint.
- Ensure that the first ``stac`` resource under ``stac`` service in Magpie is created by default.
Without this resource being defined initially, it is very easy to forget creating it, which would not take into
account the required ``/stac/stac`` request path to properly resolve the real endpoints where STAC API is served.

- Remove `optional-components/stac-public-access` dependency under `optional-components/all-public-access`
to avoid indirectly enforcing `components/stac` when `optional-components/all-public-access` is enabled.
Users that desire using `optional-components/stac-public-access` will have to add it explicitly to the list
of `EXTRA_CONF_DIRS`.

- Rename `optional-components/stac-public-access/config/magpie/config.yml.template` to
`optional-components/stac-public-access/config/magpie/permissions.cfg` in order to align
with permissions-specific contents as accomplished with other components.

[1.31.2](https://github.com/bird-house/birdhouse-deploy/tree/1.31.2) (2023-09-13)
------------------------------------------------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions birdhouse/components/stac/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
config/magpie/config.yml
config/proxy/conf.extra-service.d/stac.conf
config/canarie-api/canarie_api_monitoring.py
19 changes: 19 additions & 0 deletions birdhouse/components/stac/config/magpie/config.yml.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
providers:
# definition of STAC service for API access
stac:
url: http://stac:8000
title: STAC
public: true
c4i: false
type: api
sync_type: api

permissions:
# create a default 'stac' resource under 'stac' service
# because of the '/stac/stac' path prefix required to resolve the API links properly,
# all permissions must be nested under this 'stac' resource for requests and permissions to be resolved accordingly
- service: stac
resource: /stac
permission: read
group: administrator # they already have access, just using admins to create the resource by default
action: create
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
services:
magpie:
volumes:
- ./components/stac/config/magpie/config.yml:${MAGPIE_PROVIDERS_CONFIG_PATH}/stac.yml:ro
- ./components/stac/config/magpie/config.yml:${MAGPIE_PERMISSIONS_CONFIG_PATH}/stac.yml:ro
5 changes: 5 additions & 0 deletions birdhouse/optional-components/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@ How to enable in ``env.local`` (a copy from `env.local.example`_ (:download:`dow
The anonymous user will now have all the permissions described in |magpie-public-perms|_
(:download:`download </birdhouse/optional-components/all-public-access/all-public-access-magpie-permission.cfg>`).

.. note::
If using the ``./components/stac`` feature, the corresponding ``./optional-components/stac-public-access``
must be applied as well to obtain similar functionalities to ``./optional-components/all-public-access``.
This optional component is kept separate since ``./components/stac`` is not required by default, and therefore
cannot be enforced as a component dependency.

.. _magpie-public-perms: ./all-public-access/all-public-access-magpie-permission.cfg
.. |magpie-public-perms| replace:: optional-components/all-public-access/all-public-access-magpie-permission.cfg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@
# add any component that this component requires to run
COMPONENT_DEPENDENCIES="
./config/magpie
./optional-components/stac-public-access
"
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
config/magpie/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ version: "3.4"
services:
magpie:
volumes:
- ./optional-components/stac-public-access/config/magpie/config.yml:${MAGPIE_PERMISSIONS_CONFIG_PATH}/stac-public-access.yml:ro
- ./optional-components/stac-public-access/config/magpie/config.yml:${MAGPIE_PROVIDERS_CONFIG_PATH}/stac-public-access.yml:ro
- ./optional-components/stac-public-access/config/magpie/permissions.cfg:${MAGPIE_PERMISSIONS_CONFIG_PATH}/stac-public-access-permissions.cfg:ro
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
providers:
# definition of STAC service for API access
stac:
url: http://stac:8000
title: STAC
public: true
c4i: false
type: api
sync_type: api

permissions:
- service: stac
permission: read
Expand Down

0 comments on commit 7515db4

Please sign in to comment.