magpie.security

Module Contents

Functions

mask_credentials(→ magpie.typedefs.JSON)

Masks away any credential matched against flags recursively from JSON container.

get_auth_config(→ pyramid.config.Configurator)

Generates Magpie application configuration with all utilities required for security and access control.

authomatic_setup(request)

authomatic_config([request])

get_providers(→ magpie.typedefs.JSON)

Attributes

AUTHOMATIC_LOGGER

LOGGER

magpie.security.AUTHOMATIC_LOGGER[source]
magpie.security.LOGGER[source]
magpie.security.mask_credentials(container: magpie.typedefs.JSON, redact: magpie.typedefs.Str = '[REDACTED]', flags: List[magpie.typedefs.Str] | None = None, parent: magpie.typedefs.Str | None = None) magpie.typedefs.JSON[source]

Masks away any credential matched against flags recursively from JSON container.

Matched credential entries are replaced by redact. List items are all replaced by the same redact when their parent field name is matched.

Parameters:
  • container – JSON container to mask. If starting with a list on top-level, first level children will not be masked unless parent is provided.

  • redact – string by which to replace flagged fields.

  • flags – field names (partial matches) to flag for masking.

  • parent – reference to contained elements if in a listing format rather than mapping.

Returns:

masked credentials JSON container.

magpie.security.get_auth_config(container: magpie.typedefs.AnySettingsContainer) pyramid.config.Configurator[source]

Generates Magpie application configuration with all utilities required for security and access control.

magpie.security.authomatic_setup(request)[source]
magpie.security.authomatic_config(request=None)[source]
magpie.security.get_providers() magpie.typedefs.JSON[source]