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

How to: specify SCI :classes #1051

Open
vemv opened this issue May 1, 2024 · 0 comments
Open

How to: specify SCI :classes #1051

vemv opened this issue May 1, 2024 · 0 comments

Comments

@vemv
Copy link

vemv commented May 1, 2024

Context

I'd need to be able to run code such as this one, namely that uses arbitrary classes.

(malli/coerce [:fn '(fn url? [s]
                      (try
                        (java.net.URL. url)
                        true
                        (catch MalformedURLException _
                          false)))]
              "http:")

...This is safe for my use case, as I'm using SCI for serializable functions - not for evaluating user input.

Problem statement

The code above won't run since no classes are whitelisted by default.

Suggested solution

Allow to specify {:classes {:allow :all}} as documented in:

https://github.com/babashka/sci/blob/bf6a0f1e00313a902c62c59e440266612725b926/README.md#classes

...perhaps this is possible already, but there wasn't documentation for this aspect. Code wasn't immediately clear to me.

Thanks - V

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