Skip to content

Commit

Permalink
fix config parsing bug
Browse files Browse the repository at this point in the history
Fixes #46
  • Loading branch information
dchelimsky committed Jan 23, 2019
1 parent fa8cf3a commit 76543d1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/cognitect/aws/config.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
3 changes: 3 additions & 0 deletions test/resources/.aws/config
Original file line number Diff line number Diff line change
Expand Up @@ -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=
4 changes: 3 additions & 1 deletion test/src/cognitect/aws/config_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 76543d1

Please sign in to comment.