magpie.security
¶
Module Contents¶
Functions¶
|
Masks away any credential matched against |
|
Generates Magpie application configuration with all utilities required for security and access control. |
|
|
|
|
-
magpie.security.
mask_credentials
(container: magpie.typedefs.JSON, redact: magpie.typedefs.Str = '[REDACTED]', flags: Optional[List[Str]] = None, parent: Optional[Str] = None) → magpie.typedefs.JSON[source]¶ Masks away any credential matched against
flags
recursively from JSONcontainer
.Matched credential entries are replaced by
redact
. List items are all replaced by the sameredact
when theirparent
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.