Giter Site home page Giter Site logo

permify / go-role Goto Github PK

View Code? Open in Web Editor NEW
194.0 194.0 18.0 83 KB

Open source RBAC library. Associate users with roles and permissions.

Home Page: https://permify.co/

License: MIT License

Go 100.00%
access-control golang golang-library gorm open-source permission permissions rbac role-based-access-control

go-role's Introduction

Permify logo
Permify - Open Source Authorization Service

Permify Go Version  Permify Go Report Card  Permify Licence  Permify Discord Channel  Permify Release  Permify Commit Activity  GitHub Workflow Status  Scrutinizer code quality (GitHub/Bitbucket)  Coveralls

Permify - Open source authorization as a service

Join Our Team

Permify is on the lookout for engineers eager to tackle challenges in authorization. Join us!

We are hiring 

What is Permify?

Permify is a open-source authorization service for creating and managing fine-grained permissions in your applications and services. Inspired by Google’s consistent, global authorization system, Google Zanzibar

Our goal is to make Google's Zanzibar available to everyone and help them build robust, flexible, and easily auditable authorization systems that perform well in scaled environments.

With Permify, you can:

🔮 Create permissions and policies using Permify's flexible authorization language that is compatible with traditional roles and permissions (RBAC), arbitrary relations between users and objects (ReBAC), and attributes (ABAC).

🔐 Manage and store authorization data in your preferred database with high availability and consistency.

Interact with the Permify API to perform access checks, filter your resources with specific permissions, perform bulk permission checks for various resources, and more.

🧪 Test your authorization logic with Permify's schema testing. You can conduct scenario-based testing, policy coverage analysis, and IDL parser integration to achieve end-to-end validations for your desired authorization schema.

⚙️ Create custom and isolated authorization models for different applications using Permify Multi-Tenancy support, all managed within a single place, Permify instance.

Getting Started

QuickStart

You can quickly start Permify on your local with running the docker command below:

docker run -p 3476:3476 -p 3478:3478  ghcr.io/permify/permify serve

This will start Permify with the default configuration options:

  • Port 3476 is used to serve the REST API.
  • Port 3478 is used to serve the GRPC Service.
  • Authorization data stored in memory.

See all of the options that you can use to set up and deploy Permify in your servers.

Test your connection

You can test your connection with creating an GET request,

localhost:3476/healthz

Community ♥️

We would love to hear from you!

Get the latest product updates, receive immediate assistance from our team members, and feel free to ask any questions about Permify or authorization in a broader context by joining our conversation on Discord!

Join Our Discord 

Contributing

The open source community thrives on contributions, offering an incredible space for learning, inspiration, and creation. Your contributions are immensely valued and appreciated!

Here are the ways to contribute to Permify:

  • Contribute to codebase: We're collaboratively working with our community to make Permify the best it can be! You can develop new features, fix existing issues or make third-party integrations/packages.
  • Improve documentation: Alongside our codebase, documentation one of the most significant part in our open-source journey. We're trying to give the best DX possible to explain ourselves and Permify. And you can help on that with importing resources or adding new ones.
  • Contribute to playground: Permify playground allows you to visualize and test your authorization logic. You can contribute to our playground by improving its user interface, fixing glitches, or adding new features.

Bounties

Open Bounties

We have a list of issues where you can contribute and gain bounty award! Bounties will be awarded for fixing issues via accepted Pull Requests (PR).

Before start please see our contributing guide.

Roadmap

You can find Permify's Public Roadmap here!

Contributors ♥️

Communication Channels

If you like Permify, please consider giving us a ⭐

permify | Discord permify | Twitter permify | Linkedin

go-role's People

Contributors

egeaytin avatar firatcand avatar tolgaozen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

go-role's Issues

[BUG] permify cannot handle Uint64 for uint IDs

Describe the bug
When I try to use a uint taken from a unit64 as a user ID in UserHasAnyRoles(id, "admin"), I get the following error:

/go/pkg/mod/github.com/!permify/[email protected]/repositories/userRepository.go:199 failed to encode args[0]: unable to encode 0xe40e81495b2643ba into binary format for int8 (OID 20): 16433214242383348666 is greater than maximum value for int64
[0.643ms] [rows:0] SELECT count(*) FROM "user_roles" WHERE user_roles.user_id = 16433214242383348666 AND user_roles.role_id IN (1)

Versions

Permify-gorm version: 1.0.0

Go version: 1.20

Gorm version: v1.25.0

Database driver name: gorm.io/driver/postgres v1.5.2

Database version: 15.3

To Reproduce
Steps to reproduce the behavior:

import (
	"github.com/google/uuid"
	"encoding/binary"
	permify "github.com/Permify/permify-gorm"
)

func UintFromUUID(id uuid.UUID) uint {
	return uint(binary.BigEndian.Uint64(id[:8]))
}
_, err := permify.UserHasAnyRoles(UintFromUUID(claim.ID), "admin")
// err != nil

Expected behavior
UserHasAnyRoles should work since the PG DB column is BIGINT which is 64 bits in size and my code produces a uint based on a 64bit integer.

Additional context
Add any other context about the problem here.

Environment (please complete the following information, because it helps us investigate better):
I'm using golang:1.20.3-alpine3.17 Docker image

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.