Skip to content

Expose inspect-secrets in the clojure api #2

@jjttjj

Description

@jjttjj

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)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions