Skip to content

Commit

Permalink
Include CheckBulkPermissions API
Browse files Browse the repository at this point in the history
Updates to include 'PermissionService/CheckBulkPermissions' API
which will replace 'ExperimentalService/BulkCheckPermissions'.
  • Loading branch information
alecmerdler committed Mar 12, 2024
1 parent 2dcac56 commit f0287ad
Show file tree
Hide file tree
Showing 23 changed files with 5,026 additions and 1,622 deletions.
2 changes: 1 addition & 1 deletion magefiles/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func (g Gen) All() error {
const (
ProtoPath = "proto/authzed/api"
BufRepository = "buf.build/authzed/api"
BufTag = "14854970e303a3b8e2f9f53efbab9897b5c8f2b1"
BufTag = "4286d7d7e9b9d8a6aecf825e38947b8101869df5"
)

// Proto runs proto codegen
Expand Down
2 changes: 1 addition & 1 deletion magefiles/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/authzed/authzed-go/magefiles
go 1.20

require (
github.com/bufbuild/buf v1.27.1
github.com/bufbuild/buf v1.30.0
github.com/envoyproxy/protoc-gen-validate v1.0.1
github.com/golangci/golangci-lint v1.54.2
github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.2
Expand Down
122 changes: 122 additions & 0 deletions magefiles/go.work.sum

Large diffs are not rendered by default.

107 changes: 107 additions & 0 deletions proto/apidocs.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,40 @@
]
}
},
"/v1/permissions/checkbulk": {
"post": {
"summary": "CheckBulkPermissions evaluates the given list of permission checks\nand returns the list of results.",
"operationId": "PermissionsService_CheckBulkPermissions",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1CheckBulkPermissionsResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "body",
"description": "CheckBulkPermissionsRequest issues a check on whether a subject has permission \nor is a member of a relation on a specific resource for each item in the list.\n\nThe ordering of the items in the response is maintained in the response.\nChecks with the same subject/permission will automatically be batched for performance optimization.",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/v1CheckBulkPermissionsRequest"
}
}
],
"tags": [
"PermissionsService"
]
}
},
"/v1/permissions/expand": {
"post": {
"summary": "ExpandPermissionTree reveals the graph structure for a resource's\npermission or relation. This RPC does not recurse infinitely deep and may\nrequire multiple calls to fully unnest a deeply nested graph.",
Expand Down Expand Up @@ -1103,6 +1137,79 @@
},
"description": "BulkImportRelationshipsResponse is returned on successful completion of the\nbulk load stream, and contains the total number of relationships loaded."
},
"v1CheckBulkPermissionsPair": {
"type": "object",
"properties": {
"request": {
"$ref": "#/definitions/v1CheckBulkPermissionsRequestItem"
},
"item": {
"$ref": "#/definitions/v1CheckBulkPermissionsResponseItem"
},
"error": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"v1CheckBulkPermissionsRequest": {
"type": "object",
"properties": {
"consistency": {
"$ref": "#/definitions/v1Consistency"
},
"items": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/v1CheckBulkPermissionsRequestItem"
}
}
},
"description": "CheckBulkPermissionsRequest issues a check on whether a subject has permission \nor is a member of a relation on a specific resource for each item in the list.\n\nThe ordering of the items in the response is maintained in the response.\nChecks with the same subject/permission will automatically be batched for performance optimization."
},
"v1CheckBulkPermissionsRequestItem": {
"type": "object",
"properties": {
"resource": {
"$ref": "#/definitions/v1ObjectReference"
},
"permission": {
"type": "string"
},
"subject": {
"$ref": "#/definitions/v1SubjectReference"
},
"context": {
"type": "object"
}
}
},
"v1CheckBulkPermissionsResponse": {
"type": "object",
"properties": {
"checkedAt": {
"$ref": "#/definitions/v1ZedToken"
},
"pairs": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/v1CheckBulkPermissionsPair"
}
}
}
},
"v1CheckBulkPermissionsResponseItem": {
"type": "object",
"properties": {
"permissionship": {
"$ref": "#/definitions/v1CheckPermissionResponsePermissionship"
},
"partialCaveatInfo": {
"$ref": "#/definitions/v1PartialCaveatInfo"
}
}
},
"v1CheckPermissionRequest": {
"type": "object",
"properties": {
Expand Down
2 changes: 1 addition & 1 deletion proto/authzed/api/v0/core.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion proto/authzed/api/v0/developer.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion proto/authzed/api/v0/zz_generated.version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ package v0

const (
BufRepository = "buf.build/authzed/api"
BufTag = "14854970e303a3b8e2f9f53efbab9897b5c8f2b1"
BufTag = "4286d7d7e9b9d8a6aecf825e38947b8101869df5"
)
2 changes: 1 addition & 1 deletion proto/authzed/api/v1/core.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion proto/authzed/api/v1/debug.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 26 additions & 8 deletions proto/authzed/api/v1/error_reason.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion proto/authzed/api/v1/experimental_service.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion proto/authzed/api/v1/openapi.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f0287ad

Please sign in to comment.