Giter Site home page Giter Site logo

crunchwrap's People

Contributors

egladman avatar

Stargazers

 avatar

Watchers

 avatar  avatar

crunchwrap's Issues

Support filters

Instead of trying to predict everyone's use-cases I'll instead open up crunchwrap and allow variables to be piped to common utilities.

This introduces it's own set of problems though. This would allow the running of arbitrary code. We can take some steps to lockdown filters, but it's not a catchall. There will always be ways to circumvent any sense of security given the user is entering input.

Someone could easily wreck havoc with a oneliner like:

{{ variable | true && rm  -rf $HOME }}

Here's some steps we can do to safen filters, but again it's not a catchall.

  • whitelist specific commands such as:

    • gawk
    • awk
    • sed
    • cut
    • grep
    • egrep
    • tail
    • wc
    • sort
  • kill filter/command if it runs for more than X seconds

As I start to build out this feature I'm sure I'll find more ways to improve the concept.

Implementation Example

Variable:

example_var="The quick brown fox"

Template:

{{ example_var | awk '{$2="slow"; print $0}  }} jumps over the lazy dog

Output:

The slow brown fox jumps over the lazy dog

Refactor

Problem

functions like _eval_tags and _parse are begging to be rewritten. Their far too big, and difficult to follow.

What needs to be done

  • Before proceeding I need to write tests to insure I don't inadvertently break anything
  • Reduce function line counts
  • update styling/function naming convention similarly to what's found in egladman/squib

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.