-
Notifications
You must be signed in to change notification settings - Fork 40
Customizable forms field names #31
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #31 +/- ##
==========================================
+ Coverage 98.1% 98.11% +<.01%
==========================================
Files 5 5
Lines 317 318 +1
Branches 42 42
==========================================
+ Hits 311 312 +1
Misses 3 3
Partials 3 3
Continue to review full report at Codecov.
|
awsprocesscreds/saml.py
Outdated
@@ -177,7 +178,7 @@ def _fill_in_form_values(self, config, form_data): | |||
username = config['saml_username'] | |||
if self.USERNAME_FIELD not in form_data: | |||
raise SAMLError( | |||
self._ERROR_MISSING_FORM_FIELD % self.USERNAME_FIELD) | |||
self._ERROR_MISSING_FORM_FIELD % (self.USERNAME_FIELD, ", ".join(form_data.keys()))) | |||
else: | |||
form_data[self.USERNAME_FIELD] = username | |||
if self.PASSWORD_FIELD in form_data: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The password field needs a field validation check too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Password field may not always be present in the form, for example, when user is remembered.
This is also taken into account in already-existing unit tests which explicitly check if missing password field will not break the program.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, fair enough - I didn't see that test. I was merely relaying my experience of mistyping the password field and not getting an error that it was missing on the form.
Customizable forms field names: user can specify non-default names of fields that are in ADFS HTML form.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.