APIs for authorization & access control

Add secure, flexible authorization to your application in minutes.

Get StartedView Docs
1import "github.com/warrant-dev/warrant-go"
2
3client := warrant.NewClient(warrant.ClientConfig{
4 ApiKey: "<your_api_key>",
5})
6
7isAuthorized, err := client.IsAuthorized(warrant.Warrant{
8 ObjectType: "store",
9 ObjectId: "91",
10 Relation: "edit",
11 User: warrant.WarrantUser{
12 UserId: "56",
13 },
14})
15
16if isAuthorized {
17 // Carry out authorized logic
18}
ACCESS PASS56ALLOWEDIT56STORE91SubjectSubjectObjectObject IDRelationObjectObject IDSTORE91

Simple Setup

1Add Warrant to sign-up flow

Track new and returning users in Warrant to manage their access rules via the Warrant dashboard.

2Define object types

Object types are a high level definition of your application data and how it relates to users.

3Create & enforce warrants

Warrants are access control rules you can apply to users and/or groups of users.

4Manage warrants via dashboard

Easily add access checks to your app across the tech stack with an SDK available in most popular languages.

5Client-side access checks (Optional)

Add access checks to your client application to show/hide parts of your UI for different users.

1import "github.com/warrant-dev/warrant-go"
2
3func signUp() error {
4 user, err := yourUserCreationLogic()
5 if err != nil {
6 return err
7 }
8
9 client := warrant.NewClient(warrant.ClientConfig{
10 ApiKey: <your_api_key>,
11 })
12
13 _, err := client.CreateUser(warrant.User{
14 UserId: "userId",
15 })
16 if err != nil {
17 return err
18 }
19}

Got questions? Join us on Slack!

slackJoin Slack