2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-01-28 11:57:37 +00:00

Place cap on api password length

No more than 48 characters should ever be in
an api token. Cap it to avoid outrageous crypt
behavior at large password length.
This commit is contained in:
Jarrod Johnson 2022-03-08 09:15:13 -05:00
parent 21c0372a5b
commit e67bab4f12

View File

@ -66,6 +66,10 @@ def handle_request(env, start_response):
start_response('401 Unauthorized', [])
yield 'Unauthorized'
return
if len(apikey) > 48:
start_response('401', [])
yield 'Unauthorized'
return
cfg = configmanager.ConfigManager(None)
ea = cfg.get_node_attributes(nodename, ['crypted.selfapikey', 'deployment.apiarmed'])
eak = ea.get(