Skip to content

Instantly share code, notes, and snippets.

@Bulletninja
Bulletninja / Readme.md
Created May 26, 2020 22:26 — forked from colllin/Readme.md
Auth0 + FaunaDB integration strategy

Goal

Solutions

At the very least, we need two pieces of functionality:

  1. Create a user document in Fauna to represent each Auth0 user.
  2. Exchange an Auth0 JWT for a FaunaDB user secret.
@Bulletninja
Bulletninja / Readme.md
Created May 26, 2020 21:45 — forked from colllin/Readme.md
FaunaDB User Token Expiration (for ABAC)

Auth0 + FaunaDB ABAC integration: How to expire Fauna user secrets.

Fauna doesn't (yet?) provide guaranteed expiration/TTL for ABAC tokens, so we need to implement it ourselves if we care about it.

What's in the box?

3 javascript functions, each of which can be imported into your project or run from the command-line using node path/to/script.js arg1 arg2 ... argN:

  1. deploy-schema.js: a javascript function for creating supporting collections and indexes in your Fauna database.
@Bulletninja
Bulletninja / useFieldArray.js
Created May 17, 2020 17:45 — forked from joshsalverda/useFieldArray.js
Custom useFieldArray hook for formik using immutability-helper
import {useCallback, useRef, useEffect} from 'react'
import {useField, useFormikContext} from 'formik'
import update from 'immutability-helper'
const useFieldArray = props => {
const [field, meta] = useField(props)
const fieldArray = useRef(field.value)
const {setFieldValue} = useFormikContext()
useEffect(() => {
@Bulletninja
Bulletninja / install_psql_php.sh
Last active October 29, 2015 21:47 — forked from giorgiofellipe/install_psql_php.sh
Install PHP PGSQL extensions on Mac OS X Yosemite (change PHP_VER with your PHP version)
PHP_VER="5.5.29"
# Check if extension exists first
php -m | grep pgsql
# Update brew and install requirements
brew update
brew install autoconf
# Download PHP source and extract