mirror of
https://github.com/GAM-team/GAM.git
synced 2026-07-04 04:41:35 +00:00
add user public ssh key attributes
This commit is contained in:
30
src/gam.py
30
src/gam.py
@@ -6821,6 +6821,27 @@ def getUserAttributes(i, cd, updateCmd=False):
|
|||||||
print u'ERROR: %s is not a valid argument for user location details. Make sure user location details end with an endlocation argument'
|
print u'ERROR: %s is not a valid argument for user location details. Make sure user location details end with an endlocation argument'
|
||||||
sys.exit(3)
|
sys.exit(3)
|
||||||
appendItemToBodyList(body, u'locations', location)
|
appendItemToBodyList(body, u'locations', location)
|
||||||
|
elif myarg in [u'ssh', u'sshpublickeys', u'sshkeys']:
|
||||||
|
i += 1
|
||||||
|
if checkClearBodyList(i, body, u'sshPublicKeys'):
|
||||||
|
i += 1
|
||||||
|
continue
|
||||||
|
ssh = {}
|
||||||
|
while True:
|
||||||
|
myopt = sys.argv[i].lower()
|
||||||
|
if myopt == u'expires':
|
||||||
|
ssh[u'expirationTimeUsec'] = sys.argv[i+1]
|
||||||
|
i += 2
|
||||||
|
elif myopt == u'key':
|
||||||
|
ssh[u'key'] = sys.argv[i+1]
|
||||||
|
i += 2
|
||||||
|
elif myopt in [u'endssh']:
|
||||||
|
i += 1
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
print u'ERROR: %s is not a valid argument for user ssh details. Make sure user ssh details end with an endssh argument'
|
||||||
|
sys.exit(3)
|
||||||
|
appendItemToBodyList(body, u'sshPublicKeys', ssh)
|
||||||
elif myarg == u'clearschema':
|
elif myarg == u'clearschema':
|
||||||
if not updateCmd:
|
if not updateCmd:
|
||||||
print u'ERROR: %s is not a valid create user argument.' % sys.argv[i]
|
print u'ERROR: %s is not a valid create user argument.' % sys.argv[i]
|
||||||
@@ -8635,6 +8656,12 @@ def doGetUserInfo(user_email=None):
|
|||||||
continue
|
continue
|
||||||
print utils.convertUTF8(u' %s: %s' % (key, location[key]))
|
print utils.convertUTF8(u' %s: %s' % (key, location[key]))
|
||||||
print u''
|
print u''
|
||||||
|
if u'sshPublicKeys' in user:
|
||||||
|
print u'Public SSH Keys:'
|
||||||
|
for sshkey in user[u'sshPublicKeys']:
|
||||||
|
for key in sshkey:
|
||||||
|
print utils.convertUTF8(u' %s: %s' % (key, sshkey[key]))
|
||||||
|
print u''
|
||||||
if u'phones' in user:
|
if u'phones' in user:
|
||||||
print u'Phones:'
|
print u'Phones:'
|
||||||
for phone in user[u'phones']:
|
for phone in user[u'phones']:
|
||||||
@@ -9726,6 +9753,9 @@ USER_ARGUMENT_TO_PROPERTY_MAP = {
|
|||||||
u'primaryemail': [u'primaryEmail',],
|
u'primaryemail': [u'primaryEmail',],
|
||||||
u'relation': [u'relations',],
|
u'relation': [u'relations',],
|
||||||
u'relations': [u'relations',],
|
u'relations': [u'relations',],
|
||||||
|
u'ssh': [u'sshPublicKeys',],
|
||||||
|
u'sshkeys': [u'sshPublicKeys',],
|
||||||
|
u'publicsshkeys': [u'sshPublicKeys',],
|
||||||
u'suspended': [u'suspended', u'suspensionReason',],
|
u'suspended': [u'suspended', u'suspensionReason',],
|
||||||
u'thumbnailphotourl': [u'thumbnailPhotoUrl',],
|
u'thumbnailphotourl': [u'thumbnailPhotoUrl',],
|
||||||
u'username': [u'primaryEmail',],
|
u'username': [u'primaryEmail',],
|
||||||
|
|||||||
Reference in New Issue
Block a user