openfga icon indicating copy to clipboard operation
openfga copied to clipboard

[DO NOT MERGE] ListUsers API

Open willvedd opened this issue 1 year ago • 2 comments

Description

Introducing the ListUsers API which answers the question "what users are related to a specific object?". To learn more about this feature, refer to the ListUsers RFC.

Note: This is the parent PR for ListUsers development. All work going forward will be branched and merged into this PR. It will be intentionally left as a draft until we are ready to merge into the codebase.

References

Review Checklist

  • [ ] I have clicked on "allow edits by maintainers".
  • [ ] I have added documentation for new/changed functionality in this PR or in a PR to openfga.dev [Provide a link to any relevant PRs in the references section above]
  • [ ] The correct base branch is being used, if not main
  • [ ] I have added tests to validate that the change in functionality is working as expected

willvedd avatar Mar 08 '24 22:03 willvedd

Codecov Report

Attention: Patch coverage is 92.97235% with 61 lines in your changes are missing coverage. Please review.

Project coverage is 87.03%. Comparing base (b0b3501) to head (45dca6f).

Files Patch % Lines
pkg/server/commands/listusers/list_users.go 63.89% 17 Missing and 9 partials :warning:
pkg/server/commands/listusers/list_users_rpc.go 95.62% 17 Missing and 7 partials :warning:
pkg/tuple/tuple.go 93.11% 4 Missing :warning:
pkg/server/server.go 82.36% 3 Missing :warning:
pkg/server/commands/listusers/validate.go 95.46% 2 Missing :warning:
pkg/server/list_users.go 97.19% 1 Missing and 1 partial :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1433      +/-   ##
==========================================
+ Coverage   86.21%   87.03%   +0.83%     
==========================================
  Files          90       95       +5     
  Lines        8466     9325     +859     
==========================================
+ Hits         7298     8115     +817     
- Misses        826      856      +30     
- Partials      342      354      +12     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Mar 26 '24 22:03 codecov[bot]

CLA Signed

