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

TheGraph Auth-Layer-Proxy #43

Merged
merged 21 commits into from
Mar 28, 2024
Merged

TheGraph Auth-Layer-Proxy #43

merged 21 commits into from
Mar 28, 2024

Conversation

AlfredoG87
Copy link
Contributor

@AlfredoG87 AlfredoG87 commented Mar 7, 2024

Description:
Productization of Envoy Proxy as Auth Layer Proxy, for validating the request token and params and deciding if it has the appropiate permissions to access the index Admin API of HederaTheGraph deployment.

Is meant to secure the Admin Endpoints for authorized developers only assigned subgraphs.

Added Unit Tests to comply that the VerificationTokenFilter is working as expected.

Related issue(s):

Fixes #

Notes for reviewer:
Tests CI is already included on this PR and running, you can checkout the coverage and details of the run here:
https://github.com/hashgraph/hedera-the-graph/actions/runs/8384795289/job/22962691770?pr=43
or by following the details.

The 2 steps that show the results are: Run Tests and Generate Console Report

image
image

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@AlfredoG87 AlfredoG87 marked this pull request as draft March 7, 2024 21:53
@AlfredoG87 AlfredoG87 self-assigned this Mar 13, 2024
@AlfredoG87 AlfredoG87 added the New Feature A new feature, service, or documentation. Major changes that are not backwards compatible. label Mar 13, 2024
@AlfredoG87 AlfredoG87 changed the title Envoy aut layer final TheGraph Auth-Layer-Proxy Mar 13, 2024
@AlfredoG87 AlfredoG87 requested a review from Nana-EC March 22, 2024 02:58
@AlfredoG87 AlfredoG87 added this to the 0.2.0 milestone Mar 22, 2024
@AlfredoG87 AlfredoG87 force-pushed the envoy-aut-layer-final branch from a9b1ada to dda5e8a Compare March 22, 2024 03:03
@AlfredoG87 AlfredoG87 marked this pull request as ready for review March 22, 2024 03:11
… of a long term final solution.

Signed-off-by: Alfredo Gutierrez <[email protected]>
Signed-off-by: Alfredo Gutierrez <[email protected]>
Signed-off-by: Alfredo Gutierrez <[email protected]>
Signed-off-by: Alfredo Gutierrez <[email protected]>
Signed-off-by: Alfredo Gutierrez <[email protected]>
…s and improved a little on the docs instructions, also moved the copy of the filters from the mapping volume on the docker-compose to the Dockerfile, so those files can be copied and included with the image at build time

Signed-off-by: Alfredo Gutierrez <[email protected]>
Signed-off-by: Alfredo Gutierrez <[email protected]>
…ill no longer be needed.

Signed-off-by: Alfredo Gutierrez <[email protected]>
…t all on the same script.

Added SHA-256 function to hash received token before comparing it to db.

Signed-off-by: Alfredo Gutierrez <[email protected]>
Signed-off-by: Alfredo Gutierrez <[email protected]>
… instrospection endpoint instead of checking it agasint postgres, added validations and descriptive errors.

Cleanup Dockerfile to only include the needed dependencies.

Updated example.env with needed env variables

Updated README.md with new instructions

Signed-off-by: Alfredo Gutierrez <[email protected]>
Added GHA WF for running unit tests as part of CI pipeline

Improvements to Readme with instructions on how to run tests

Signed-off-by: Alfredo Gutierrez <[email protected]>
Signed-off-by: Alfredo Gutierrez <[email protected]>
Signed-off-by: Alfredo Gutierrez <[email protected]>
Signed-off-by: Alfredo Gutierrez <[email protected]>
@AlfredoG87 AlfredoG87 force-pushed the envoy-aut-layer-final branch from a76805c to fff4e0e Compare March 28, 2024 17:11
Copy link

@Nana-EC Nana-EC left a comment

Choose a reason for hiding this comment

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

Looking good.
minot items

@@ -0,0 +1,50 @@
name: Tests
Copy link

Choose a reason for hiding this comment

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

Auth Layer Proxy Tests

Copy link
Contributor Author

Choose a reason for hiding this comment

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

✅ Done!

linkStyle 4 stroke:#00ff00,stroke-width:2px;

```
More information on the **Authorization Layer** can be found [here](link)
Copy link

Choose a reason for hiding this comment

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

What link is this to?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was a placeholder for when the doc was merged into main.
now that is already merged I fixed the link with the appropiate url

✅ done

@@ -0,0 +1,184 @@
# Readme

This is a token verification auth-layer-proxy for Hedera-The-Graph implementation that will allows a node operator to publish a secured `admin port` of the-graph deployment for hedera.
Copy link

Choose a reason for hiding this comment

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

nit:

Suggested change
This is a token verification auth-layer-proxy for Hedera-The-Graph implementation that will allows a node operator to publish a secured `admin port` of the-graph deployment for hedera.
This is a token verification auth-layer-proxy for Hedera-The-Graph implementation that will allow a node operator to publish a secured `admin port` of the-graph deployment for Hedera.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

✅ Done!

auth-layer-proxy/README.md Show resolved Hide resolved
}
```

For instructions on how to set-up the Auth Provider using KeyCloak, refer to the `Auth-Layer-Server` [README](link)
Copy link

Choose a reason for hiding this comment

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

Update link

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was a placeholder for when the auth-layer-server was already merged, now that is merged I have updated with the approapiate URL. thanks for noticing!!

✅ Done

Copy link

@Nana-EC Nana-EC left a comment

Choose a reason for hiding this comment

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

LGTM

@AlfredoG87 AlfredoG87 merged commit 142ba47 into main Mar 28, 2024
4 checks passed
@AlfredoG87 AlfredoG87 deleted the envoy-aut-layer-final branch March 28, 2024 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New Feature A new feature, service, or documentation. Major changes that are not backwards compatible.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants