GithubHelp home page GithubHelp logo

clayrisser / ory-keto-client Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 0.0 660 KB

Ory Keto access control client for JavaScript and TypeScript

License: MIT License

TypeScript 100.00%
keto ory access-control rbac client

ory-keto-client's Introduction

ory-keto-client

npm GitHub npm type definitions GitHub stars

Ory Keto access control client for JavaScript and TypeScript

Please ★ this repo if you found it useful ★ ★ ★

Features

  • compatible with typescript
  • supports multiple roles
  • supports custom policies

Installation

npm install --save ory-keto-client

Dependencies

Usage

Import ory-keto-client

import Keto from 'ory-keto-client';

Create keto instance

const { env } = process;
const keto = new Keto(env.KETO_BASE_URL || 'http://localhost:4466');

Create policy

keto.createPolicy({
  description: 'bob is allowed read the blog',
  subjects: ['bob'],
  effect: 'allow',
  actions: ['read']
  resources: ['blog'],
});

Authorize subject

if (await keto.authorizeSubject('bob', 'read', 'blog')) {
  console.log('Authorized');
} else {
  console.log('Not Authorized');
}

Support

Submit an issue

Contributing

Review the guidelines for contributing

License

MIT License

Jam Risser © 2018

Changelog

Review the changelog

Credits

Support on Liberapay

A ridiculous amount of coffee ☕ ☕ ☕ was consumed in the process of building this project.

Add some fuel if you'd like to keep me going!

Liberapay receiving Liberapay patrons

ory-keto-client's People

Contributors

clayrisser avatar lavanya881 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.