{"id":16659782,"url":"https://github.com/bsless/aero.extensions","last_synced_at":"2025-03-12T20:44:36.316Z","repository":{"id":231268802,"uuid":"781345015","full_name":"bsless/aero.extensions","owner":"bsless","description":null,"archived":false,"fork":false,"pushed_at":"2024-04-04T06:27:58.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-08T19:34:36.819Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bsless.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-04-03T07:53:32.000Z","updated_at":"2024-04-03T07:59:37.000Z","dependencies_parsed_at":"2024-04-03T08:25:26.366Z","dependency_job_id":null,"html_url":"https://github.com/bsless/aero.extensions","commit_stats":null,"previous_names":["bsless/aero.extensions"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsless%2Faero.extensions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsless%2Faero.extensions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsless%2Faero.extensions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsless%2Faero.extensions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bsless","download_url":"https://codeload.github.com/bsless/aero.extensions/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243293771,"owners_count":20268139,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T10:26:36.049Z","updated_at":"2025-03-12T20:44:36.273Z","avatar_url":"https://github.com/bsless.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Clojars Project](https://img.shields.io/clojars/v/io.github.bsless/aero.extensions.svg)](https://clojars.org/io.github.bsless/aero.extensions)\n[![Clojars Project](https://img.shields.io/clojars/v/io.github.bsless/aero.extensions.svg?include_prereleases)](https://clojars.org/io.github.bsless/aero.extensions)\n[![cljdoc](https://cljdoc.org/badge/io.github.bsless/aero.extensions)](https://cljdoc.org/d/io.github.bsless/aero.extensions)\n![Test And Snapshot](https://github.com/bsless/aero.extensions/actions/workflows/test-and-snapshot.yml/badge.svg)\n\n# bsless/aero.extensions\n\nAero is awesome\n\nStill, it lacks about three features which would make it **shine**:\nAnother profile dimension, secrets, and secret readers\n\n## Usage\n\nUse aero normally and also load this extension library\n\n```clojure\n(require '[aero.core :as aero] '[bsless.aero.extensions])\n```\n\n### New tags\n\n#### `ext/mode`\n\nWorks exactly like profile, for when you need it\n\n#### `ext/secret`\n\nWraps the content in an opaque `deref`-able object.\nThis way printing the loaded configuration won't leak a secret\n\n#### `ext/read-secret`\n\nHaving secrets in a config file is convenient, but how can we get them there?\n\n```clojure\n#ext/read-secret \"path/to/secret\"\n;; or\n#ext/read-secret [:just/whatever \"path/to/secret\"]\n```\n\nPass a `:secret-reader` to `aero.core/read-config` and let it resolve\nthe secret according to the specified value at resolution time.\n\nExample - vault client, reader for encryped files\n\n#### `malli/schema`\n\nWhen some value in your configuration has to conform to a schema\n\n```clojure\n#malli/schema [:int 1] ;; pass\n#malli/schema [:int \"1\"] ;; fail\n#malli/schema [[:int {:min 2}] 1] ;; fail\n```\n\nUse a vector of `[schema value]`.\n\nOptionally pass a `:malli/transformer` when reading the configuration to coerce values.\nThe second example would pass with\n\n```clojure\n(read-config \"config.edn\" {:malli/transformer mt/string-transformer})\n```\n\nImportant note: malli isn't included on the class path. Bring it in as an extra dependency.\n\n### Example\n\nGiven the config\n\n```clojure\n#ext/mode {:fizz #ext/read-secret #profile {:bar \"foo/bar\" :baz \"foo/baz\"}\n           :buzz #profile {:bar 1 :baz 2}}\n```\n\nIt will resolve to:\n\n```clojure\n(read-config config {:profile :bar :mode :fizz :secret-reader {\"foo/bar\" :foo}})\n;; =\u003e\n(Secret. :foo)\n```\n\nKeep in mind the secret will print as `\u003cSecret ...\u003e`\n\n## License\n\nCopyright © 2024 Ben Sless\n\nDistributed under the Eclipse Public License version 1.0.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbsless%2Faero.extensions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbsless%2Faero.extensions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbsless%2Faero.extensions/lists"}