Coder Social home page Coder Social logo

permify / permify-validate-action Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 1.0 38 KB

GitHub Action for validation your Permify schema (Authorization Model)

Home Page: https://docs.permify.co/

License: Apache License 2.0

Dockerfile 82.33% Shell 17.67%
access-control fga github-actions permify zanzibar

permify-validate-action's Introduction

Permify logo
Permify Schema Validate GitHub Action

Permify Licence  Permify Discord Channel 

Screenshot 2023-04-06 at 1 55 00 AM

This repository runs the permify validate command on the given schema (authorization model) and relationships (sample authorization data) and assertions (sample check queries and results).

You can find detailed information on this repository in the Testing & Validation part of our documentation.

Example Schema Validation YAML File

schema: >-
  entity user {}

  entity organization {

      relation admin @user
      relation member @user

      permission create_repository = (admin or member)
      permission delete = admin
  }

  entity repository {

      relation owner @user
      relation parent @organization

      permission push = owner
      permission read = (owner and (parent.admin and parent.member))
      permission delete = (parent.member and (parent.admin or owner))
  }

relationships:
  - "organization:1#admin@user:1"
  - "organization:1#member@user:1"
  - "repository:1#owner@user:1"

scenarios:
  - name: "scenario 1"
    description: "test description"
    checks:
      - entity: "repository:1"
        subject: "user:1"
        assertions:
          push : true
      - entity: "repository:2"
        subject: "user:1"
        assertions:
          push : false
      - entity: "repository:3"
        subject: "user:1"
        assertions:
          push : false

Usage

Add the action following your workflow:

  • With local file
steps:
  - uses: "permify/permify-validate-action@v1"
    with:
      validationFile: "test.yaml"
  • With url
steps:
  - uses: "permify/permify-validate-action@v1"
    with:
      validationFile: "https://gist.github.com/permify-bot/bb8f95acb64525d2a41688ae0a6f4274"

Permify is an open-source authorization service for creating and maintaining fine-grained authorizations across your individual applications and services.

Testing in Local

You can also test your new authorization model in your local (Permify clone) without using permify-validate-action at all.

For that open up a new file and add a schema yaml file inside. Then build your project with, run make run command and run ./permify validate {path of your schema validation file}.

If we use the above example schema validation file, after running ./permify validate {path of your schema validation file} it gives a result on the terminal as:

Community & Support

Join our Discord channel for issues, feature requests, feedbacks or anything else. We love to talk about authorization and access control ❤️

permify | Discord permify | Twitter permify | Linkedin

permify-validate-action's People

Contributors

egeaytin avatar tolgaozen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

aliaqa256

permify-validate-action's Issues

Run validation with external permission schema file

At the moment the action expects the schema to be embedded inline in the validation file such as:

schema: >-
  entity user {}
  entity workspace {
    relation member @user
    relation admin @user
  }
relationships: []

The configuration supports to pass external app.perm file that can be loaded directly in the validation file:

schema: ./app.perm
relationships: []

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.