MCPcopy
hub / github.com/simov/grant

github.com/simov/grant @v5.4.24 sqlite

repository ↗ · DeepWiki ↗ · release v5.4.24 ↗
82 symbols 194 edges 74 files 0 documented · 0%
README

Grant

[![npm-version]][npm] [![test-ci-img]][test-ci-url] [![test-cov-img]][test-cov-url] [![snyk-vulnerabilities]][snyk]

OAuth Proxy

200+ Supported Providers / [OAuth Playground][grant-oauth]

23andme | 500px | acton | acuityscheduling | adobe | aha | alchemer | amazon | angellist | apple | arcgis | asana | assembla | atlassian | auth0 | authentik | authentiq | authing | autodesk | aweber | axosoft | baidu | basecamp | battlenet | beatport | bitbucket | bitly | box | buffer | campaignmonitor | cas | cheddar | clio | cognito | coinbase | concur | constantcontact | coursera | crossid | dailymotion | deezer | delivery | deputy | deviantart | digitalocean | discogs | discord | disqus | docusign | dribbble | dropbox | ebay | echosign | ecwid | edmodo | egnyte | etsy | eventbrite | evernote | eyeem | facebook | familysearch | feedly | figma | fitbit | flickr | formstack | foursquare | freeagent | freelancer | freshbooks | fusionauth | garmin | geeklist | genius | getbase | getpocket | gitbook | github | gitlab | gitter | goodreads | google | groove | gumroad | harvest | hellosign | heroku | homeaway | hootsuite | huddle | ibm | iconfinder | idme | idonethis | imgur | infusionsoft | instagram | intuit | jamendo | jumplead | kakao | keycloak | line | linkedin | live | livechat | logingov | lyft | mailchimp | mailup | mailxpert | mapmyfitness | mastodon | medium | meetup | mendeley | mention | microsoft | mixcloud | moxtra | myob | naver | nest | netlify | nokotime | notion | nylas | okta | onelogin | openstreetmap | optimizely | osu | patreon | paypal | phantauth | pinterest | plurk | podio | procore | producthunt | projectplace | pushbullet | qq | ravelry | redbooth | reddit | runkeeper | salesforce | sellsy | shoeboxed | shopify | skyrock | slack | slice | smartsheet | smugmug | snapchat | snowflake | socialpilot | socrata | soundcloud | spotify | square | stackexchange | stocktwits | stormz | storyblok | strava | stripe | surveymonkey | surveysparrow | thingiverse | ticketbud | tiktok | timelyapp | todoist | trakt | traxo | trello | tripit | trustpilot | tumblr | twitch | twitter | typeform | uber | unbounce | underarmour | unsplash | untappd | upwork | uservoice | vend | venmo | vercel | verticalresponse | viadeo | vimeo | visualstudio | vk | wechat | weekdone | weibo | withings | wordpress | workos | wrike | xero | xing | yahoo | yammer | yandex | zendesk | zoom

Table of Contents

[Migration Guide: from v4 to v5][migration]


Handlers

HTTP Frameworks

Express

var express = require('express')
var session = require('express-session')
var grant = require('grant').express()

var app = express()
// REQUIRED: any session store - see /examples/handler-express
app.use(session({secret: 'grant'}))
// mount grant
app.use(grant({/*configuration - see below*/}))

Koa

var Koa = require('koa')
var session = require('koa-session')
var grant = require('grant').koa()

var app = new Koa()
// REQUIRED: any session store - see /examples/handler-koa
app.keys = ['grant']
app.use(session(app))
// mount grant
app.use(grant({/*configuration - see below*/}))

Hapi

var Hapi = require('hapi')
var yar = require('yar')
var grant = require('grant').hapi()

var server = new Hapi.Server()
server.register([
  // REQUIRED: any session store - see /examples/handler-hapi
  {plugin: yar, options: {cookieOptions: {password: 'grant', isSecure: false}}},
  // mount grant
  {plugin: grant({/*configuration - see below*/})}
])

Fastify

var fastify = require('fastify')
var cookie = require('@fastify/cookie')
var session = require('@fastify/session')
var grant = require('grant').fastify()

fastify()
  .register(cookie)
  .register(session, {secret: 'grant', cookie: {secure: false}})
  .register(grant({/*configuration - see below*/}))

Serverless Functions

AWS Lambda

var grant = require('grant').aws({
  config: {/*configuration - see below*/}, session: {secret: 'grant'}
})

exports.handler = async (event) => {
  var {redirect, response} = await grant(event)
  return redirect || {
    statusCode: 200,
    headers: {'content-type': 'application/json'},
    body: JSON.stringify(response)
  }
}

Azure Function

```js var grant = require('grant').azure({ config: {/configuration - see below/}, session: {secret: 'grant'} })

module.exports = async (context, req) => { var {redirect, response} = await gran

Extension points exported contracts — how you extend this code

GrantOptions (Interface)
(no doc)
grant.d.ts
GrantConfig (Interface)
(no doc)
grant.d.ts
GrantProvider (Interface)
(no doc)
grant.d.ts
GrantSessionConfig (Interface)
(no doc)
grant.d.ts
GrantSessionStore (Interface)
(no doc)
grant.d.ts

Core symbols most depended-on inside this repo

grant
called by 76
grant.js
express
called by 23
test/util/client.js
buffer
called by 12
test/util/provider.js
handler
called by 10
lib/handler/fastify.js
sign
called by 7
test/response.js
verify
called by 7
test/handler/oidc.js
success
called by 7
test/handler/oidc.js
dcopy
called by 5
lib/util.js

Shape

Function 72
Interface 10

Languages

TypeScript100%

Modules by API surface

lib/config.js10 symbols
grant.d.ts10 symbols
test/util/provider.js7 symbols
lib/oidc.js6 symbols
lib/handler/aws.js5 symbols
test/util/client.js4 symbols
lib/response.js4 symbols
lib/session.js3 symbols
lib/request.js3 symbols
lib/handler/node.js3 symbols
lib/client.js3 symbols
test/handler/oidc.js2 symbols

Used by 3 indexed graphs manifest dependencies, hub-wide

Dependencies from manifests, versioned

@curveball/bodyparser0.4.6 · 1×
@curveball/core0.14.2 · 1×
@curveball/router0.2.4 · 1×
@curveball/session0.5.0 · 1×
@fastify/cookie9.4.0 · 1×
@fastify/formbody7.4.0 · 1×
@fastify/secure-session7.1.0 · 1×
@fastify/session10.9.0 · 1×
@hapi/catbox-redis5.0.5 · 1×
@hapi/hapi21.3.10 · 1×
@hapi/yar11.0.2 · 1×
body-parser1.20.3 · 1×

Datastores touched

(mongodb)Database · 1 repos
grantDatabase · 1 repos

For agents

$ claude mcp add grant \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact