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

Expose inspect-secrets in the clojure api #2

Open
jjttjj opened this issue Feb 15, 2024 · 0 comments
Open

Expose inspect-secrets in the clojure api #2

jjttjj opened this issue Feb 15, 2024 · 0 comments
Labels
good first issue Good for newcomers

Comments

@jjttjj
Copy link
Member

jjttjj commented Feb 15, 2024

Currently secrets inspect can be done via the command line, but it also can be nice to do this from the repl. Copying the code here, we could just do

(defn inspect-secrets []
  (secrets/with-secrets
    (pprint/pprint
      (walk/postwalk
        (fn [x]
          (try
            ;; Replace any "leaves" (the bottom levels of the hierarchy, i.e.
            ;; the actual secrets)
            (let [is-leaf? (and (map-entry? x) (not (map? (val x))))]
              (if is-leaf?
                [(key x) "***"]
                x))
            (catch Throwable ex)))
        (secrets/secrets)))))

Any reason not to add this (and make the cli function use it)?

@jjttjj jjttjj added the good first issue Good for newcomers label Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant