This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-03-31
Channels
- # announcements (20)
- # asami (14)
- # aws (6)
- # babashka (15)
- # beginners (83)
- # biff (6)
- # calva (93)
- # cider (3)
- # clj-kondo (21)
- # cljdoc (106)
- # cljs-dev (32)
- # clojure (165)
- # clojure-dev (78)
- # clojure-europe (54)
- # clojure-italy (9)
- # clojure-nl (9)
- # clojure-norway (24)
- # clojure-uk (4)
- # clojurescript (6)
- # community-development (2)
- # conjure (2)
- # core-typed (14)
- # datahike (4)
- # datomic (2)
- # emacs (40)
- # events (1)
- # fulcro (11)
- # graalvm-mobile (29)
- # graphql (8)
- # honeysql (19)
- # java (1)
- # jobs (1)
- # lsp (232)
- # malli (5)
- # membrane (112)
- # nextjournal (11)
- # off-topic (63)
- # portal (12)
- # re-frame (6)
- # reagent (3)
- # reitit (4)
- # rewrite-clj (2)
- # shadow-cljs (25)
- # tools-deps (6)
Doing some fun stuff with the clojure reader and just found out you could reify clojure.lang.LispReader$Resolver in bb 🤯
Is there a way to reify a protocol without loading the namespace? I wanted to reify cognitect.aws.credentials/CredentialsProvider but loading in bb there are some classes missing
java.util.concurrent.ExecutorService
my use case would be fixed with https://github.com/cognitect-labs/aws-api/issues/170 as well because I just want to provide the session token with a basic creds provider
I did a workaround now where I use system property creds providerThe docs seem to suggest that the arg vec position is preferred: https://clojure.org/reference/java_interop#typehints
the protocol I want to reify is defined herre https://github.com/cognitect-labs/aws-api/blob/master/src/cognitect/aws/credentials.clj
(def
client
(aws/client
{:api :athena
:region "us-east-1"
:credentials-provider
(let [access-key-id (config-get "aws_access_key_id")
secret-access-key (config-get "aws_secret_access_key")
token (config-get "aws_session_token")]
(reify cognitect.aws.credentials/CredentialsProvider
(fetch [_]
{:aws/access-key-id access-key-id
:aws/secret-access-key secret-access-key
:aws/session-token token})))}))
interesting part:
(reify cognitect.aws.credentials/CredentialsProvider
(fetch [_]
{:aws/access-key-id access-key-id
:aws/secret-access-key secret-access-key
:aws/session-token token}))
Credentials in the AWS pod are not supported through reify. It supports it in a custom way, see here: https://github.com/babashka/pod-babashka-aws#credentials
yea indeed I wanted to use basic creds provider but I need the session token https://github.com/cognitect-labs/aws-api/issues/170 . So when that is merged my issue if fixed, until then I just workaround with system properties provider, so it's fine