Skip to content

Commit

Permalink
Merge pull request #2949 from CSCfi/2948/better-oidc-warning
Browse files Browse the repository at this point in the history
Improve OIDC config validation message
  • Loading branch information
aatkin authored Jun 6, 2022
2 parents 7306518 + b087160 commit 4c11462
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/clj/rems/validate.clj
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,13 @@

(defn validate []
(log/info "Validating configuration")
(when (:oidc-userid-attribute env)
(throw (ex-info "Please migrate to :oidc-userid-attributes" (select-keys env [:oidc-userid-attribute]))))
(when-let [old-attributes (some-> env :oidc-userid-attribute list flatten)]
(throw (ex-info "Please migrate to :oidc-userid-attributes"
(doall
{:from (select-keys env [:oidc-userid-attribute])
:to {:oidc-userid-attributes (vec
(for [attribute old-attributes]
{:attribute attribute}))}}))))

(log/info "Validating data")
(try
Expand Down

0 comments on commit 4c11462

Please sign in to comment.