Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Signing for discovery provider #532

Merged
merged 19 commits into from
Jun 19, 2020
Merged

API Signing for discovery provider #532

merged 19 commits into from
Jun 19, 2020

Conversation

vicky-g
Copy link
Contributor

@vicky-g vicky-g commented Jun 16, 2020

No description provided.

@vicky-g vicky-g changed the title Vg api sign dp API Signing for discovery provider Jun 16, 2020
Copy link
Contributor

@dmanjunath dmanjunath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking really good @vicky-g! I have a few asks to try to move towards unifying the response data in health_check and version and also extra metadata fields to add, but this is looking very close

discovery-provider/src/utils/config.py Show resolved Hide resolved
libs/src/services/discoveryProvider/index.js Outdated Show resolved Hide resolved
discovery-provider/src/queries/search.py Outdated Show resolved Hide resolved
discovery-provider/src/api_helpers.py Outdated Show resolved Hide resolved
discovery-provider/src/queries/health_check.py Outdated Show resolved Hide resolved
discovery-provider/src/api_helpers.py Outdated Show resolved Hide resolved
@dmanjunath
Copy link
Contributor

dmanjunath commented Jun 17, 2020

One more thing here. for now we can probably hardcode some wallet and private key into the configs. otherwise the process will err for local runs if no values are set right?

@vicky-g
Copy link
Contributor Author

vicky-g commented Jun 17, 2020

@dmanjunath yeah, the disc prov won't start without some wallet and private key. i'll add some dummy values to this pr!

Copy link
Contributor

@dmanjunath dmanjunath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking really good! I have one nit but this looks almost good enough to merge

discovery-provider/src/api_helpers.py Outdated Show resolved Hide resolved
discovery-provider/src/api_helpers.py Outdated Show resolved Hide resolved
discovery-provider/src/utils/config.py Show resolved Hide resolved
@dmanjunath
Copy link
Contributor

also @vicky-g tests are failing

@vicky-g vicky-g requested a review from dmanjunath June 17, 2020 23:19
discovery-provider/.env Show resolved Hide resolved
discovery-provider/scripts/circle-ci.sh Show resolved Hide resolved
# Override the default method
def default(self, o): # pylint: disable=E0202
if isinstance(o, (datetime.date, datetime.datetime)):
# TODO - the Z is required in JS date format
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dmanjunath is this TODO still relevant?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was meant more as a comment, not a TODO

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i can remove the TODO


def error_response(error, error_code=500):
return jsonify({'success': False, 'error': error}), error_code

# Create a response dict with just data, signature, and timestamp
# This response will contain a duplicate of response_entity
def success_response_backwards_compat(response_entity=None, status=200):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vicky-g jw - does this mean the new success_response isn't backwards compatible right? its just differently formatted than success_response

Copy link
Contributor

@hareeshnagaraj hareeshnagaraj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great, awesome work @vicky-g!

@vicky-g vicky-g merged commit 0a22ba6 into master Jun 19, 2020
@vicky-g vicky-g deleted the vg-api-sign-dp branch June 19, 2020 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants