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

VRN Reference examples - restricting to user / app key #255

Open
alexminza opened this issue Feb 21, 2023 · 2 comments
Open

VRN Reference examples - restricting to user / app key #255

alexminza opened this issue Feb 21, 2023 · 2 comments

Comments

@alexminza
Copy link

How to use VRN to restrict access to a specific user / app key?

Reference: https://github.com/vtexdocs/dev-portal-content/blob/main/docs/vtex-io/Reference/concepts/vtex-io-documentation-vrn.md

@alexminza
Copy link
Author

alexminza commented Feb 22, 2023

For an integration with a partner we are working on we need to allow them to call a custom API endpoint developed by us in a custom VTEX IO app.

We need to be able to secure the API endpoint and allow only specific API keys to access it.
Current documentation does not describe such case and provides no examples.

https://developers.vtex.com/docs/guides/vtex-io-documentation-vrn

Looking at examples we could not make it with restricted access

Fragment from the service.json file:

    "route-name": {
      "path": "/_v/route-name/:orderId",
      "public": true,
      "access": "authorized",
      "policies": [
        {
          "effect": "allow",
          "actions": [
            "get"
          ],
          "principals": [
            "vrn:vtex.vtex-id:*:*:*:user/vtexappkey-*",
            "vrn:vtex.vtex-id:*:{{account}}:*:user/vtexappkey-*"
          ]
        }
      ]
    },

@alexminza
Copy link
Author

CC @carolinamenezes, @brunoamui

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

No branches or pull requests

1 participant