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.
{ | |
"content": [ | |
{ | |
"text": "Long Text", | |
"style": "h1", | |
"margin": [ | |
5, | |
5, | |
5, | |
20 |
{ | |
"content": [ | |
{ | |
"text": "Long Text", | |
"style": "h1", | |
"margin": [ | |
5, | |
5, | |
5, | |
20 |
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" |
package errors | |
import "context" | |
// ErrorWithUrgency represents an error with a specified urgency. We currently | |
// support two urgencies: | |
// page - this means we will escalate to the on-call engineer. This is the default behaviour. | |
// sentry - this means we will send it to Sentry, but won't page someone. | |
type ErrorWithUrgency struct { | |
cause error |
import "./styles.css"; | |
import { | |
useForm, | |
FormProvider, | |
useController, | |
useFormContext | |
} from "react-hook-form"; | |
import React, { useState } from "react"; | |
import ReactAsyncSelect from "react-select/async"; |