canonical / craft-cli

https://canonical-craft-cli.readthedocs-hosted.com/en/latest/
GNU Lesser General Public License v3.0
9 stars 15 forks source link

feat: add secrets API #185

Closed tigarmo closed 10 months ago

tigarmo commented 11 months ago

The public API consists of a single method, Emitter.set_secrets(), that receives a list of strings and causes said strings to be masked by "*****" in every output generated by the emitter's printer. This includes regular emitter messages, messages generated by log calls, spinner, progress bar and the "streaming brief" prefix.

Fixes #184

(CRAFT-2107)

codecov[bot] commented 11 months ago

Codecov Report

Merging #185 (3c01ca4) into main (bba9e00) will increase coverage by 0.06%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #185      +/-   ##
==========================================
+ Coverage   94.62%   94.68%   +0.06%     
==========================================
  Files           7        7              
  Lines        1041     1053      +12     
  Branches      189      191       +2     
==========================================
+ Hits          985      997      +12     
  Misses         53       53              
  Partials        3        3              
Files Coverage Δ
craft_cli/messages.py 100.00% <100.00%> (ø)
craft_cli/printer.py 100.00% <100.00%> (ø)