Fork me on GitHub
#juxt
<
2020-02-14
>
caio14:02:26

sup! I'm starting to use aero and got a question: is there a way of defining a default behavior for #profile ? just to avoid this type of repetition:

{:jwt-pub-key  #profile {:local   #pub-key "auth/jwt_id_rsa.pub.pem"
                         :dev     #ref [:secrets :jwt-pub-key]
                         :sandbox #ref [:secrets :jwt-pub-key]
                         :prod    #ref [:secrets :jwt-pub-key]}}

p-himik15:02:52

#or [#profile {...} #ref [...]] should work.

caio15:02:18

well.. that's embarrassingly obvious lol. thanks!

👍 4
dharrigan15:02:44

there is also :default

👍 4
💯 4
caio15:02:53

awesome, thanks! btw, can I get a "code review" here? 😂 just to check if I'm not doing something wrong: https://gist.github.com/caioaao/d8aefd60b110d92ab89b7aef28e34aa4 the motivating example is under the implementation and it's something like this config that I wanted to support:

{:jwt-priv-key #priv-key #profile {:dev     #io/resource "jwt_key.pem"
                                   :default {:path       #join [#env HOME "/.keys/jwt_key.pem"]
                                             :passphrase #ref [:secrets :jwt-priv-key :passphrase]}}}
my two doubts are if I'm implementing the priv-key literal right (the config can either be a path or a map containing :path and :passphrase) and if the #io/resource + aero/root-resolver combination is an anti-pattern for some reason

caio16:02:13

it looks like it's working btw

tumbleweed 4