Skip to content

Instantly share code, notes, and snippets.

View cdelgadob's full-sized avatar
🛠️
All about software

Carlos Delgado cdelgadob

🛠️
All about software
View GitHub Profile
@cdelgadob
cdelgadob / RDSDataAPIClient.js
Last active July 30, 2019 14:45 — forked from samin/RDSDataAPIClient.js
RDS Data API
const Bluebird = require('bluebird');
const { isUndefined } = require('lodash');
const Client = require('knex/lib/dialects/mysql');
const Transaction = require('knex/lib/transaction');
const inherits = require('inherits');
const sqlstring = require('sqlstring');
class RDSDataAPITransaction extends Transaction {
@cdelgadob
cdelgadob / auth_perms.json
Last active July 4, 2019 19:17
This is my authorizer implementation for out graphQL endpoint. This is based on groups, and validates first the operation being called (same as a REST endpoint) and then the query. It has several points for improvement but I wanted to share it with the community. Hope it can serve as an inspiration to somebody looking for this functionality. Ple…
[
{"name": "deleteRestaurantService","roles": ["bus_mngr","rest_mngr"],"item_type": "operation", "op_type": "ORG"},
{"name": "createRestaurantService","roles": ["bus_mngr","rest_mngr"],"item_type": "operation", "op_type": "ORG"},
{"name": "BookRequestDelta.user","roles": ["user","bus_mngr","rest_mngr"],"item_type": "entity"},
{"name": "BookRequest.deltas","roles": ["bus_mngr","rest_mngr","maitre","user","item_type": "entity"},
{"name": "BookRequest.person","roles": ["user","bus_mngr","rest_mngr","maitre","waiter"],"item_type": "entity"}
]
@cdelgadob
cdelgadob / cleanTypenameFieldLink.ts
Last active August 9, 2022 18:20
This is a custom ApolloLink which we use to clean the "__typename" field to prevent sending it to the GraphQL server. omitDeep based on this gist: https://gist.github.com/Billy-/d94b65998501736bfe6521eadc1ab538
@cdelgadob
cdelgadob / hiveConnect_.idea_.name
Created October 7, 2015 14:46
tests connecting to hive from spark
hiveConnect