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

Backend Service Api #170

Conversation

ravinderkumarsap
Copy link
Contributor

Description

Please describe your PR:
Created a http backend service to validate the transfer.
Link for issue : #128

  • What does this PR introduce?

Here's a step-by-step Explanation of created a REST API application to complete and validate a successful asset transfer:

Create a Content Storage API:

POST API /api/v1/contents:
{{backend-service-url}}/api/v1/content/

Endpoint to store assets.
Accepts asset data in the request body.
Persists the asset data and returns a URL or ID in the response.

GET API /api/v1/contents/{id}:
{{backend-service-url}}/api/v1/content/1

Endpoint to fetch content by ID.
Takes the content ID as a path parameter.
Returns the stored content associated with the given ID.
Create a Transfer API:

POST API /api/v1/transfers:
{{backend-service-url}}/api/v1/transfer/
Endpoint to accept transfer data from the connector.
Expects a JSON payload similar to:
{
"id": "",
"endpoint": "http://alice-tractusx-connector-dataplane:8081/api/public",
"authKey": "Authorization",
"authCode": "",
"properties": {}
}

Persists the transfer data with the transfer ID.
GET API /api/v1/transfers/{id}:
{{backend-service-url}}/api/v1/transfer/52ba4b2f-ae3a-46ae-96f2-6781aa819386/

Endpoint to retrieve transfer data by ID.
Takes the transfer ID as a path parameter.
Returns the JSON data pushed by the connector for the specified transfer.

GET API /api/v1/transfers/{id}/contents:
{{backend-service-url}}/api/v1/transfer/52ba4b2f-ae3a-46ae-96f2-6781aa819386/contents/

Endpoint to retrieve the actual assets content.
Uses the stored endpoint URL from the transfer data to fetch content.
Returns the content fetched from the specified endpoint.

GET API /api/v1/content/random
{{backend-service-url}}/api/v1/content/random
Return the Sample Random Generated JSON

Does it add a new feature? yes
Is it enhancing documentation : yes

It has the postman collections inside postman folder inside backend-service folder.

Pre-review checks

Please ensure to do as many of the following checks as possible, before asking for committer review:

Copy link

gitguardian bot commented Dec 3, 2023

⚠️ GitGuardian has uncovered 2 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id Secret Commit Filename
- Generic High Entropy Secret a9dfd70 mxd/backend-service/postman/mxd-backend-services.postman_collection.json View secret
- Generic High Entropy Secret 555d62b mxd/backend-service/postman/backend-services.postman_collection.json View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Our GitHub checks need improvements? Share your feedbacks!

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.

1 participant