mirror of
https://github.com/xcat2/confluent.git
synced 2025-01-28 11:57:37 +00:00
Put missing file under git tracking
This commit is contained in:
parent
39c17330f3
commit
596692a033
24
confluent/auth.py
Normal file
24
confluent/auth.py
Normal file
@ -0,0 +1,24 @@
|
||||
# authentication and authorization routines for confluent
|
||||
|
||||
import confluent.config as config
|
||||
|
||||
def authorize(name, element):
|
||||
#TODO: actually use the element to ascertain if this user is good enough
|
||||
try:
|
||||
if '/' in name:
|
||||
tenant, user = name.split('/', 1)
|
||||
tenant = config.get_tenant_id(tenant)
|
||||
user = config.get_user(user, tenant)
|
||||
elif name in config.get_tenant_names():
|
||||
tenant = config.get_tenant_id(name)
|
||||
user = config.get_user(name, tenant)
|
||||
else:
|
||||
user = config.get_user(name, 0)
|
||||
tenant = 0
|
||||
return (tenant, user)
|
||||
except:
|
||||
print "uh oh"
|
||||
return None
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user