forked from Github-Mirrors/canaille
Pythonic variable name
This commit is contained in:
parent
7877998818
commit
9a527f1877
2 changed files with 8 additions and 8 deletions
|
@ -16,8 +16,8 @@ class LDAPObject:
|
||||||
self.attrs = {}
|
self.attrs = {}
|
||||||
self.changes = {}
|
self.changes = {}
|
||||||
|
|
||||||
if hasattr(self, "objectClass") and not "objectClass" in kwargs:
|
if hasattr(self, "object_class") and not "objectClass" in kwargs:
|
||||||
kwargs["objectClass"] = self.objectClass
|
kwargs["objectClass"] = self.object_class
|
||||||
|
|
||||||
for k, v in kwargs.items():
|
for k, v in kwargs.items():
|
||||||
self.attrs[k] = [v] if not isinstance(v, list) else v
|
self.attrs[k] = [v] if not isinstance(v, list) else v
|
||||||
|
@ -199,8 +199,8 @@ class LDAPObject:
|
||||||
def filter(cls, base=None, conn=None, **kwargs):
|
def filter(cls, base=None, conn=None, **kwargs):
|
||||||
conn = conn or cls.ldap()
|
conn = conn or cls.ldap()
|
||||||
class_filter = (
|
class_filter = (
|
||||||
"".join([f"(objectClass={oc})" for oc in cls.objectClass])
|
"".join([f"(objectClass={oc})" for oc in cls.object_class])
|
||||||
if hasattr(cls, "objectClass")
|
if hasattr(cls, "object_class")
|
||||||
else None
|
else None
|
||||||
)
|
)
|
||||||
arg_filter = ""
|
arg_filter = ""
|
||||||
|
|
|
@ -69,7 +69,7 @@ class User(LDAPObject):
|
||||||
|
|
||||||
|
|
||||||
class Client(LDAPObject, ClientMixin):
|
class Client(LDAPObject, ClientMixin):
|
||||||
objectClass = ["oauthClient"]
|
object_class = ["oauthClient"]
|
||||||
base = "ou=clients,ou=oauth"
|
base = "ou=clients,ou=oauth"
|
||||||
id = "oauthClientID"
|
id = "oauthClientID"
|
||||||
|
|
||||||
|
@ -138,7 +138,7 @@ class Client(LDAPObject, ClientMixin):
|
||||||
|
|
||||||
|
|
||||||
class AuthorizationCode(LDAPObject, AuthorizationCodeMixin):
|
class AuthorizationCode(LDAPObject, AuthorizationCodeMixin):
|
||||||
objectClass = ["oauthAuthorizationCode"]
|
object_class = ["oauthAuthorizationCode"]
|
||||||
base = "ou=authorizations,ou=oauth"
|
base = "ou=authorizations,ou=oauth"
|
||||||
id = "oauthCode"
|
id = "oauthCode"
|
||||||
|
|
||||||
|
@ -174,7 +174,7 @@ class AuthorizationCode(LDAPObject, AuthorizationCodeMixin):
|
||||||
|
|
||||||
|
|
||||||
class Token(LDAPObject, TokenMixin):
|
class Token(LDAPObject, TokenMixin):
|
||||||
objectClass = ["oauthToken"]
|
object_class = ["oauthToken"]
|
||||||
base = "ou=tokens,ou=oauth"
|
base = "ou=tokens,ou=oauth"
|
||||||
id = "oauthAccessToken"
|
id = "oauthAccessToken"
|
||||||
|
|
||||||
|
@ -218,7 +218,7 @@ class Token(LDAPObject, TokenMixin):
|
||||||
|
|
||||||
|
|
||||||
class Consent(LDAPObject):
|
class Consent(LDAPObject):
|
||||||
objectClass = ["oauthConsent"]
|
object_class = ["oauthConsent"]
|
||||||
base = "ou=consents,ou=oauth"
|
base = "ou=consents,ou=oauth"
|
||||||
id = "cn"
|
id = "cn"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue