{"_id":"@cleartax/apollo-server-plugin-introspection-auth","_rev":"7-f9c1017420ed1b14dcbef829ee9cc7c0","name":"@cleartax/apollo-server-plugin-introspection-auth","dist-tags":{"beta":"1.1.0-0","latest":"1.1.0"},"versions":{"1.0.0-beta.1":{"name":"@cleartax/apollo-server-plugin-introspection-auth","version":"1.0.0-beta.1","description":"An Apollo Server plugin to allow introspection only via authenticated requests","main":"dist/cjs/index.js","module":"dist/es/index.js","sideEffects":false,"scripts":{"test":"echo \"Error: no test specified\" && exit 1","prebuild":"rm -rf dist","build":"npm run build:es && npm run build:cjs","build:es":"tsc --build tsconfig.es.json","build:cjs":"tsc --build tsconfig.cjs.json","prepublishOnly":"npm run build"},"author":{"name":"ClearTax Engineering"},"maintainers":[{"name":"cleartax","email":"npm@cleartax.in"}],"publishConfig":{"registry":"https://registry.npmjs.org"},"license":"MIT","devDependencies":{"@cleartax/eslint-config":"^1.3.1","@types/jest":"^25.1.2","@types/node":"^13.7.1","@typescript-eslint/eslint-plugin":"^2.20.0","eslint":"^6.8.0","eslint-plugin-eslint-comments":"^3.1.2","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.7.0","eslint-plugin-json":"^2.0.1","eslint-plugin-jsx-a11y":"^6.2.3","eslint-plugin-lodash":"^6.0.0","eslint-plugin-markdown":"^1.0.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-promise":"^4.2.1","eslint-plugin-react":"^7.18.3","eslint-plugin-react-hooks":"^2.4.0","jest":"^25.1.0","prettier":"^1.19.1","typescript":"^3.7.5","apollo-server":"^2.10.1"},"peerDependencies":{"apollo-server":">= 2.10.1"},"dependencies":{"apollo-server-plugin-base":"^0.6.10"},"gitHead":"2beb2e5ec4c121e074ca949b6ebc3ebdcb5c4f39","_id":"@cleartax/apollo-server-plugin-introspection-auth@1.0.0-beta.1","_nodeVersion":"12.7.0","_npmVersion":"6.13.1","dist":{"integrity":"sha512-AIQQUqwYi4MkWLav5mssHcOMouHxOLtqzxHS0pgHLehtf4DZZqccKGU7qx+lzSMKQB8LUoykg8c77ZBuswOCXA==","shasum":"50ad16a9dcdcadec80a4964f40b00b8764d4f68c","tarball":"https://registry.npmjs.org/@cleartax/apollo-server-plugin-introspection-auth/-/apollo-server-plugin-introspection-auth-1.0.0-beta.1.tgz","fileCount":5,"unpackedSize":5817,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeTPzVCRA9TVsSAnZWagAAEFcP/ifAHfWjXKNsJIR/qtAX\nwbgV4TFf25Rstb8acPdCmZrQnDvapF7apcPK9KRvqBfr7d0cRdkStqxc6HsZ\nJOEq8HouDu/MQBNV9sFzSP6oSp69jbn5f9KvT/ZuUKqmYb5s4Xcf36kTuaO3\naBhq8mbnOumyL130QMUh4Bs8qEu1eH7xjs3PXkcg1TRFbQ7iJi/hFjQWzNfk\npRnqgtZVHaDg7nAolsz+d7ZQQ3imsWMRRufi+4DDMmTWRI6pNjL4V148cqPm\nBYeJ3aPYaD3WUJZDgPaFRodxvMYBtydYXMl8NUm6P7aKmeXEbpt/rQxNZicR\n9VB0DtiEMroe4j3gShXHwg4amWSgnscAjBd4hdZtcMbjSHAGH+d8gRlC1y8k\n78koH1AGD1bPNWpbl60rUm8bNgB4bihYmUC9Zih4Mrk3+LAeqyBtkV/LqJw0\nXmLHwXudLoHqYm9mu3Op+ox9bEK7XCyxeSaGIJTK7z2yetyHZavE8ABYeQfF\nJu3UHN8fFb1Co76Lo4qA5wycjnTXij3cON73HZu9AS/0x150onYvWHGIU6Tv\nuMBtklLJscXMXwMUMI+ooygX6KTwGoZHUjT05G783M7t5f5mlMahXCCuN7Gb\nCh9eBXjc8xv3MMuFZVDJXJBHOS/1c6B0+1KbPsjAOH35IjrTk9zkgdM/jW6W\nVz9y\r\n=8fOc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCvvvqT/5zAqk8bYYGGuTiMrhhgSchT872X0BZVKSOsVgIhAOzXT6rkOq27m/zc4bHUR44oELtnQ7nTKdmCcJId4nDg"}]},"_npmUser":{"name":"cleartax","email":"npm@cleartax.in"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/apollo-server-plugin-introspection-auth_1.0.0-beta.1_1582103765040_0.6723334825927543"},"_hasShrinkwrap":false},"1.0.0-beta.2":{"name":"@cleartax/apollo-server-plugin-introspection-auth","version":"1.0.0-beta.2","description":"An Apollo Server plugin to allow introspection only via authenticated requests","main":"dist/cjs/index.js","module":"dist/es/index.js","sideEffects":false,"scripts":{"test":"echo \"Error: no test specified\" && exit 1","prebuild":"rm -rf dist","build":"npm run build:es && npm run build:cjs","build:es":"tsc --build tsconfig.es.json","build:cjs":"tsc --build tsconfig.cjs.json","prepublishOnly":"npm run build"},"author":{"name":"ClearTax Engineering"},"maintainers":[{"name":"cleartax","email":"npm@cleartax.in"}],"publishConfig":{"registry":"https://registry.npmjs.org"},"license":"MIT","devDependencies":{"@cleartax/eslint-config":"^1.3.1","@types/jest":"^25.1.2","@types/node":"^13.7.1","@typescript-eslint/eslint-plugin":"^2.20.0","eslint":"^6.8.0","eslint-plugin-eslint-comments":"^3.1.2","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.7.0","eslint-plugin-json":"^2.0.1","eslint-plugin-jsx-a11y":"^6.2.3","eslint-plugin-lodash":"^6.0.0","eslint-plugin-markdown":"^1.0.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-promise":"^4.2.1","eslint-plugin-react":"^7.18.3","eslint-plugin-react-hooks":"^2.4.0","jest":"^25.1.0","prettier":"^1.19.1","typescript":"^3.7.5","apollo-server":"^2.10.1"},"peerDependencies":{"apollo-server":">= 2.10.1"},"dependencies":{"apollo-server-plugin-base":"^0.6.10"},"gitHead":"9c4da5a6f74dbee4038fa033851a1125d56a0827","_id":"@cleartax/apollo-server-plugin-introspection-auth@1.0.0-beta.2","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-ZyvGf4nxv9oc5GJBjhhlfs3KkVouCSj325UK4YrM6vjvauYdAI69MD+SgAByneNr8XNjQ34LOPp2Z/+AIrWxJQ==","shasum":"02ea85ec6a79bf7cd30d2edf1ee94c804d8e2ab1","tarball":"https://registry.npmjs.org/@cleartax/apollo-server-plugin-introspection-auth/-/apollo-server-plugin-introspection-auth-1.0.0-beta.2.tgz","fileCount":6,"unpackedSize":8185,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeTlNFCRA9TVsSAnZWagAA23wP/3TM2rFMQXeaHsReRerk\nTrGry3O0E7bkfqRDDmd/PrgAAy7ToeaKJ44LQkhPvJkHNgN1ZaDrQOOVKQOM\n/5RhgyJLOGEej79WFZr4t6t1QzRHIjEcZgmpBSJ6aimtDvRQ0OxiAFC/su+a\nBwu63ZqtCcJAfHtKoRGZ7HG6QWBisz7jO9P4m4wmgVAJYZ7+gVs2qShBGA1i\ndXICd4Bg9PajUZ4TIvJlAITxZx8RvjwE8b/NOHX5FEgtPgaVibpunwwuqOVx\nIRm7OZJJ3hKKZ1AxwfAWqNILgwC/ZcHPTZy9X8cQh7NzuSRMil5tiqiGIIMY\n2P1intXUzCEsMkkfDqMqqQV4KDaeguQb42V1XHjNvMQxlWH6BMYTUNlq5z4N\nCIg1Yiqb0h1bWoQCUFYLZiLO81/c9gYWORC4PexMaZABmD95BHOw9tlC98lq\nVBHIfJnynLRt/7/Cju7jnvU7vEVVxJuNKr0UGU4ZT9su3sDGh53/UcKs/4QI\n++aVBxR3cRdAN28LIaixDJdbDqfPP2SIySRlcrp02BAh9QFcNku3zyNH44sQ\nYyHBzZHQR7ly9Bezi6nlJnpk6pcmFZoN+kZ0ZLIcz5zOhJ+FmCEPQfDBVdf4\n7Xlj58bXnqZzraOOwXWcaa4lS1wcqLoMb2lrBZj+XflsC0xLlyGoz39AMKXk\nKzgw\r\n=8TqQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEwx5CoNfkfn5uzUUYrueT6AjjFeCm+bUkQt53tm1u4pAiBsE6K2CM59TWhx5Bzka2rFJ43EwgLQzPAdmvH8qU4Z7A=="}]},"_npmUser":{"name":"rheaditi","email":"aditi.anomita@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/apollo-server-plugin-introspection-auth_1.0.0-beta.2_1582191429106_0.8635423832333873"},"_hasShrinkwrap":false},"1.0.0":{"name":"@cleartax/apollo-server-plugin-introspection-auth","version":"1.0.0","description":"An Apollo Server plugin to allow introspection only via authenticated requests","main":"dist/cjs/index.js","module":"dist/es/index.js","sideEffects":false,"scripts":{"test":"echo \"Error: no test specified\" && exit 1","prebuild":"rm -rf dist","build":"npm run build:es && npm run build:cjs","build:es":"tsc --build tsconfig.es.json","build:cjs":"tsc --build tsconfig.cjs.json","prepublishOnly":"npm run build"},"author":{"name":"ClearTax Engineering"},"maintainers":[{"name":"cleartax","email":"npm@cleartax.in"}],"publishConfig":{"registry":"https://registry.npmjs.org"},"license":"MIT","devDependencies":{"@cleartax/eslint-config":"^1.3.1","@types/jest":"^25.1.2","@types/node":"^13.7.1","@typescript-eslint/eslint-plugin":"^2.20.0","eslint":"^6.8.0","eslint-plugin-eslint-comments":"^3.1.2","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.7.0","eslint-plugin-json":"^2.0.1","eslint-plugin-jsx-a11y":"^6.2.3","eslint-plugin-lodash":"^6.0.0","eslint-plugin-markdown":"^1.0.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-promise":"^4.2.1","eslint-plugin-react":"^7.18.3","eslint-plugin-react-hooks":"^2.4.0","jest":"^25.1.0","prettier":"^1.19.1","typescript":"^3.7.5","apollo-server":"^2.10.1"},"peerDependencies":{"apollo-server":">= 2.10.1"},"dependencies":{"apollo-server-plugin-base":"^0.6.10"},"gitHead":"ef47f55c9d93571d1bc04a9bb9f954cd41197d32","_id":"@cleartax/apollo-server-plugin-introspection-auth@1.0.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-6V/wQoYxdL8ZYi1nViDCOjxFsQf+I2G1LCNa9U6wJ4rAqH0F6BOipDzMDxS3KaOmmwLNKdGfK9jCMkDq+93f9g==","shasum":"6ba5fff51bc432871abcea05b0f9a6269de01fc0","tarball":"https://registry.npmjs.org/@cleartax/apollo-server-plugin-introspection-auth/-/apollo-server-plugin-introspection-auth-1.0.0.tgz","fileCount":6,"unpackedSize":8689,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeTlhkCRA9TVsSAnZWagAAF5YQAI3vOyAl/iPWSZFFpk0T\nadoJKWLLYxEgpFaa7uszp4RZ90iBHNLvWL2rnM/Z/qITc6IK/lIph537C9a4\nkYsrZjtb40up0GTcQC+5aKY9xKPCi4f4AueHhsTrpKc+JdVPBtYWjDOC60Kt\nUy4Vpr9WJl6CY//kEVT8ECAfLOiLU2RxQBUN//4kV/D7q7INcjic4TrhiJaR\nRvU4gOg84PmFeuRpojBJFXsPcn64Ud5XYIJKMfqI3ERWJSe0APyewLMB2YJk\n/pjXXun0vzb3ksUDhjOGGMpaLW0wd51nzVQ7C72bPo7/5MdxwffdN7DP9b5l\nwmNjlZhJcr2RSFh7Hm70h8qlWPOOeDN2gNOSiflzOTTbKOqNpdkij6W4gWBi\n9ebj9OsSUbxI2yggaMI8JrHAGgJgeb0uNnjfUj01cgYStG3AilNKEAFQ4u4n\nAHbi0Qu+6QDzKYQNoD0JseJhcWgdKehXxoD5FQZEH02LBR0rWsWhnKi/+AQ0\nSCVFjIP8kPySodkJYxxcENsOniAr0WdtPpuVPjSOLw6GUewEteQCsNERtnno\nPf7GqKyAVke9U/x2upnmy++aKxHw7VqZdbQheQLCpj1ZM8/zTF85PWMrs4KG\n1h4D4GpykNyEBY6SZleWup5TjEVxi3L3l/pY5fxS4/fK2uqEC0NCtt0ohjDq\nNtBl\r\n=DKHQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDzdXECKmEBOlhi/se3KJvqE3/Qh8x8UeqplDRwwnD0VAiEAs7SKqjlOH52QZFDnntczLe4FTGsLABZ58b7zBlyOBTk="}]},"_npmUser":{"name":"rheaditi","email":"aditi.anomita@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/apollo-server-plugin-introspection-auth_1.0.0_1582192740439_0.2836677947923143"},"_hasShrinkwrap":false},"1.0.1-beta.1":{"name":"@cleartax/apollo-server-plugin-introspection-auth","version":"1.0.1-beta.1","description":"An Apollo Server plugin to allow introspection only via authenticated requests","main":"dist/cjs/index.js","module":"dist/es/index.js","sideEffects":false,"scripts":{"test":"echo \"Error: no test specified\" && exit 1","prebuild":"rm -rf dist","build":"npm run build:es && npm run build:cjs","build:es":"tsc --build tsconfig.es.json","build:cjs":"tsc --build tsconfig.cjs.json","prepublishOnly":"npm run build"},"author":{"name":"ClearTax Engineering"},"maintainers":[{"name":"cleartax","email":"npm@cleartax.in"}],"publishConfig":{"registry":"https://registry.npmjs.org"},"license":"MIT","devDependencies":{"@cleartax/eslint-config":"^1.3.1","@types/jest":"^25.1.3","@types/node":"^13.7.1","@typescript-eslint/eslint-plugin":"^2.20.0","apollo-server":"^2.10.1","eslint":"^6.8.0","eslint-plugin-eslint-comments":"^3.1.2","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.7.0","eslint-plugin-json":"^2.0.1","eslint-plugin-jsx-a11y":"^6.2.3","eslint-plugin-lodash":"^6.0.0","eslint-plugin-markdown":"^1.0.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-promise":"^4.2.1","eslint-plugin-react":"^7.18.3","eslint-plugin-react-hooks":"^2.4.0","jest":"^25.1.0","prettier":"^1.19.1","ts-jest":"^25.2.1","typescript":"^3.7.5"},"peerDependencies":{"apollo-server":">= 2.10.1"},"dependencies":{"apollo-server-plugin-base":"^0.6.10"},"readme":"# @cleartax/apollo-server-plugin-introspection-auth\n\n> An apollo plugin to secure introspection queries with token based authentication.\n\n---\n\n![npm (scoped)](https://img.shields.io/npm/v/@cleartax/apollo-server-plugin-introspection-auth?style=flat-square)\n![NPM](https://img.shields.io/npm/l/@cleartax/apollo-server-plugin-introspection-auth?style=flat-square)\n![David](https://img.shields.io/david/cleartax/apollo-server-plugin-introspection-auth?style=flat-square)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)\n\n## Installation\n\nInstall the as dependency.\n\n```sh\nnpm install -S @cleartax/apollo-server-plugin-introspection-auth\n```\n\n`apollo-server` is a peer-dependency for this package, if you haven't already, install it via:-\n\n```sh\nnpx install-peerdeps @cleartax/apollo-server-plugin-introspection-auth\n```\n\n## Usage\n\nWhen instantiating `ApolloServer`, pass the following options:-\n\n```ts\nconst apolloServer = new ApolloServer({\n  //...\n  introspection: true,\n  plugins: [\n    ApolloServerIntrospectionAuth({\n        type: 'header-token',\n        name: 'x-app-introspect-auth', // custom header name\n        value: ['<valid-auth-token>'], // valid header values\n      }),\n  ];\n});\n```\n\n**Note**: Ideally, you would want to add this configuration for non-development environments only. In which case, you can add the options conditionally. The following example illustrates adding it for higher environments in `apollo-server-express`:-\n\n```ts\n// this example uses `apollo-server-express`\nimport { ApolloServerExpressConfig, ApolloServer } from 'apollo-server-express';\nimport ApolloServerIntrospectionAuth from '@cleartax/apollo-server-plugin-introspection-auth';\n\nlet options: ApolloServerExpressConfig = {\n  // ...\n  // your default apollo server express config\n};\n\n// add this configuration for NON-development environments\nif (process.env.NODE_ENV === 'production') {\n  options = {\n    ...options,\n    playground: false, // turn off playground in production\n    introspection: true, // configure apollo to allow introspection\n    plugins: plugins.concat([\n      // add the plugin to check for authentication on introspection queries\n      ApolloServerIntrospectionAuth({\n          type: 'header-token',\n          name: 'x-app-introspect-auth', // header name\n          value: ['<valid-auth-token>'], // valid header values\n        }),\n    ]);\n  }\n}\n\nconst apolloServer = new ApolloServer(options);\n```\n\n## References\n\nInspired from [this](https://github.com/apollographql/apollo-server/issues/1933#issuecomment-580510024) implementation in [apollographql/apollo-server#1933](https://github.com/apollographql/apollo-server/issues/1933).\n\n1. [Apollo GraphQL](https://www.apollographql.com/docs/)\n2. [Apollo Graph Manager](https://www.apollographql.com/docs/graph-manager/)\n","readmeFilename":"README.md","gitHead":"acf9006e7208e6e2ce5466fcb6097f632c5bbc25","_id":"@cleartax/apollo-server-plugin-introspection-auth@1.0.1-beta.1","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-XTgyMzN0vEMMU9wogr3owbNAT5DPAignMSHvA0CrbHUGAe/1iyXPGHOsCjAliDtN31IuQ61iVWlFqxb8qOEXhw==","shasum":"9c4bf3345215cfd997f615ecca41e7cd322c9377","tarball":"https://registry.npmjs.org/@cleartax/apollo-server-plugin-introspection-auth/-/apollo-server-plugin-introspection-auth-1.0.1-beta.1.tgz","fileCount":10,"unpackedSize":9572,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeTn79CRA9TVsSAnZWagAAO38P+wTyA5O1YqPCPpN75don\nJ1clp0C2EhWqWawVqRb8nB7qSMdn+D8cTgv+lS8c8pjFwRbamV/i8e46JcrY\nu6ou/nMW0Lrc5/nvgFm9uUlvEW9FyDbH1+lFI+MMaIjj1E37KBrM+dTh4taN\nPtprJ/CJHqC4kyzf0ao07+lfrPuqnH8eSEPwyz28wEODiDJeTtQQbLOBNnaz\nU7NvQJBqGU1Mbt3aPs5d7vMo330hVB5rHd0ec1jVL5FkU/LQ+sk++K0I3T4X\ntozh16iRPd5nT1pdKrRUpg2+k8gS3ONsMm9o32X3yRbpkme4ZSFeHSET5EZ/\ncFiq0ynZCrLkYeivACb0RxWAQaRMrnoaWS212s/msOb0Boz8Nh5/inBC0JJi\nGtmig+aCbmtHa8cW61x1oXu9+kiFLUYsR/YQ+tz4CGRG1U3uz0WybCx1C3/p\nCYNTfpaMoqluzgWGYQPkhPYZsLTa0iyHS9nVQjh8OKU9bNgOI3YkEWgWmv4S\nCkDAhSzDJR1e70IqAlYtcS7A+fAZJrZDu9qdFNrdMZEa5oUiLbvu/s4QBOgd\nYjp4head2QtmmxrdnO+x9ythwHbNRr4ZD6pXSjuT0YwZyi1ATCKQZKzpl8hw\n9ajAnXG85NbtB1n7Kq0OkDZDXR/GjV7QlwcFUtiCDwSzDWXphnNaRGDvbf8o\nJuwa\r\n=CcaI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDX2MkjRwi6nhHE5MqHvDE3YNCaxYaIXwic/TNjTm8lPAIgJyndLC5L8TQwhaz5gqiBmZt2A6okpEyfr639zL+Ihh4="}]},"_npmUser":{"name":"rheaditi","email":"aditi.anomita@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/apollo-server-plugin-introspection-auth_1.0.1-beta.1_1582202620833_0.7361198871246679"},"_hasShrinkwrap":false},"1.0.1":{"name":"@cleartax/apollo-server-plugin-introspection-auth","version":"1.0.1","description":"An Apollo Server plugin to allow introspection only via authenticated requests","keywords":["apollo-server","apollo-server-plugin","apollo-server-express","plugins"],"homepage":"https://github.com/cleartax/apollo-server-plugin-introspection-auth#readme","bugs":{"url":"https://github.com/cleartax/apollo-server-plugin-introspection-auth/issues"},"repository":{"type":"git","url":"git+https://github.com/cleartax/apollo-server-plugin-introspection-auth.git"},"license":"MIT","author":{"name":"ClearTax Engineering","email":"opensource@cleartax.in"},"main":"dist/cjs/index.js","module":"dist/es/index.js","sideEffects":false,"scripts":{"build:cjs":"tsc --build tsconfig.cjs.json","build:es":"tsc --build tsconfig.es.json","build":"npm run build:es && npm run build:cjs","lint:fix":"eslint --fix .","lint":"eslint .","prebuild":"rm -rf dist","prepublishOnly":"npm-audit-ok && npm run build && package-ok","test":"jest"},"engines":{"node":">= 12"},"maintainers":[{"name":"cleartax","email":"npm@cleartax.in"}],"publishConfig":{"registry":"https://registry.npmjs.org"},"devDependencies":{"@cleartax/eslint-config":"^1.3.1","@types/jest":"^25.1.3","@types/node":"^13.7.1","@typescript-eslint/eslint-plugin":"^2.20.0","apollo-server":"^2.10.1","eslint":"^6.8.0","eslint-plugin-eslint-comments":"^3.1.2","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.7.0","eslint-plugin-json":"^2.0.1","eslint-plugin-jsx-a11y":"^6.2.3","eslint-plugin-lodash":"^6.0.0","eslint-plugin-markdown":"^1.0.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-promise":"^4.2.1","eslint-plugin-react":"^7.18.3","eslint-plugin-react-hooks":"^2.4.0","jest":"^25.1.0","prepublish-ok":"^0.5.0","prettier":"^1.19.1","ts-jest":"^25.2.1","typescript":"^3.7.5"},"peerDependencies":{"apollo-server":">= 2.10.1"},"dependencies":{"apollo-server-plugin-base":"^0.6.10"},"gitHead":"3ce3782d079ad9af55e299576a24965ca64f8159","_id":"@cleartax/apollo-server-plugin-introspection-auth@1.0.1","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-ngPcGo5Krk+cqc+vXzYSlDufB8bPU0ZSKp3IEjXaLaUDy1UvQwlcASq6/+uLcDcA049HlRAZN64dntvUBKIoFQ==","shasum":"87e12040918c077b2af834f9882f665083b3ae1f","tarball":"https://registry.npmjs.org/@cleartax/apollo-server-plugin-introspection-auth/-/apollo-server-plugin-introspection-auth-1.0.1.tgz","fileCount":10,"unpackedSize":10047,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeTpf1CRA9TVsSAnZWagAADsMQAJpQAaRV7qSrlg7Ppubc\nhyaV5cH8f7O/YlAMerHNWslsDlV2lexqZC26/RkgWsuYCCxY/KbQ0y47sgeW\n7gfl41OM37vJz5JkvzKBWTY8UKfxetCgcMXZs0Kdkw+0XT+mPKz8ImuQPCRQ\n2TsQhbNUPX/7ncvK9PfV2DW62SyGIi6Ig8r3yQlMcLC7isyCJNvmjsZsgy7I\nhVxeEqFNovUTRT9NF4DBilSqVxLvBnfWet/TMiEoDYOBPs3Lyf0Qp6GW5RKk\nTdHBnBg/DPZZjqUZO5fX/Gxh1Z2/V9ge1KhKkx5g7j4VEfPjKFzIz7dP5hGz\nMPexRiX5YeIZ5chzpLc9SwQfJZ4inLCNkFwtEEIoa14bwMDFhxNpC130Mymb\nDeTXW+CFuvrRxz1lRe7z06sVb4tqgtIR7hFEvVXLjrLy5OMWpAWROShap4Vo\nYCW5f1uWYax3DSAnfvKDRduPCTaZ7Z6YbfBaScqhmr/K6jeBqKTFhFzFYjaj\n49FOciCmsYvxfgYag9vFtNaut6cXHkL0uuiCOCuYd1WHdW+Ll8C0nxnSl1Fs\nkUHwmBzRZ5RP1EM66B3pQTaTnePw3MddkRTGTzgAAB0PG4tLM3dcwoNgWps6\nwXYgvJNVKrP4zTwE25AerL8HIF3KuMhlItyY3Grf/JZdDR38QDMPexfDLMNY\n/CjQ\r\n=n8xB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCwrx8INhMVtElGgMturV/T1066TxnNYlxk5A8BVSR3BQIhAN+eWyH74etlPa9n7wGi/LWCRsv9c8jJYWRJlcJLl8UV"}]},"_npmUser":{"name":"rheaditi","email":"aditi.anomita@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/apollo-server-plugin-introspection-auth_1.0.1_1582209012779_0.4173220617671489"},"_hasShrinkwrap":false},"1.1.0-0":{"name":"@cleartax/apollo-server-plugin-introspection-auth","version":"1.1.0-0","description":"An Apollo Server plugin to allow introspection only via authenticated requests","keywords":["apollo-server","apollo-server-plugin","apollo-server-express","plugins"],"homepage":"https://github.com/cleartax/apollo-server-plugin-introspection-auth#readme","bugs":{"url":"https://github.com/cleartax/apollo-server-plugin-introspection-auth/issues"},"repository":{"type":"git","url":"git+https://github.com/cleartax/apollo-server-plugin-introspection-auth.git"},"license":"MIT","author":{"name":"ClearTax Engineering","email":"opensource@cleartax.in"},"main":"dist/cjs/index.js","module":"dist/es/index.js","sideEffects":false,"scripts":{"build:cjs":"tsc --build tsconfig.cjs.json","build:es":"tsc --build tsconfig.es.json","build":"npm run build:es && npm run build:cjs","lint:fix":"eslint --fix .","lint":"eslint .","prebuild":"rm -rf dist","prepublishOnly":"npm-audit-ok && npm run build && package-ok","test":"jest"},"engines":{"node":">= 12"},"maintainers":[{"name":"cleartax","email":"npm@cleartax.in"}],"publishConfig":{"registry":"https://registry.npmjs.org"},"devDependencies":{"@cleartax/eslint-config":"^1.3.2","@types/jest":"^26.0.0","@types/node":"^14.0.13","@typescript-eslint/eslint-plugin":"^3.2.0","apollo-server":"^2.14.3","eslint":"^7.2.0","eslint-plugin-eslint-comments":"^3.2.0","eslint-plugin-import":"^2.21.2","eslint-plugin-jest":"^23.13.2","eslint-plugin-json":"^2.1.1","eslint-plugin-jsx-a11y":"^6.2.3","eslint-plugin-lodash":"^7.1.0","eslint-plugin-markdown":"^1.0.2","eslint-plugin-prettier":"^3.1.3","eslint-plugin-promise":"^4.2.1","eslint-plugin-react":"^7.20.0","eslint-plugin-react-hooks":"^4.0.4","jest":"^26.0.1","prepublish-ok":"^0.5.0","prettier":"^2.0.5","ts-jest":"^26.1.0","typescript":"^3.9.5"},"peerDependencies":{"apollo-server":">= 2.14.3"},"dependencies":{"apollo-server-plugin-base":"^0.9.0"},"readme":"# @cleartax/apollo-server-plugin-introspection-auth\n\n> An apollo plugin to secure introspection queries with token based authentication.\n\n---\n\n![npm (scoped)](https://img.shields.io/npm/v/@cleartax/apollo-server-plugin-introspection-auth?style=flat-square)\n![NPM](https://img.shields.io/npm/l/@cleartax/apollo-server-plugin-introspection-auth?style=flat-square)\n![David](https://img.shields.io/david/cleartax/apollo-server-plugin-introspection-auth?style=flat-square)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)\n\n## Installation\n\nInstall the plugin as dependency.\n\n```sh\nnpm install -S @cleartax/apollo-server-plugin-introspection-auth\n```\n\n`apollo-server` is a peer-dependency for this package.\n\nIf you haven't already, install it via:-\n\n```sh\nnpx install-peerdeps @cleartax/apollo-server-plugin-introspection-auth\n```\n\n## Usage\n\nWhen instantiating `ApolloServer`, pass the following options:-\n\n```ts\nconst apolloServer = new ApolloServer({\n  //...\n  introspection: true,\n  plugins: [\n    ApolloServerIntrospectionAuth({\n        type: 'header-token',\n        name: 'x-app-introspect-auth', // custom header name\n        value: ['<valid-auth-token>'], // valid header values\n      }),\n  ];\n});\n```\n\n**Note**: Ideally, you would want to add this configuration for non-development environments only. In which case, you can add the options conditionally. The following example illustrates adding it for higher environments in `apollo-server-express`:-\n\n```ts\n// this example uses `apollo-server-express`\nimport { ApolloServerExpressConfig, ApolloServer } from 'apollo-server-express';\nimport ApolloServerIntrospectionAuth from '@cleartax/apollo-server-plugin-introspection-auth';\n\nlet options: ApolloServerExpressConfig = {\n  // ...\n  // your default apollo server express config\n};\n\n// add this configuration for NON-development environments\nif (process.env.NODE_ENV === 'production') {\n  options = {\n    ...options,\n    playground: false, // turn off playground in production\n    introspection: true, // configure apollo to allow introspection\n    plugins: plugins.concat([\n      // add the plugin to check for authentication on introspection queries\n      ApolloServerIntrospectionAuth({\n          type: 'header-token',\n          name: 'x-app-introspect-auth', // header name\n          value: ['<valid-auth-token>'], // valid header values\n        }),\n    ]);\n  }\n}\n\nconst apolloServer = new ApolloServer(options);\n```\n\n## References\n\nInspired from [this](https://github.com/apollographql/apollo-server/issues/1933#issuecomment-580510024) implementation in [apollographql/apollo-server#1933](https://github.com/apollographql/apollo-server/issues/1933).\n\n1. [Apollo GraphQL](https://www.apollographql.com/docs/)\n2. [Apollo Graph Manager](https://www.apollographql.com/docs/graph-manager/)\n","readmeFilename":"README.md","gitHead":"01de9b54c4f6bed459d82eecbda305a144daf4e2","_id":"@cleartax/apollo-server-plugin-introspection-auth@1.1.0-0","_nodeVersion":"12.13.1","_npmVersion":"6.12.1","dist":{"integrity":"sha512-cbRe3SjLI4EEb7dAW1LSWOm0KhFatGRrfDUTUKaRIh9gof+8CNSyIzoFWlfh2rWVfEH4ABeA5+t2i8VmZjnIAQ==","shasum":"f01eb0eb2b507806ce94c99d2d5d752692562dd6","tarball":"https://registry.npmjs.org/@cleartax/apollo-server-plugin-introspection-auth/-/apollo-server-plugin-introspection-auth-1.1.0-0.tgz","fileCount":10,"unpackedSize":10217,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4J4yCRA9TVsSAnZWagAAfw4P/1xS+jUdJOd22AjsxFtR\nZWdk1pJGdiNRUkz5T4VzjW4zwd8oMMxIu+22ley8lU4jA65aMtEhTt27utoy\nOrQN7EdooLFBVyIXlwz6gIzUCkrBBiVVslKCZ7kAn18b87vjU2LJ2p/pA0nl\n1IjVv5NHka9ac95JN1eqaSWVh2Bavq/K3PSCKh7YNipxOzXgB5iQC9SI9wNp\nKHrBnZJ7f7qWYT7nK/x5Nbb1mPE12qGsXa4qI/J4qWfYWeRg3JU5hlTRiRIP\npgYJTpdGBXWZgCWC4O6fPEh2aqYdngt+BYovkazrOF90Wrhl/7ZBzDWXIMm3\nEIzHFdZkaE4lzep5zbdMyu+YfF5FfgYXTJ96lqBoe/VDpOBwPXlauF1xiLcT\n+Xhb4RjX/GY8JJp48jZH4eWHn4mknVsXsXJcoZfO/VPc8oWv/2QR1XmUg7fx\n4mbq/COKYYqnUoVtnRP1I4C3tCPa/T99lVdETl7vEr/Junt8YrA/1o/+Svyy\nHFFvFckLV3yllxSMYpWzr4uyREsbDsppGKejTEL0iaD0fvo/2Ky3sKeLjrlF\nLCxYIBgpChippux34GHYeX+HoYTc9/Vz2RSb54FHKynMZP4YggOxWGOXceEm\nJySBB08WBNCiqi4AmnSLufAAJr202GGiWR3Z//FddzZU6Qc/O7/b2gWZzu/E\nY1Gg\r\n=wj3o\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBRCQiiTOZMslioL9lm79Ps3MV3IYk11a9H1xfDFnc24AiEAx0ST7h28Yy7/WBT20OZsiMSevhcIkVWDntM5s6cb0nE="}]},"_npmUser":{"name":"rheaditi","email":"aditi.anomita@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/apollo-server-plugin-introspection-auth_1.1.0-0_1591778865712_0.8084461777798131"},"_hasShrinkwrap":false},"1.1.0":{"name":"@cleartax/apollo-server-plugin-introspection-auth","version":"1.1.0","description":"An Apollo Server plugin to allow introspection only via authenticated requests","keywords":["apollo-server","apollo-server-plugin","apollo-server-express","plugins"],"homepage":"https://github.com/cleartax/apollo-server-plugin-introspection-auth#readme","bugs":{"url":"https://github.com/cleartax/apollo-server-plugin-introspection-auth/issues"},"repository":{"type":"git","url":"git+https://github.com/cleartax/apollo-server-plugin-introspection-auth.git"},"license":"MIT","author":{"name":"ClearTax Engineering","email":"opensource@cleartax.in"},"main":"dist/cjs/index.js","module":"dist/es/index.js","sideEffects":false,"scripts":{"build:cjs":"tsc --build tsconfig.cjs.json","build:es":"tsc --build tsconfig.es.json","build":"npm run build:es && npm run build:cjs","lint:fix":"eslint --fix .","lint":"eslint .","prebuild":"rm -rf dist","prepublishOnly":"npm-audit-ok && npm run build && package-ok","test":"jest"},"engines":{"node":">= 12"},"maintainers":[{"name":"cleartax","email":"npm@cleartax.in"}],"publishConfig":{"registry":"https://registry.npmjs.org"},"devDependencies":{"@cleartax/eslint-config":"^1.3.2","@types/jest":"^26.0.0","@types/node":"^14.0.13","@typescript-eslint/eslint-plugin":"^2.34.0","apollo-server":"^2.14.3","eslint":"^7.2.0","eslint-plugin-eslint-comments":"^3.2.0","eslint-plugin-import":"^2.21.2","eslint-plugin-jest":"^23.13.2","eslint-plugin-json":"^2.1.1","eslint-plugin-jsx-a11y":"^6.2.3","eslint-plugin-lodash":"^7.1.0","eslint-plugin-markdown":"^1.0.2","eslint-plugin-prettier":"^3.1.3","eslint-plugin-promise":"^4.2.1","eslint-plugin-react":"^7.20.0","eslint-plugin-react-hooks":"^4.0.4","jest":"^26.0.1","prepublish-ok":"^0.5.0","prettier":"^2.0.5","ts-jest":"^26.1.0","typescript":"^3.9.5"},"peerDependencies":{"apollo-server":">= 2.14.3"},"dependencies":{"apollo-server-plugin-base":"^0.9.0"},"gitHead":"599e2dd44ad32a21c9b1bda5bb917ad67c90eb71","_id":"@cleartax/apollo-server-plugin-introspection-auth@1.1.0","_nodeVersion":"12.13.1","_npmVersion":"6.12.1","dist":{"integrity":"sha512-edqAMTVRt90CFkymYI6OqcU8DihicCMNF1mC04iuUyLzGMbjf+u9SG0SzTrgPAh78DfoyK5PNyjaPTXRje3hRQ==","shasum":"b30baf7413bd9058bb3feb8410259e365d447f21","tarball":"https://registry.npmjs.org/@cleartax/apollo-server-plugin-introspection-auth/-/apollo-server-plugin-introspection-auth-1.1.0.tgz","fileCount":10,"unpackedSize":10250,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4K3nCRA9TVsSAnZWagAAUmUP+wb9FIrxaPNtN8HXjEn4\nHJjrNg5XZq453Cx+pEIY6DMcfxiV/Z6zoLYQGfR/P9A2tR+O1B2Ww2+qFAca\nvlaCkeTrvtxG8w3h9gAcvuKE8VrAoZftZ/gD2oDmWQjOMzbP/4crc9eeNZQ6\nnMKJtQX69B4DGRRP07JupOHd+huN+LiQaKEE8StmvcwwGmBOJIhpAni8yveA\n3B2NP7B5jwNSFqirlmXfxJWmMNk2qc7U+pVwk0D0vfAS76QiRtnUWvB7WaEX\nKKc6Gzgd7C9dwSf3NyePzaDVPXGeWzT8VCgZjb4EiWW78xapWW06viMN4O02\n7ZyefqR1JD3W91Y9+LvD0enLwNcgUz0eMZGpDYYb1yZQe6r9Q6Xtnvd1MAbx\ncrUEsUUMuk7Sii1+vX9CeuSFm3qwdjJgsYzcSYbTQKjzyQ7W/7morngaxCEa\nr6yAfVveIrKB4vCQ5Jarrobs+ABiRjtwxpoKk/IVZZcGd6F7SUNHr5T/P8c8\nW+5cOfWZyoEuZBjQdl4DL/z3EfqHRdqKTd0dFAmtlOCf//neXxZoWYrHcCQ7\n0TOmCFm2IraoYmKhDh8TPSwlT1Nztxvkjlf62uvMudUFrslJCOrshbWoLMpc\nUF589QafcGA1Az94Gu6AUPShiInxu9SMNUQSz9tY7liE/Y0vlhhI6n1Ai66Z\ntVBV\r\n=3LAf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHnYG8Zd3s50i5wyr1xTh+KAUMVJgICfY+TFSF6NXxVuAiEAivKVsrV4w++3vkk97J1X34XtZqfEZecwZYbQ2m0MsAM="}]},"_npmUser":{"name":"rheaditi","email":"aditi.anomita@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/apollo-server-plugin-introspection-auth_1.1.0_1591782887261_0.530818821199424"},"_hasShrinkwrap":false}},"time":{"created":"2020-02-19T09:16:05.009Z","1.0.0-beta.1":"2020-02-19T09:16:05.272Z","modified":"2022-04-04T23:15:59.622Z","1.0.0-beta.2":"2020-02-20T09:37:09.215Z","1.0.0":"2020-02-20T09:59:00.546Z","1.0.1-beta.1":"2020-02-20T12:43:40.954Z","1.0.1":"2020-02-20T14:30:12.881Z","1.1.0-0":"2020-06-10T08:47:45.826Z","1.1.0":"2020-06-10T09:54:47.348Z"},"maintainers":[{"name":"cleartax","email":"npm@cleartax.in"}],"description":"An Apollo Server plugin to allow introspection only via authenticated requests","author":{"name":"ClearTax Engineering","email":"opensource@cleartax.in"},"license":"MIT","readme":"# @cleartax/apollo-server-plugin-introspection-auth\n\n> An apollo plugin to secure introspection queries with token based authentication.\n\n---\n\n![npm (scoped)](https://img.shields.io/npm/v/@cleartax/apollo-server-plugin-introspection-auth?style=flat-square)\n![NPM](https://img.shields.io/npm/l/@cleartax/apollo-server-plugin-introspection-auth?style=flat-square)\n![David](https://img.shields.io/david/cleartax/apollo-server-plugin-introspection-auth?style=flat-square)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)\n\n## Installation\n\nInstall the plugin as dependency.\n\n```sh\nnpm install -S @cleartax/apollo-server-plugin-introspection-auth\n```\n\n`apollo-server` is a peer-dependency for this package.\n\nIf you haven't already, install it via:-\n\n```sh\nnpx install-peerdeps @cleartax/apollo-server-plugin-introspection-auth\n```\n\n## Usage\n\nWhen instantiating `ApolloServer`, pass the following options:-\n\n```ts\nconst apolloServer = new ApolloServer({\n  //...\n  introspection: true,\n  plugins: [\n    ApolloServerIntrospectionAuth({\n        type: 'header-token',\n        name: 'x-app-introspect-auth', // custom header name\n        value: ['<valid-auth-token>'], // valid header values\n      }),\n  ];\n});\n```\n\n**Note**: Ideally, you would want to add this configuration for non-development environments only. In which case, you can add the options conditionally. The following example illustrates adding it for higher environments in `apollo-server-express`:-\n\n```ts\n// this example uses `apollo-server-express`\nimport { ApolloServerExpressConfig, ApolloServer } from 'apollo-server-express';\nimport ApolloServerIntrospectionAuth from '@cleartax/apollo-server-plugin-introspection-auth';\n\nlet options: ApolloServerExpressConfig = {\n  // ...\n  // your default apollo server express config\n};\n\n// add this configuration for NON-development environments\nif (process.env.NODE_ENV === 'production') {\n  options = {\n    ...options,\n    playground: false, // turn off playground in production\n    introspection: true, // configure apollo to allow introspection\n    plugins: plugins.concat([\n      // add the plugin to check for authentication on introspection queries\n      ApolloServerIntrospectionAuth({\n          type: 'header-token',\n          name: 'x-app-introspect-auth', // header name\n          value: ['<valid-auth-token>'], // valid header values\n        }),\n    ]);\n  }\n}\n\nconst apolloServer = new ApolloServer(options);\n```\n\n## References\n\nInspired from [this](https://github.com/apollographql/apollo-server/issues/1933#issuecomment-580510024) implementation in [apollographql/apollo-server#1933](https://github.com/apollographql/apollo-server/issues/1933).\n\n1. [Apollo GraphQL](https://www.apollographql.com/docs/)\n2. [Apollo Graph Manager](https://www.apollographql.com/docs/graph-manager/)\n","readmeFilename":"README.md","homepage":"https://github.com/cleartax/apollo-server-plugin-introspection-auth#readme","keywords":["apollo-server","apollo-server-plugin","apollo-server-express","plugins"],"repository":{"type":"git","url":"git+https://github.com/cleartax/apollo-server-plugin-introspection-auth.git"},"bugs":{"url":"https://github.com/cleartax/apollo-server-plugin-introspection-auth/issues"}}