Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SecretBlock secrets not obfuscated #9

Closed
hanscgruber opened this issue Nov 22, 2023 · 2 comments
Closed

SecretBlock secrets not obfuscated #9

hanscgruber opened this issue Nov 22, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@hanscgruber
Copy link
Contributor

using PrefectInterfaces
import PrefectInterfaces: SecretBlock

sblk = SecretBlock("poo", "patype", "abc123")
SecretBlock("poo", "patype", ####Secret####)

show(sblk)
SecretBlock("poo", "patype", ####Secret####)
dump(sblk)
SecretBlock
  blockname: String "poo"
  blocktype: String "patype"
  value: SecretString
    secret: String "abc123"

The existing method definition is not effective, move it up to a higher level of the Base.dump method definition.

Base.dump(io::IO, s::SecretString; maxdepth=1) = print(io, "SecretString")

# should be

Base.dump(io::IOContext, s::SecretString, n::Int64, indent) = print(io, "SecretString")

Then the recursive dump definition will pick this up when it finds a SecretString.

@hanscgruber
Copy link
Contributor Author

# prefectblocktypes.jl

Base.dump(io::IOContext, s::SecretString, n::Int64, indent) = print(io, "SecretString")

Now it works fine

sblk = SecretBlock("poo", "patype", "abc123")
SecretBlock("poo", "patype", ####Secret####)

dump(sblk)
SecretBlock
  blockname: String "poo"
  blocktype: String "patype"
  value: SecretString

dump(sblk; maxdepth = 8)
SecretBlock
  blockname: String "poo"
  blocktype: String "patype"
  value: SecretString

sblk.value
####Secret####

dump(sblk.value)
SecretString

sblk.value.secret
"abc123"

@mahiki
Copy link
Owner

mahiki commented Nov 26, 2023

It works, good job everybody. Now gotta figure out how TagBot works and get the release to go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants