tebowy / openipam

Automatically exported from code.google.com/p/openipam
0 stars 0 forks source link

Internal auth fails #1

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Follow install directions
2. Attempt to authenticate
3.

What is the expected output? What do you see instead?
Expect authentication success
Got failed login

2008-11-14 15:05:47,111 INFO sqlalchemy.engine.base.Engine.0x..6c SELECT
users.id, users.username, users.source, users.min_permissions 
FROM users 
WHERE users.username = %(username_1)s AND users.source = %(source_1)s
2008-11-14 15:05:47,112 INFO sqlalchemy.engine.base.Engine.0x..6c
{'username_1': 'admin', 'source_1': 1}
[14/Nov/2008:15:05:47]  Failed Login: admin 
InvalidCredentials: [InvalidCredentials] Invalid credentials; username: admin

Tracing back the exceptions through the source led me to an AttributeError
in DBAuthInterface

openipam.backend.auth.interfaces.InternalAuthInterface._search_internal
calls auth.dbi.get_internal_auth

However, the definition of
openipam.backend.db.interface.DBAuthInterface.__getattr__ only allows three
methods.  Adding 'get_internal_auth' to this exception list, fixes the
authentication problem.

The following patch with fix it.

Index: openipam/backend/db/interface.py
===================================================================
--- openipam/backend/db/interface.py    (revision 63)
+++ openipam/backend/db/interface.py    (working copy)
@@ -2744,7 +2744,7 @@
        """
        This only lets the DBAuthInterface call a small subset of DBInterface
functions. 
        """
-       if name in ('add_user', 'get_users', 'get_auth_sources'):
+       if name in ('add_user', 'get_users',
'get_auth_sources','get_internal_auth'):
            return DBInterface.__getattr__(self, name)
        raise AttributeError(name)

Original issue reported on code.google.com by kitty...@gmail.com on 14 Nov 2008 at 10:11

GoogleCodeExporter commented 8 years ago
Thanks! This was fixed in r64, apparently committed about 5 minutes after you
submitted this, so good timing :) I think we were working on it at the same 
time.

Thanks for your interest ... you officially get "first post!!!"

Original comment by fotinaki...@gmail.com on 18 Nov 2008 at 2:43