Get the latest tech news

Firewalling your code


When writing code, you can call any function as long as it’s public, and similarly, you can access any object’s public properties or methods. Usually, access to code is all or none – a piece of code can be either public or private. Lately, I’ve been thinking about ways to implement more fine-grained access controls and have looked to the networking world for inspiration…

Unlike network firewalls, when accessing a public property or method in a program, we don’t normally check whether the caller has the right to do so. An access control system like the one implemented here can help prevent maintenance issues, such as dependencies or coupling between unrelated parts of the application, and enhance security by limiting the potential for unauthorized actions. Additionally, it doesn’t require any drastic changes to the existing code base, as long as a sensible directory hierarchy is in place.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Code

Code

Related news:

News photo

Exploring Impact of Code in Pre-Training

News photo

Grok-2 gets a speed bump after developers rewrite code in three days

News photo

HTC’s Viverse announces no-code virtual world builder