)]}'
{
  "commit": "55bc65ceaef6bc04b4dd163bc679c203355c4877",
  "tree": "a0a9a35cc9e8c0e2539e169bb1fe3249c74eaa23",
  "parents": [
    "8613bfa353f27c736273fa132a6a61a50fc7556b"
  ],
  "author": {
    "name": "Heschi Kreinick",
    "email": "heschi@google.com",
    "time": "Fri Feb 11 15:41:27 2022 -0500"
  },
  "committer": {
    "name": "Heschi Kreinick",
    "email": "heschi@google.com",
    "time": "Wed Feb 16 19:41:17 2022 +0000"
  },
  "message": "internal/secret: add flag support\n\nTo avoid hardcoding secret names everywhere, we want to pass them via\nflags instead. As a convenience, introduce a new flag type that resolves\nvalues of the form \"secret:[project name/]\u003csecret name\u003e\" using Secret\nManager.\n\nThis is a bit janky in the name of convenience: we need a SM client\nbefore calling flag.Parse, which I decided should be initialized by the\nuser rather than implicitly. Typical usage will look like:\n\n  var token \u003d secret.Flag(\"token\", \"token used to do the thing\")\n\n  func main() {\n    if err :\u003d secret.InitFlagSupport(context.Background()); err !\u003d nil {\n      log.Fatal(err)\n    }\n    flag.Parse()\n    fmt.Printf(\"My token is %v\\n\", *token)\n  }\n\nSupporting literal values might be unnecessary but I think it might be\nhelpful for local testing, and we can extend it with a file: prefix to\nread from local files too.\n\nFor golang/go#51122.\n\nChange-Id: Ie6102453c2242baf2e91b873e62e035f72a82584\nReviewed-on: https://go-review.googlesource.com/c/build/+/385185\nTrust: Heschi Kreinick \u003cheschi@google.com\u003e\nRun-TryBot: Heschi Kreinick \u003cheschi@google.com\u003e\nReviewed-by: Dmitri Shuralyov \u003cdmitshur@golang.org\u003e\nAuto-Submit: Heschi Kreinick \u003cheschi@google.com\u003e\nTryBot-Result: Gopher Robot \u003cgobot@golang.org\u003e\n",
  "tree_diff": [
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "6a860ca96d00a0200b2f526c21ebb647f971c244",
      "new_mode": 33188,
      "new_path": "internal/secret/flag.go"
    },
    {
      "type": "modify",
      "old_id": "9759218f425b36c6a9c710b6e914c0b5d7dffb3c",
      "old_mode": 33188,
      "old_path": "internal/secret/gcp_secret_manager_test.go",
      "new_id": "b4671c2e4f0d4e26552dae387804cc3a960bc412",
      "new_mode": 33188,
      "new_path": "internal/secret/gcp_secret_manager_test.go"
    }
  ]
}
