Skip to main content

Content about #Rust

AotokitsuruyaAotokitsuruya

Kobako: From Default Allow to Deny — Balancing Convenience and Security

From the design stage, Kobako aimed to let the Host and the Guest communicate easily, which is why the Bind service mechanism was designed in the first place.

To make it as easy as possible to use, you could pass basically any object to Sandbox#bind and call that object’s methods from the Guest. That convenience brought a huge risk, and in the end the only option was to change the design.

AotokitsuruyaAotokitsuruya

Kobako: Letting Blocks Pass Through the Sandbox

The Kobako: Handle Mechanism isn’t anything special for projects that support a scripting language, but blocks are a capability unique to Ruby, and it would be a shame if we couldn’t make good use of them inside a sandbox.

But can we really write something like this?

1sandbox.bind("Seq::Map", ->(items, &blk) { items.map(&blk) })
2sandbox.eval("Seq::Map.call([1, 2, 3]) { |x| x * 2 }").value
3
4# => [2, 4, 6]

Surprisingly, a block inside the sandbox can receive calls from the outside.

AotokitsuruyaAotokitsuruya

Tsuzuri: Building Another Subtitle Editor in the AI Era — Is It Reinventing the Wheel?

The subtitle tool that has impressed me most recently is What’Sub, built by the YouTuber 壹加壹. In most situations, whenever someone needs to work on video subtitles, I simply recommend it.

However, about half a year ago, when a friend asked me “Is there a way to make transcripts?” and “Can we translate those transcripts?,” there was always one precondition: “no cloud services.” That ruled out most of the options on the market.

One great thing about this era is that AI lets anyone customize tools for their own needs, and Tsuzuri was born against exactly this background.

AotokitsuruyaAotokitsuruya

Deep into Magnus to Write Rust Extension for Ruby

Recently, due to work-related reasons, I took a moment to revisit Open Policy Agent and discovered that the Cedar Language introduced by AWS is more suitable for implementing a policy mechanism similar to AWS IAM in software applications. Since it is built on Rust, I decided to try writing an extension in Rust so that it can be utilized in Ruby.