Module Contents



Complete the Magpie’s webhook call by calling Magpie temporary urls. Also keep service-shared resources in sync when



COOKIES_TIMEOUT[source] = 60[source]
class cowbird.typedefs.SettingsType, name: str, admin_user: str, admin_password: str, **kwargs: Any)[source]


Complete the Magpie’s webhook call by calling Magpie temporary urls. Also keep service-shared resources in sync when permissions are updated for one of them.

** Cowbird components diagram 1.2.0 needs to be update since Magpie can handle permissions synchronisation directly on permission update events. No need to handle them explicitly in nginx, thredds and geoserver classes.

Create the magpie instance and instantiate the permission synchronizer that will handle the permission events.

  • settings – Cowbird settings for convenience

  • name – Service name

  • admin_user – Magpie admin username used for login.

  • admin_password – Magpie admin password used for login.

_send_request(method: str, url: str, params: Optional[Any] = None, json: Optional[Any] = None)requests.Response[source]

Wrapping function to send requests to Magpie, which also handles login and cookies.


Returns the list of service types available on Magpie.

abstract get_resource_id(resource_full_name)[source]

Each service must provide this implementation required by the permission synchronizer.

The function needs to find the resource id in Magpie from the resource full name using its knowledge of the service. If the resource doesn’t already exist, the function needs to create it, again using its knowledge of resource type and parent resource type if required.

get_resources_tree(resource_id: int)List[source]

Returns the associated Magpie Resource object and all its parents in a list ordered from parent to child.

get_user_permissions(user: str)Dict[source]

Gets all user resource permissions.

get_group_permissions(grp: str)Dict[source]

Gets all group resource permissions.

abstract user_created(user_name)[source]
abstract user_deleted(user_name)[source]
create_permission(permissions_data: List[Dict[str, str]])None[source]

Make sure that the specified permission exists on Magpie.

delete_permission(permissions_data: List[Dict[str, str]])None[source]

Remove the specified permission from Magpie if it exists.


Login to Magpie app using admin credentials.