diff --git a/src/cognitect/aws/config.clj b/src/cognitect/aws/config.clj index 4bf929d8..66ca86ed 100644 --- a/src/cognitect/aws/config.clj +++ b/src/cognitect/aws/config.clj @@ -16,7 +16,7 @@ (str/starts-with? s "[")) (defn start-nested? [s] - (re-find #"=$" s)) + (re-find #"^[\w-_]+\s*=$" s)) (defn add-profile-kv? [s] (re-find #"^[\w-_]+\s*=.*\w+" s)) diff --git a/test/resources/.aws/config b/test/resources/.aws/config index b134330e..a7bf48a8 100644 --- a/test/resources/.aws/config +++ b/test/resources/.aws/config @@ -15,3 +15,6 @@ s3 = region = eu-west-1 s3 = max_queue_size=1000 + +[temp-credentials] +aws_session_token = FQoG/Ehj40mh/xf0TR+xLl+cp/xGWC+haIy+fJh6/fD+LFW= diff --git a/test/src/cognitect/aws/config_test.clj b/test/src/cognitect/aws/config_test.clj index 1cfa6924..ddfa20d4 100644 --- a/test/src/cognitect/aws/config_test.clj +++ b/test/src/cognitect/aws/config_test.clj @@ -17,7 +17,9 @@ (get config "nested"))) (is (re-matches #"^awsprocesscreds.*specialness$" - (get-in config ["waterbear" "credential_process"]))))) + (get-in config ["waterbear" "credential_process"]))) + (is (= "FQoG/Ehj40mh/xf0TR+xLl+cp/xGWC+haIy+fJh6/fD+LFW=" + (get-in config ["temp-credentials" "aws_session_token"]))))) (comment (run-tests)