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

Closed
vemv opened this issue May 1, 2024 · 2 comments
Closed

How to: specify SCI :classes #1051

vemv opened this issue May 1, 2024 · 2 comments
Labels
question Further information is requested

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

@ikitommi
Copy link
Member

ikitommi commented Jan 1, 2025

Did you check the malli.core/-default-sci-options?

@ikitommi ikitommi added the question Further information is requested label Jan 1, 2025
@vemv
Copy link
Author

vemv commented Jan 1, 2025

I don't have this problem currently anymore

@vemv vemv closed this as completed Jan 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants