Uploaded image for project: 'Hybrid Cloud Console'
  1. Hybrid Cloud Console
  2. RHCLOUD-35058

Support namespacing in filters in ReadRelations and DeleteRelations

XMLWordPrintable

    • 3
    • False
    • Hide

      None

      Show
      None
    • False
    • Unset
    • None
    • ReBAC Sprint 16

      Problem

      Currently the `resource_namespace` and `subject_namespace` defined in `RelationTupleFilter` and `RelationTupleFilter`, respectively, in the proto (see proto) are not integrated into the filtered searches for `ReadRelationships` and `DeleteRelationships` in the SpiceDbRepository implementation in the relations-api (see spicedb.go). As it stands, the namespace can be added by prefixing `namespace/` before the object type, but this is wrong. The namespace should be added correctly via the above fields and it should not be possible to add such a prefix to the object type.

      This is a regression, because these filtered requests worked as intended prior to the introduction of namespacing.

      Tasks

      Namespacing should be implemented and mapped to spicedb types correctly. Furthermore, since spicedb cannot support filters where only one of namespace or object type is specified, a bad request should be return if requests supply a filter with one but not the other defined. 

      In practice, most/all of the logic can be added here.

      Acceptance criteria

      1. ReadRelationships and DeleteRelationships requests with filters supplying a namespace should be honoured in the spicedb repository implementation.
      2. A bad request should be returned to the client in the case where a namespace is supplied in the filter without an object type or an object type is supplied without a namespace. (This remains a legal option for kessel, but is unsupported in the spicedb implementation.)

            mmclaugh@redhat.com Mark McLaughlin
            mmclaugh@redhat.com Mark McLaughlin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: