News for hackers. Stuff that matters.
Re:Why Authorization Is Hard by xcskier56 on Wednesday September 15, 2021 @05:39PM (#28544719)
Question if anyone from the Oso team is here: From what I've read, the Oso core is built in rust, but then is it called from Ruby or is it re-implemented in Ruby? I couldn't see any native extension like code in the ruby portion of the repo but could easily have missed it.
Re:Why Authorization Is Hard by gkaemmer on Wednesday September 15, 2021 @05:51PM (#28544814)
Hey, Oso engineer here. Good question.

The rust core is indeed called from the ruby library (as it is with all of our 5 other host libraries). The core itself is pretty complex (there's a whole parser/interpreter in there), so maintaining it in a bunch of languages would be a bit hectic.

There are some files inside `lib/oso/polar/ffi` that define the C bindings used by the rest of the library. Here's an example: https://github.com/osohq/oso/blob/main/languages/ruby/lib/os...

We use the ffi gem to make that work: https://github.com/ffi/ffi

EDIT: hobofan beat me to it! :)

Re:Why Authorization Is Hard by xcskier56 on Wednesday September 15, 2021 @08:42PM (#28546438)
Thanks for the explanation and the code locations!
Re:Why Authorization Is Hard by hobofan on Wednesday September 15, 2021 @05:48PM (#28544794)
It is a wrapper around the Rust code:

- It triggers the rust build in the Makefile: https://github.com/osohq/oso/blob/1d3bf5a4a997a574c2b19084a0...

- There is a bunch of FFI code (also in the ffi directory): https://github.com/osohq/oso/blob/1d3bf5a4a997a574c2b19084a0...

Re:Why Authorization Is Hard by xcskier56 on Wednesday September 15, 2021 @08:41PM (#28546427)
I figured it was in there somewhere. Thanks for pointing me to the spots! Gonna dig in now and try and grok it (hopefully)