Skip to content

Instantly share code, notes, and snippets.

View DKurilo's full-sized avatar
🔬
∀ f. Functor f ⇒ (a → f b) → s → f t

Dima DKurilo

🔬
∀ f. Functor f ⇒ (a → f b) → s → f t
View GitHub Profile
@StevenACoffman
StevenACoffman / opa-vs-casbin.md
Last active April 7, 2024 02:43
OPA vs Casbin

Information in this Gist originally from this github issue, which is outdated.

As @RomanMinkin mentioned, you can also consider Casbin (https://github.com/casbin/casbin). It is the most starred authorization library in Golang. There are several differences between Casbin and OPA.

Feature Casbin OPA
Library or service? Library/Service Library/Service
How to write policy? Two parts: model and policy. Model is general authorization logic. Policy is concrete policy rule. A single part: Rego
RBAC hierarchy Casbin supports role hierarchy (a role can have a sub-role) Role hierarchies can be encoded in data. Also with the new graph.reachable() built-in function queries over those hierarchies are much more feasible now.
RBAC separation of duties Not supported Supported: two roles cannot be assigned together
@erantapaa
erantapaa / enigma.lhs
Last active May 10, 2021 15:04
enigma in Haskell
Emulating an Enigma machine
===
In this gist I'll go over the development of an Enigma machine encoder
in Haskell.
Here are some useful background info about how the Enigma machine works:
- Enigma Simulator: http://enigmaco.de/enigma/enigma.html
- "How Enigma Machines Work" http://enigma.louisedade.co.uk/howitworks.html