Skip to content

Instantly share code, notes, and snippets.

@MarcelloTheArcane
Created October 31, 2019 07:29
Show Gist options
  • Save MarcelloTheArcane/b3b9a27a4995118bc023dd151d0be773 to your computer and use it in GitHub Desktop.
Save MarcelloTheArcane/b3b9a27a4995118bc023dd151d0be773 to your computer and use it in GitHub Desktop.
module.exports = {
name: '',
authentication: {
providers: {
local: true,
google: false,
facebook: false,
github: false,
},
provider_urls: {
success: '',
failure: '',
},
},
storage: {
storagePermission: (key, type, _claims) => { // sets exports.storagePermission
// accept read to public directory
const res = key.match(/\/public\/.*/)
if (res) {
if (type === 'read') {
return true
}
}
return false
}
},
settings: {
hasura: {
version: '',
unauthorized_role: '',
},
authentication: {
auto_registration: false,
permission_variables: [
'',
],
jwt_expiration: 15,
refetch_expiration: 54000,
},
postgresql: {
version: '',
},
},
roles: [],
schemas: { // Adds new schemas from keys
public: { // Adds new tables from keys
table_name: {
columns: [
{
column_name: '',
column_type: '',
default_value: '',
nullable: false,
unique: false,
},
],
primary_key: '',
foreign_keys: [],
unique_keys: [],
comment: '',
relationships: [ // From 'Add a new relationship manually'
{
type: '',
name: '',
schema: '',
table: '',
from: '',
to: '',
},
],
permissions: {
role: { // name of role from 'roles' array above
insert: {
check: '', // '{}' for no checks
columns: [],
presets: [
{
name: '',
type: '',
value: '',
},
],
},
select: {
check: '', // '{}' for no checks
columns: [],
presets: [
{
name: '',
type: '',
value: '',
},
],
},
update: {
check: '', // '{}' for no checks
columns: [],
presets: [
{
name: '',
type: '',
value: '',
},
],
},
delete: false, // either 'false' or with a check string.
},
},
},
},
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment