New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@graphql-authz/envelop-plugin

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@graphql-authz/envelop-plugin

Envelop plugin for graphql-authz

  • 1.0.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
394
decreased by-13.02%
Maintainers
1
Weekly downloads
 
Created
Source

@graphql-authz/envelop-plugin

Configuring for Envelop

Ensure context parser is configured to perform authentication and add user info to context

  const getEnveloped = envelop({
    plugins: [
      ...
      useExtendContext(req => ({
        user: someHowAuthenticateUser(req.get("authorization"))),
      })),
      ...
    ]
  });

or

  getEnveloped({
    user: someHowAuthenticateUser(req.get("authorization"))),
  });

Add plugin to envelop

  import { authZEnvelopPlugin } from "@graphql-authz/envelop-plugin";
  
  const getEnveloped = envelop({
    plugins: [
      ...
      authZEnvelopPlugin({ rules })
      ...
    ]
  });

For Directives usage

Apply directive transformer to schema

import { authZDirective } from '@graphql-authz/directive';
import { authZEnvelopPlugin } from "@graphql-authz/envelop-plugin";

const { authZDirectiveTransformer } = authZDirective();

const transformedSchema = authZDirectiveTransformer(schema);

const getEnveloped = envelop({
  plugins: [
    useSchema(transformedSchema),
    authZEnvelopPlugin({ rules })
    ...
  ]
});

For AuthSchema usage

Pass additional parameter authSchema to authZEnvelopPlugin

import { authZEnvelopPlugin } from "@graphql-authz/envelop-plugin";
  
const getEnveloped = envelop({
  plugins: [
    ...
    authZEnvelopPlugin({ rules, authSchema })
    ...
  ]
});

Keywords

FAQs

Package last updated on 12 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc