All Projects → ojkelly → bunjil

ojkelly / bunjil

Licence: MIT license
A GraphQL bastion server with schema merging, authentication and authorization with Policy Based Access Control

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to bunjil

Prisma Tools
Prisma tools to help you generate CRUD system for GraphQL servers
Stars: ✭ 237 (+848%)
Mutual labels:  graphql-server, prisma
objection-authorize
isomorphic, "magical" authorization integration with Objection.js 🎉
Stars: ✭ 71 (+184%)
Mutual labels:  koa, authorization
Graphql Directive Auth
GraphQL directive for handling auth
Stars: ✭ 120 (+380%)
Mutual labels:  authorization, graphql-server
graphql-ufc-api
GraphQL server for UFC's public API
Stars: ✭ 26 (+4%)
Mutual labels:  koa, graphql-server
Got Auth Service
A professional role-based-authorization(also supports resource and group) service with restful and graphql api for enterprise applications.
Stars: ✭ 12 (-52%)
Mutual labels:  koa, authorization
Graphql Prisma Typescript
🏡 GraphQL server reference implementation (Airbnb clone) in Typescript using Prisma & graphql-yoga
Stars: ✭ 723 (+2792%)
Mutual labels:  graphql-server, prisma
midwayjs-crud
基于 Typescript+MidwayJs+Nacos 的微服务开发架构
Stars: ✭ 45 (+80%)
Mutual labels:  koa, prisma
graphql-cli-generate-fragments
Generate Fragments for Graphql Schemas
Stars: ✭ 43 (+72%)
Mutual labels:  graphql-server, prisma
Create Graphql
Command-line utility to build production-ready servers with GraphQL.
Stars: ✭ 441 (+1664%)
Mutual labels:  koa, graphql-server
Grant
OAuth Proxy
Stars: ✭ 3,509 (+13936%)
Mutual labels:  koa, authorization
koa-server
🗄️ GraphQL Back-end Server with Relay, Koa, MongoDB and Mongoose
Stars: ✭ 31 (+24%)
Mutual labels:  koa, graphql-server
Apollo Server
🌍  Spec-compliant and production ready JavaScript GraphQL server that lets you develop in a schema-first way. Built for Express, Connect, Hapi, Koa, and more.
Stars: ✭ 12,145 (+48480%)
Mutual labels:  koa, graphql-server
Node Rate Limiter Flexible
Node.js rate limit requests by key with atomic increments in single process or distributed environment.
Stars: ✭ 1,950 (+7700%)
Mutual labels:  koa, authorization
Blog Service
blog service @nestjs
Stars: ✭ 188 (+652%)
Mutual labels:  koa, graphql-server
role-based-access-control
Role-based authorization || Role-based access-control in React.js
Stars: ✭ 111 (+344%)
Mutual labels:  authorization
keeper
Flexible and Simple authentication solution for Phoenix
Stars: ✭ 27 (+8%)
Mutual labels:  authorization
Bless
Repository for BLESS, an SSH Certificate Authority that runs as a AWS Lambda function
Stars: ✭ 2,627 (+10408%)
Mutual labels:  bastion
Teleport
Certificate authority and access plane for SSH, Kubernetes, web apps, databases and desktops
Stars: ✭ 10,602 (+42308%)
Mutual labels:  bastion
koa-plus
The Koa framework extended for APIs. Optimized for security, scalability, and productivity.
Stars: ✭ 17 (-32%)
Mutual labels:  koa
DotNetGraphQL
A sample demonstrating how to create a GraphQL Backend in .NET and consume it from a .NET mobile app created using Xamarin
Stars: ✭ 78 (+212%)
Mutual labels:  graphql-server

Bunjil

View on npm npm downloads Dependencies Build Status codecov NSP StatusKnown Vulnerabilities FOSSA Status

bunjil.js.org | Getting Started

Bunjil is a public facing GraphQL server.

It comes with Policy Based authorization, and hook for your own authentication (Passport.js, Auth0, database).

It’s purpose is to allow the stitching of one or more private GraphQL Schemas into a public one.

Roadmap

  • Documentation
  • Merge multiple GraphQL schemas into one public schema
  • Ability to hide Types
  • Ability to hide fields (masking)
  • Policy based authorization down to the field/edge level
  • Ability to deny access to fields based on roles with a policy
  • Caching, and caching policies down to the field level
  • Authentication hook
  • Authorization hook

Getting Started

yarn add bunjil

npm install bunjil

// Import Bunjil and the Policy Types
import { Bunjil, Policy, PolicyCondition, PolicyEffect } from "bunjil";

// Create a schema

const typeDefs: string = `
  type User {
    id: ID
    name: String
    password: String
    posts(limit: Int): [Post]
  }

  type Post {
    id: ID
    title: String
    views: Int
    author: User
  }

  type Query {
    author(id: ID): User
    topPosts(limit: Int): [Post]
  }
`;

// Resolvers are not shown in this example.
const schema = makeExecutableSchema({
    typeDefs,
    resolvers,
});

// Create a simple policy allowing public access to the data
const policies: Policy[] = [
    {
        id: "public:read-all",
        resources: ["Query::topPosts", "Post::*", "User::*"],
        actions: ["query"],
        effect: PolicyEffect.Allow,
        roles: ["*"],
    },
    {
        // Explicitly deny access to the password field.
        // This will superseed any other policy
        id: "deny:user::password",
        resources: ["User::password"],
        actions: ["query"],
        effect: PolicyEffect.Deny,
        roles: ["*"],
    },
];

// Create our bunjil server
const bunjil: Bunjil = new Bunjil({
    // Server config
    server: {
        port: 3000,
        tracing: true,
        cacheControl: true,
    },
    // Optionally in DEV you can enable the GraphQL playground
    playgroundOptions: {
        enabled: false,
    },
    // Set the endpoints where GraphQL is available at
    endpoints: {
        graphQL: "/graphql",
        subscriptions: "/graphql/subscriptions",
        playground: "/playground",
    },
    policies,
});

// Add our schema to the Bunjil instance
bunjil.addSchema({ schemas: [schema] });

// Now start Bunjil
await bunjil.start();

Usage

Running the tests

Use yarn test or npm run test.

Tests are written with ava, and we would strongly like tests with any new functionality.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

License

FOSSA Status

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].