Project

General

Profile

Bug #7898

Error when adding a LDAP Auth Source

Added by Björn Dieding over 4 years ago. Updated 11 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Authorization
Target version:
Difficulty:
trivial
Triaged:
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

Hi,

I have this error (see screenshot) when adding an ldap source. I am using a recent nightly build. 1.7.0-develop. Unfortunatell I can`t provide more information.

Unbenannt.PNG View Unbenannt.PNG 118 KB Björn Dieding, 10/10/2014 06:10 AM
Unbenannt2.PNG View Unbenannt2.PNG 79.3 KB Björn Dieding, 10/10/2014 06:44 AM
Unbenannt Unbenannt2

Related issues

Related to Foreman - Feature #4386: implement gem friendly_id to simply find by id, name, label, etcClosed2014-02-19

Associated revisions

Revision f4cecb48 (diff)
Added by Shlomi Zadok over 4 years ago

fixes #7898 - ensure that format can respond to json / yaml

History

#1 Updated by Dominic Cleal over 4 years ago

  • Legacy Backlogs Release (now unused) deleted (21)

Looks like it's due to https://github.com/rails/rails/issues/7837

In a couple of places in app/controllers/application_controller.rb we test request.format, but it may be nil. We should use request.format.try(:json?) or check for nil explicitly.

To reproduce, add ?format=weird to the request URL on any page. I can't think why this would be affecting the LDAP page in particular.

#2 Updated by Björn Dieding over 4 years ago

I can confirm with the next screenshot that the error is the same when I add "?format=weird".

#3 Updated by Dominic Cleal over 4 years ago

Ah, I see how to reproduce it!

1. add an LDAP auth source called "test.foo" (e.g. server: ldap.forumsys.com)
2. edit the LDAP auth source + save

The "test.foo" is part of the URL because it's the identifier for the auth source, but ".foo" causes Rails to interpret that as the request format. That's potentially dangerous, if you added "test.yaml" it might cause a formatting change.. we should probably remove "." from the resource identifiers?

Setting back to 1.7.0 as I guess this might be a friendly_id related regression.

#4 Updated by Dominic Cleal over 4 years ago

  • Related to Feature #4386: implement gem friendly_id to simply find by id, name, label, etc added

#5 Updated by Dominic Cleal over 4 years ago

  • Legacy Backlogs Release (now unused) set to 21

#6 Updated by Björn Dieding over 4 years ago

I am glad that you were able to reporduce. Let me know, if you need me for anything else.

#7 Updated by The Foreman Bot over 4 years ago

  • Status changed from New to Ready For Testing
  • Target version set to 1.7.2
  • Pull request https://github.com/theforeman/foreman/pull/1858 added
  • Pull request deleted ()

#8 Updated by Shlomi Zadok over 4 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF