- leverage the type system
- move constraints upstream
- parse don't validate
- make invalid states unrepresentable
- type-driven dev
- hexagonal architecture of sorts
- DTOs / DAOs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "Iris Rev. 7", | |
| "vendorProductId": 3406852694, | |
| "macros": ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""], | |
| "layers": [ | |
| [ | |
| "KC_MUTE", | |
| "KC_1", | |
| "KC_2", | |
| "KC_3", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| theme = "tokyonight_storm" | |
| [editor] | |
| rulers = [80,120] | |
| auto-format = true | |
| whitespace.render = "all" | |
| file-picker.hidden = false | |
| soft-wrap.enable = true | |
| soft-wrap.wrap-at-text-width = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # http://https://datalog-biscuit-lang.org | |
| # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ | |
| # Detection | |
| # ‾‾‾‾‾‾‾‾‾ | |
| hook global BufCreate .*\.biscuit-datalog %{ | |
| set-option buffer filetype biscuitdl | |
| } |
+++ title = "Biscuit 3.0" description = "Version 3.0.0 of the biscuit reference implementation has been released" date = 2023-03-29T00:09:00+02:00 draft = false template = "blog/page.html"
[taxonomies] authors = ["clementd"]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {Biscuit, Authorizer} from '@biscuit-auth/biscuit-wasm'; | |
| export function middleware(pubkey) { | |
| return function(mkAuthorizer) { | |
| return function(req, res, next) { | |
| if(req.query.token) { | |
| let parsed; | |
| try { | |
| let authorizer; | |
| if(typeof mkAuthorizer === "function") { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# LANGUAGE LambdaCase #-} | |
| {-# LANGUAGE TypeFamilies#-} | |
| {-# LANGUAGE OverloadedStrings #-} | |
| {-# LANGUAGE DerivingStrategies #-} | |
| {-# LANGUAGE DataKinds #-} | |
| {-# LANGUAGE NoImplicitPrelude #-} | |
| module MyLib (main) where | |
| import Relude | |
| import Servant hiding (throwError) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ❯ biscuit keypair | |
| Generating a new random keypair | |
| Private key: 53a4d7e7c10b186135b43fe231fa5f91923571a9619654091a23a5ae09d45d08 | |
| Public key: d0def12aeaaccd02cdfbab78f41e833085606e4dde78614a7e4bc87bc64a6126 | |
| ❯ biscuit keypair --from-private-key 53a4d7e7c10b186135b43fe231fa5f91923571a9619654091a23a5ae09d45d08 | |
| Generating a keypair for the provided private key | |
| Private key: 53a4d7e7c10b186135b43fe231fa5f91923571a9619654091a23a5ae09d45d08 | |
| Public key: d0def12aeaaccd02cdfbab78f41e833085606e4dde78614a7e4bc87bc64a6126 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# LANGUAGE DataKinds #-} | |
| {-# LANGUAGE FlexibleContexts #-} | |
| {-# LANGUAGE NamedFieldPuns #-} | |
| {-# LANGUAGE OverloadedStrings #-} | |
| {-# LANGUAGE TypeFamilies #-} | |
| module Biscuit | |
| ( authHandler | |
| , RequireBiscuit | |
| , checkBiscuit | |
| , genBiscuitCtx |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# LANGUAGE QuasiQuotes #-} | |
| {-# LANGUAGE TemplateHaskell #-} | |
| module Inline where | |
| import Data.ByteString (ByteString, copy, packCStringLen) | |
| import Foreign.Marshal.Alloc | |
| import qualified Language.C.Inline as C | |
| C.context (C.baseCtx <> C.bsCtx) |
NewerOlder