nucypher / taco-web

🌮 A TypeScript client for TACo (Threshold Access Control)
https://docs.threshold.network/app-development/threshold-access-control-tac
GNU General Public License v3.0
14 stars 22 forks source link

Added JSONPath syntactic validation #561

Closed andresceballosm closed 1 month ago

andresceballosm commented 1 month ago

Type of PR:

Required reviews:

What this does:

Added JSONPath syntactic validation

Related to https://github.com/nucypher/taco-web/pull/550/files#r1696888086

Issues fixed/closed:

  • Fixes #559

Why it's needed:

Explain how this PR fits in the greater context of the NuCypher Network. E.g., if this PR address a nucypher/productdev issue, let reviewers know!

Notes for reviewers:

This depends on the PR #550 With the integrated PR #550 my approach is to use it in the following way

export const JsonApiConditionSchema = z.object({
  conditionType: z.literal(JsonApiConditionType).default(JsonApiConditionType),
  endpoint: z.string().url(),
  parameters: z.record(z.string(), z.unknown()).optional(),
  query: jsonPathSchema.optional(),
  returnValueTest: returnValueTestSchema, // Update to allow multiple return values after expanding supported methods
});
netlify[bot] commented 1 month ago

Deploy Preview for taco-demo ready!

Name Link
Latest commit eb78af34230bcab45b291b3c43d2b291ae6dc132
Latest deploy log https://app.netlify.com/sites/taco-demo/deploys/66a94f7087382a0008a2a1e6
Deploy Preview https://deploy-preview-561--taco-demo.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] commented 1 month ago

Deploy Preview for taco-nft-demo ready!

Name Link
Latest commit eb78af34230bcab45b291b3c43d2b291ae6dc132
Latest deploy log https://app.netlify.com/sites/taco-nft-demo/deploys/66a94f706e363800087b3176
Deploy Preview https://deploy-preview-561--taco-nft-demo.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

derekpierre commented 1 month ago

re: CI failures

From @piotr-roslaniec :

""" Pretty sure this is an issue with compiling jsonpath:

"""

derekpierre commented 1 month ago

@andresceballosm can you try using https://www.npmjs.com/package/@astronautlabs/jsonpath (https://github.com/astronautlabs/jsonpath) instead of jsonpath? I did a cursory check locally and it seemed to do the trick.

andresceballosm commented 1 month ago

@andresceballosm can you try using https://www.npmjs.com/package/@astronautlabs/jsonpath (https://github.com/astronautlabs/jsonpath) instead of jsonpath? I did a cursory check locally and it seemed to do the trick.

Hey @derekpierre works great! thanks