Skip to content

Instantly share code, notes, and snippets.

@paprikati
paprikati / check_organisation_scope.go
Last active Dec 3, 2021
CheckOrganisationScope: using middleware to check that API responses are scoped by organisation ID
View check_organisation_scope.go
package mw
import (
"context"
"reflect"
"github.com/incident-io/core/server/api/gen/billing"
"github.com/incident-io/core/server/api/gen/insights"
"github.com/incident-io/core/server/api/gen/system"
"github.com/incident-io/core/server/api/gen/typeaheads"
@paprikati
paprikati / readme.MD
Last active Nov 23, 2021
safedb: using a gorm hook to check that queries are scoped by organisation ID
View readme.MD

SafeDB

This gist is associated with the blog post "Building safe-by-default tools in our Go web application".

It contains the gorm hooks that we use to ensure our queries are correctly scoped.

View test_pdf.json
{
"content": [
{
"text": "Long Text",
"style": "h1",
"margin": [
5,
5,
5,
20
@paprikati
paprikati / test_pdf.json
Created Nov 6, 2019
PDF Make unbreakable test
View test_pdf.json
{
"content": [
{
"text": "Long Text",
"style": "h1",
"margin": [
5,
5,
5,
20