codalab/codalab — pull request #433 by cpoulain (2014-04-25 18:31:24+00:00)
Title: Add API in the auth provider to resolve user names from the CLI.

Sample usage:
```
headers = {
'Authorization': 'Bearer {0}'.format(service_auth_token)
}
data = [
('names', ('test1', 'notthere', 'user1')) # list of user names to resolve
]
info_url = 'http://localhost:8000/clients/info/'
request = urllib2.Request(info_url, urllib.urlencode(data, True), headers)
try:
response = urllib2.urlopen(request)
result = json.load(response)
status_code = result['code'] if 'code' in result else 500
if status_code == 200:
for user in result['users']:
print user['name']
if 'id' in user:
print " id: %s" % (user['id'])
print " active: %s" % (user['active'])
else:
print " is not a user"
else:
print 'The call failed.'
except urllib2.URLError as e:
print e
except Exception as e:
print e
```