Commit Graph

127 Commits

Author SHA1 Message Date
Douwe Maan 8399de0c96 Normalize LDAP DN when looking up identity 2017-10-31 17:13:50 +01:00
Michael Kozono 8c29a04549 Leave bad DNs alone instead of raising errors 2017-10-07 10:28:13 -07:00
Michael Kozono 1d1ad7e0b6 Refactor DN error classes 2017-10-07 10:28:13 -07:00
Michael Kozono 6b9229466d Normalize values, reusing DN normalization code
I first attempted to extract logic from the code that normalizes DNs, but I was unsuccessful. This is a hack but it works.
2017-10-07 10:28:13 -07:00
Michael Kozono ed07faf284 Remove telephoneNumber format comment
Since that behavior changed, and is now under the malformed DN context.
2017-10-07 10:28:13 -07:00
Michael Kozono 689eea5a43 Fix space stripping
Especially from the last attribute value.
2017-10-07 10:28:13 -07:00
Michael Kozono 714f264d62 Rename method to `to_normalized_s` 2017-10-07 10:28:13 -07:00
Michael Kozono b3d61832c3 Move downcasing to normalize method 2017-10-07 10:28:13 -07:00
Michael Kozono 14ed20d68a Resolve Rubocop offenses
Disabling some for now since this is based on `Net::LDAP::DN`.
2017-10-07 10:28:13 -07:00
Michael Kozono 45ab20dca9 Switch to new DN class
for normalizing and parsing DNs
2017-10-07 10:28:13 -07:00
Michael Kozono fe46c11de8 Fix newline tests 2017-10-07 10:28:13 -07:00
Michael Kozono 26054114be Fix trailing escaped newline 2017-10-07 10:28:13 -07:00
Michael Kozono 1480cf84d8 Add valid DN tests using OIDs 2017-10-07 10:28:13 -07:00
Michael Kozono 66030b03dd Test malformed DNs 2017-10-07 10:28:13 -07:00
Michael Kozono 8bd59f3aeb Raise UnsupportedDnFormatError on multivalued RDNs 2017-10-07 10:28:13 -07:00
Michael Kozono 47dff608f4 Allow unescaped, non-reserved Unicode characters 2017-10-07 10:28:13 -07:00
Michael Kozono f610fea777 Handle CR and LF characters 2017-10-07 10:28:13 -07:00
Michael Kozono 1e7ff892c0 Fix escaped hex comma test 2017-10-07 10:28:13 -07:00
Michael Kozono f9283b8b18 Reword escaped comma test 2017-10-07 10:28:12 -07:00
Michael Kozono c79879f33a Fix escaped equal signs 2017-10-07 10:28:12 -07:00
Michael Kozono e65bf3fa63 Clarify test 2017-10-07 10:28:12 -07:00
Michael Kozono cb591f86e4 Fix to_s_normalize for escaped leading space 2017-10-07 10:28:12 -07:00
Michael Kozono 91f2492a78 Add `DN#to_s_normalized` 2017-10-07 10:28:12 -07:00
Michael Kozono aefc96ca27 Rely on LDAP providers giving DNs, not UIDs 2017-10-07 10:28:12 -07:00
Michael Kozono 010cd3dea8 Rescue DN normalization attempts 2017-10-07 10:28:12 -07:00
Michael Kozono 79b5cbded7 Note invalid DNs 2017-10-07 10:28:12 -07:00
Michael Kozono ca5ade22f3 Fix `dn?` for a UID with an escaped equal sign 2017-10-07 10:28:12 -07:00
Michael Kozono fee3c95d75 Remove redundant `is_` 2017-10-07 10:28:12 -07:00
Michael Kozono 3e83ba34d1 Dry up spec some more
…to stop copy pasting test cases.
2017-10-07 10:28:12 -07:00
Michael Kozono a3ec58dacf Downcase normalized LDAP DNs and UIDs 2017-10-07 10:28:12 -07:00
Michael Kozono 4ae32d9577 Fix normalize behavior for escaped delimiter chars 2017-10-07 10:28:12 -07:00
Michael Kozono f1773640bf Refactor spec 2017-10-07 10:28:12 -07:00
Michael Kozono abe570cd0b Refactor to distinguish between UIDs and DNs 2017-10-07 10:28:12 -07:00
Michael Kozono 42bc6caee0 Trim extraneous spaces from DNs 2017-10-07 10:28:12 -07:00
Alexander Keramidas 4df54f2607 Profile updates from providers 2017-09-06 16:38:52 +03:00
Douwe Maan c1cf5f4101 Support simple string LDAP attribute specifications, and search for name rather than username attributes 2017-08-23 22:06:22 +02:00
Robert Speicher 4edfad9678 Enable Layout/TrailingWhitespace cop and auto-correct offenses 2017-08-15 13:44:37 -04:00
Rémy Coutable c946ee1282
Enable the Layout/SpaceBeforeBlockBraces cop
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-08-09 11:52:22 +02:00
Rémy Coutable cddc5cacfb Use described_class when possible
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-07-27 14:31:53 +02:00
Rémy Coutable ddccd24c13 Remove superfluous lib: true, type: redis, service: true, models: true, services: true, no_db: true, api: true
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-07-27 14:31:53 +02:00
Casper a5d2ce8e61 Use LDAP-attributes configured in gitlab.yml in lookup instead of just hard-coded attributes. 2017-07-26 16:48:13 +00:00
Michael Kozono 7f92a36a36 Fix plain LDAP (no encryption) 2017-07-26 02:43:40 -07:00
Michael Kozono 72d8b1e40a Move backwards compatibility logic out of the code
And closer to the configuration setup. The code doesn’t need to know about this.
2017-07-26 02:43:36 -07:00
Michael Kozono 2d7d1fa69d Pass configured `ssl_version` to `omniauth-ldap` 2017-07-26 02:43:36 -07:00
Michael Kozono c8dd77de81 Pass configured `ca_file` to `omniauth-ldap` 2017-07-26 02:43:35 -07:00
Michael Kozono cd13e4ae73 Verify certificates in `omniauth-ldap` 2017-07-26 02:43:35 -07:00
Michael Kozono 612b386450 Set `Net::LDAP` `ssl_version` option 2017-07-26 02:43:34 -07:00
Michael Kozono dcc12505aa Set `Net::LDAP` `ca_file` option 2017-07-26 02:43:34 -07:00
Michael Kozono b67c007842 Set `Net::LDAP` encryption properly 2017-07-26 02:43:33 -07:00
Michael Kozono 94b4c9f34f Use encryption instead of method
The method key is deprecated in the `gitlab_omniauth-ldap` gem.
2017-07-26 02:43:33 -07:00