The committers listed above are authorized under a signed CLA.

  • :white_check_mark: login: willvedd / name: Will Vedder (600fe9a3b7604056aaea79c68c1f6a596da82818, 98d8c6c85d602986388365b89224c606a9f3651d, e7b069d6777c8dc3891d884cf0d7f6ac280a720c, 9dd1d60ed7cc1d45d512e616419841c09298a691, 40ec32f02e8c1b214fcccbe5f26fe77f6f0cc95f, 8e98c3d5d4be7051db0554dbdde8dbdb989edcd6, 5970ce60f18bbfdfff7cc9b7cb876e1bd86dafd1, 8a5a0da094f41e2682c1a60db8a662155c1c866b, e4b081d8252f41a65416db25f4395395e502703d, accaef509a81ac881909b2d45f87c3cda00f1861, 5a7d3c7238660e7c8f770fe4c99fbd55fc1f3717, 8c8da8508079ee12866ac6dd2cdb5133ac71ddff, fc75d74992f2cbc5044a6262acae7a32a5a1a23b, c8a01138359787d8a22b090ee223af108ec2dd87, 767a7f6028b73c8822e5cbe6306bf14d4b40770c, a702e95699c10eb12fe71e2ab9fe3276a6bc9869, c2fcca8ff811fd70fadb583844b63c409ed70776, 4833f4ee84afb5d3deecd71b70f1968d54c71d8e, 73eae483fafbbcf7cc6ff737e41f86a0287efd68, c7c3f3c8bd2aea08fda9aabb11036ab18aae32ff, 7187f36715e666c0c680f1178e31a61d3f6655d8, 5e6c3e632a405f5dd6a6425d2387cef6a21754d3, 2d99278c27c76d79beca8b57adfec9b2586e8e2d, 6b106365eb74867b347547d5aece0ddf8c3f47f2, 568e89cbf8a2ba2d8d947d339e9c51b36e73c37a, bd4a40e608cbce44e611136c00a3fe957f588213, 9c7547ecbd5a1444164ea5d5debb1a2e3997b7de, 41730e63191093399aded1b7ba7b67116e5b35fa, 4ccbac514395cc4c5832db6e83d0b773fd5bcb53, 3893b38bba45bf58c4e61161a533e935a5a7bd87, 9b7ad7fd5396530df77dbb0272ccd2227a8b5c34, 5143b3af9e91481c63f5831c182fb1eaf344fb92, 348aba4ad8710988a30778cf61c2ad60061c7c48, c28b50c4088fe2c6f218e1ec5ac2fdbfdb57356b, afdfb14eac70dff854db0492cd00587fd73b3ca3, d44c52613bd0539fab96757d7e6ff603c80fd171, 56f66a35f666273b31e9ce8eef1a5110810cab71, aeb8407517d22b2aa4a99e927c2efc97f63fc652, 5fd262b2102615248a8f851f618f11a8cea97a0e, 25ccfc964f4f927027b7da45f0858f08ca3e2fb4, dcd3a9d6478af2146ca1423acef296c1863416fc, acbe2d080d7996ba0746caba9548f9ce68f2c8c9, 095af1d7cfcaecaed58d055d0911b35a8bc34ad5, 493a72cb67e4ec71f112277e6dacfbaf67bf1395, 9107b871474eebec462311b8c986f54d63c16e9c, 92ec5b181f705b098d0bf640ce9ad396f7218c71, 56ad41b0093962911b9e521884916cf5b5be8abc, 0634e160510ddcd9d906acdbc14317177e3795be, d6300628515c12a6a9447561080af2116670f778, 4059f879f1f04018dd41c618fbf7e7d068234412, 5d273abfff09310ed4f496991e7ff42ae5194bcb, 38d00a0a4fb800fdd8569448391c2d00a3eb6bc4, dae5995710ee0951713037db6c3df950b3088709, 40a3c09328858579b951966436ec2a25b8d05599, c253b6b77e0e2baa41264bc3529997df3962ca32, 6ebe09dad7450837014011107b9800e119bb7f6c, b122178a62c55415e4e2d1e027c90c28ac0a22f8, 041b48907468b0e6a6627f7486761bfdf4cb1a6c, 0142415193b6194653a4606d85ddc12a7d192f86, 9ea3767377d86648b1671277486c9fc0c46ff462, a8ba788953f8c8f992ec8029fd50659f507b1937, 62a9c998d82d862f386a628c61bfa3f831f46b70, f77a05ea715ab14ee9f9986400b2f6fa41fb679a, e16b514776f263cb5607c650520595105e6e93a8, b68f8159800c291bb87e0d4e27daf1d91ce9b2ab, a3da54267bdc4cab2fd4959ad846bf0ca5ed94d2, f621e6bbfd6bda8fbdce0dcb302ad78f19f2c4c8, 633db65f993e5aa65dd9b6b7c76863b45583ae7c, 55b0f82ce9d6e4d36a8c3963eb3f83a7673876ee, 8655dfae3b0cf1cbc696f82278c0a2efadbbb739, 0be2a16dc849770bbda63c7a2fa5487ea4d8a369, f38ad0ec8a7a44a2fcad0e979f0e571a78355ffb, f85053ee7e16145fd5b18c0e340e19ef26b44cbc, 582aae35da7a29c598450e359f30b354f308bae0, 313d07892cb3471654c80018b85f764883ec8150, 10ffdbcbfee42f8490c2ac9eec16e8b7f00c011e, fa1026e027d395c85f41ad721dbf36553e719212, e7b1a2dcab179559342c714d0260ead0542eaad0, d4d4d392376a99f87313ade0bff1f2e3756b5da0, bfb1e0047c415240f953fce62ba0b51697a4e32b, b7086b1701ef0bf1c6bedd81c36cd74cd4978183, 49f868789e2d8cb1491cab8c70f8947d70e6cc0c, c1133ef3ec8dbf537eafcbe73e2d08c78bd4dbc6, 90d2c5b422294bf36374e559d4401ff3935ef166, 45dca6f8d7468f71f35d7bc301da7ff254f1c8fe, 2721553555a36fa8809f61bbcccdc4c8e2161e93, f2f525294a1e11c81ebb4d9ecb4d3fd72926e65c, f18c870987969f39deb6ae9cd156159dcf281548, c4953b813b89c4d86d01855037569a50db7bca9c, 3a0a62ccd0fa55fe17a7af2e3d29085cf144427f, 25c237f7ee0277d864e61fe7fc8ddd59c1a4896e, bb030011a8ac80703db8a891ffb9de30bb326311)
  • :white_check_mark: login: miparnisari / name: Maria Ines Parnisari (e1534db049fd30286775fe31e45ddd42d4a5ce00, e510c681436b19b59f679d53c5cf052373812e6d, e0608555f73bdd50439679dff6730e01ede103d8, b35c0955b22b5927f531b37c21f4da453e726b5a, b29f56656b70ec1477aa5e1500d685496fbc1758, 64affd7a8100a783a3131625528012a51b3b8d47, a64d08862ad1af999be7a322d586f05e08e9d80f, f4e9de220e2211fa7e069dbc43f89e2f1d69cbbf, 804f71c1d8f48d4b855a114caebf911342c29d63, ee584255f448165c8762be0c8bdac4c67517e602, fcc29a4b643a6035164be1290a2e7c9c9355b9a5, d5ada2e64f572d2c9c199f213a48237c771dde52, e25b59fd7599b4ad0c9b1104e2906b5cee958b98, 4954cd6c780fba9efe2cc30509e8fdd9e8745208, 84a8ec8cdd430232990e3c54e8b3eb0cd01255fd)
  • :white_check_mark: login: jon-whit / name: Jonathan Whitaker (257a482e7b121920ec510aeaaf89f8b9f7d1cb6b, b271bf6bbcd955a5ffd49ab2ed50f24a70d03fa8, c170551f2724a4e85c187f0f60e0fd89bc252645, d994904e48cba3c28a3b735b4646038c21ae9415)
  • :white_check_mark: login: poovamraj / name: Poovamraj T T (073ff3a534a4a8700efd076eae24785962c7c2e8)

Not sure we should be treating this like a user. It's a string of format type#relation where #relation is optional. Treating it as a user is a hack. It should have a unique representation and converters to/from proto. Not sure that belongs in this package listusers either, but we can revisit that later. We're probably missing a pkg/types package where human readable helpers can convert to/from protos?

Lets not look too much into the argument name. We're just using an established convention to specify type and optional relation, why would we create a whole new system for this? It's only to facilitate our integration testing too.

willvedd avatar May 29 '24 16:05 willvedd