Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The gRPC API does not allow us to delete relation tuples in bulk when Subject is not specified #1615

Open
4 of 5 tasks
evgeniradev opened this issue Oct 30, 2024 · 0 comments
Labels
bug Something is not working.

Comments

@evgeniradev
Copy link

evgeniradev commented Oct 30, 2024

Preflight checklist

Ory Network Project

No response

Describe the bug

The REST API allows us to delete relation tuples in bulk when the Subject is not specified. However, the gRPC API does not - it expects a Subject to be provided at all times and raises and error if it is missing.

Reproducing the bug

gRPC example in Ruby:

require 'ory/keto/relation_tuples/v1alpha2/write_service_services_pb'

relation_tuple = 
  Ory::Keto::RelationTuples::V1alpha2::RelationTuple.new(
    namespace: 'Namespace_A', 
    object: '123',
    relation: 'members'
  )

request = Ory::Keto::RelationTuples::V1alpha2::TransactRelationTuplesRequest.new(
  relation_tuple_deltas: [
    Ory::Keto::RelationTuples::V1alpha2::RelationTupleDelta.new(
      action: Ory::Keto::RelationTuples::V1alpha2::RelationTupleDelta::Action::ACTION_DELETE,
      relation_tuple:
    )
  ]
)

Ory::Keto::RelationTuples::V1alpha2::WriteService::Stub.new(
  OryKetoApiClient.base_write_api_url,
  :this_channel_is_insecure,
).transact_relation_tuples(request)

# GRPC::InvalidArgument: 3:subject is not allowed to be nil. debug_error_string:{UNKNOWN:Error received from peer  {created_time:"2024-10-30T09:28:01.470304+00:00", grpc_status:3, grpc_message:"subject is not allowed to be nil"}}

REST example in Ruby:

require 'http'

HTTP.headers(
  'Accept' => 'application/json',
  'Content-Type' => 'application/json'
).delete('http://localhost:4467/admin/relation-tuples?namespace=Namespace_A&object=123&relation=members')

Relevant log output

No response

Relevant configuration

No response

Version

v0.13.0-alpha.0

On which operating system are you observing this issue?

None

In which environment are you deploying?

None

Additional Context

No response

@evgeniradev evgeniradev added the bug Something is not working. label Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working.
Projects
None yet
Development

No branches or pull requests

1 participant