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

[feat] Allow matching JSON from query #126

Merged
merged 3 commits into from
Mar 13, 2024
Merged

[feat] Allow matching JSON from query #126

merged 3 commits into from
Mar 13, 2024

Conversation

aquamatthias
Copy link
Member

@aquamatthias aquamatthias commented Mar 12, 2024

Description

  // assume this query is a security check
  const query_str = 'is(aws_lambda_function) and function_url_config.cors.allow_origins ~ "*"'
  // assume this is the reported section of the resource json
  const resource_json = { ... }
  // parse the query
  const query = Query.parse(query_str)
  // check if the query can derive data from the resource json
  if (query.provides_security_check_details()) {
    // find the paths in the resource json that match the query
    const paths:Path[] = query.find_paths(resource_json)
  }

To-Dos

  • Extract i18n strings via yarn i18n:extract
  • Check formatting via yarn format:check
  • Lint via yarn lint and yarn lint:tsc
  • Test via yarn test

Code of Conduct

By submitting this pull request, I agree to follow the code of conduct.

Copy link
Collaborator

@sijav sijav left a comment

Choose a reason for hiding this comment

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

LGTM

@aquamatthias aquamatthias merged commit 216c14a into main Mar 13, 2024
3 checks passed
@aquamatthias aquamatthias deleted the mv/t2 branch March 13, 2024 09:10
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.

2 participants