VaultScrubber#

class scikitplot.cleanprompt.VaultScrubber(owner=None)[source]#

Keep a vault’s values out of every log record for as long as it holds them.

Notes

User notes. You do not create one: Cleaner, Guard and Session do, and it lives exactly as long as they hold values. While it lives, any record from this submodule that would contain a removed value carries <redacted> instead.

Developer notes. Surfaces go into one shared, counted filter. They are released by close and, if the owner is dropped without being closed, by a weakref.finalize on the owner — a surface left in the filter would otherwise keep the secrets of every cleaner the process ever made, which is the leak it exists to prevent.

Parameters:

owner (object | None)

add(secrets)[source]#

Scrub these surfaces too.

Parameters:

secrets (Iterable[str])

Return type:

None

close()[source]#

Stop scrubbing this vault’s surfaces and forget them.

Return type:

None