Skip to content
This repository has been archived by the owner on Jul 15, 2021. It is now read-only.

Commit

Permalink
don't force credential pair key names to lowercase
Browse files Browse the repository at this point in the history
temporary until a real solution for
lyft#103 lands, since i don't have
time to write a full implementation at the moment
  • Loading branch information
doy-stripe authored and hans-stripe committed Feb 22, 2019
1 parent 102710d commit 81106a2
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions confidant/routes/v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,10 +635,6 @@ def _pair_key_conflicts_for_services(_id, credential_keys, services):
return conflicts


def _lowercase_credential_pairs(credential_pairs):
return {i.lower(): j for i, j in credential_pairs.iteritems()}


@app.route('/v1/credentials', methods=['POST'])
@authnz.require_auth
@authnz.require_csrf_token
Expand All @@ -651,8 +647,7 @@ def create_credential():
return jsonify({'error': 'credential_pairs is a required field'}), 400
if not isinstance(data.get('metadata', {}), dict):
return jsonify({'error': 'metadata must be a dict'}), 400
# Ensure credential pair keys are lowercase
credential_pairs = _lowercase_credential_pairs(data['credential_pairs'])
credential_pairs = data['credential_pairs']
_check, ret = _check_credential_pair_values(credential_pairs)
if not _check:
return jsonify(ret), 400
Expand Down Expand Up @@ -746,10 +741,7 @@ def update_credential(id):
return jsonify({'error': 'metadata must be a dict'}), 400
services = _get_services_for_credential(id)
if 'credential_pairs' in data:
# Ensure credential pair keys are lowercase
credential_pairs = _lowercase_credential_pairs(
data['credential_pairs']
)
credential_pairs = data['credential_pairs']
_check, ret = _check_credential_pair_values(credential_pairs)
if not _check:
return jsonify(ret), 400
Expand Down

0 comments on commit 81106a2

Please sign in to comment.