)]}'
{
  "commit": "b6955d1057fd9ae0fe5e2c8f1c97455651641404",
  "tree": "271cf9fa680fc52a7cf20bcc9c83ba6027c59151",
  "parents": [
    "dd0e1b86d37f009d15c628f2c196e7a61e6fee19"
  ],
  "author": {
    "name": "Edwin Kempin",
    "email": "ekempin@google.com",
    "time": "Tue Aug 13 12:44:03 2024 +0000"
  },
  "committer": {
    "name": "Edwin Kempin",
    "email": "ekempin@google.com",
    "time": "Wed Aug 14 14:24:00 2024 +0000"
  },
  "message": "Distinguish btw. messages that can be shown to all users vs. admins only\n\nCalling the CheckCodeOwner REST endpoint requires the caller to be an\nadmin (have the \u0027Administrate Server\u0027 capability or the \u0027Check Code\nOwner Capability\u0027). Due to this normal users cannot debug issues with\nOWNERS files on their own, but have to file tickets to find someone that\ncalls the REST endpoint and explains them the result. To reduce the\nticket load we intend to offer the CheckCodeOwner REST endpoint as a\nself-service that every user can invoke. For this we must hide all\ndebug messages that contain information that requires admin permissions.\n\nAs a first step towards offering the CheckCodeOwner REST endpoint as a\nself service we distinguish between messages that can be shown to any\ncalling user and messages that must only be shown to admin users:\n\n* Most messages can be shown to the calling user (e.g. they contain\n  information about the code owner config files that they can access\n  through other APIs).\n* Messages that explain why a code owner email is not resolvable reveal\n  information about whether an email exists or not and hence can be\n  shown only to admins (e.g. we must not reveal whether a non-visible\n  secondary email exists). Instead of the detailed message, for normal\n  users we just show a generic message that the email cannot be resolved\n  because it doesn\u0027t exist or because it is not visible.\n* Messages that explain what another user can see must only be shown to\n  admins (when we offer the CheckCodeOwner REST endpoint as a self\n  service we will not allow to specify a user for whom the evalution\n  should be done, so these message will never be triggered for normal\n  users, but to be safe we suppress them).\n\nOn API level there is no change yet: Since for now debug messages are\nonly returned for admins we always return the admin messages.\n\nBug: Google b/345161989\nChange-Id: Ib28802d38dc637dde82919f17b25014a174dbafc\nSigned-off-by: Edwin Kempin \u003cekempin@google.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "f6718eb25214fbdd780a90c4ec34dd3a909426fd",
      "old_mode": 33188,
      "old_path": "java/com/google/gerrit/plugins/codeowners/backend/CodeOwnerResolver.java",
      "new_id": "2f55c21d99a259cc35527e45908221b5b9b195a3",
      "new_mode": 33188,
      "new_path": "java/com/google/gerrit/plugins/codeowners/backend/CodeOwnerResolver.java"
    },
    {
      "type": "modify",
      "old_id": "4db3a4cba3755e4f9ef601465a74e31982ee4b3a",
      "old_mode": 33188,
      "old_path": "java/com/google/gerrit/plugins/codeowners/backend/CodeOwnerResolverResult.java",
      "new_id": "a973c8e1ab32ab58ab79d4c17e4a20a8248aa93c",
      "new_mode": 33188,
      "new_path": "java/com/google/gerrit/plugins/codeowners/backend/CodeOwnerResolverResult.java"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "9baa07b5af037b1114564f1c86f9c80b648b7c43",
      "new_mode": 33188,
      "new_path": "java/com/google/gerrit/plugins/codeowners/backend/DebugMessage.java"
    },
    {
      "type": "modify",
      "old_id": "6775d5b7df4dec247f9504814e6f7de88c142f14",
      "old_mode": 33188,
      "old_path": "java/com/google/gerrit/plugins/codeowners/backend/OptionalResultWithMessages.java",
      "new_id": "efff089bc43118f9b865f112743589c8d3fdfc35",
      "new_mode": 33188,
      "new_path": "java/com/google/gerrit/plugins/codeowners/backend/OptionalResultWithMessages.java"
    },
    {
      "type": "modify",
      "old_id": "2083fc2abda54e33ac2695dcc23c65b69dac2b0d",
      "old_mode": 33188,
      "old_path": "java/com/google/gerrit/plugins/codeowners/backend/PathCodeOwners.java",
      "new_id": "585c3e7b22df8a0298ac0e6dc1f97f75e56c7f48",
      "new_mode": 33188,
      "new_path": "java/com/google/gerrit/plugins/codeowners/backend/PathCodeOwners.java"
    },
    {
      "type": "modify",
      "old_id": "696776355ff5aa7e7f29dbc6aec92edfb26916bc",
      "old_mode": 33188,
      "old_path": "java/com/google/gerrit/plugins/codeowners/backend/PathCodeOwnersResult.java",
      "new_id": "b0ab1717896fd56584e331fcb8853daebaf5f93d",
      "new_mode": 33188,
      "new_path": "java/com/google/gerrit/plugins/codeowners/backend/PathCodeOwnersResult.java"
    },
    {
      "type": "modify",
      "old_id": "4ffc17940572cee96ff8b47b1fae427a31706865",
      "old_mode": 33188,
      "old_path": "java/com/google/gerrit/plugins/codeowners/restapi/AbstractGetCodeOwnersForPath.java",
      "new_id": "0e97a25d1cd790a858b81fea75d80c2841ff0488",
      "new_mode": 33188,
      "new_path": "java/com/google/gerrit/plugins/codeowners/restapi/AbstractGetCodeOwnersForPath.java"
    },
    {
      "type": "modify",
      "old_id": "b276c00261f0a1577709212fba2c7b27d0ed0b2c",
      "old_mode": 33188,
      "old_path": "java/com/google/gerrit/plugins/codeowners/restapi/CheckCodeOwner.java",
      "new_id": "303f9066f281fe3e45bd80bbbfef871e7eb53337",
      "new_mode": 33188,
      "new_path": "java/com/google/gerrit/plugins/codeowners/restapi/CheckCodeOwner.java"
    },
    {
      "type": "modify",
      "old_id": "bcd0072d68ee4d5722449bfdcb50094cbd6b0e20",
      "old_mode": 33188,
      "old_path": "java/com/google/gerrit/plugins/codeowners/restapi/GetCodeOwnersForPathInChange.java",
      "new_id": "2ee456d0a78a2eccfa76b0e73b86e104194794d7",
      "new_mode": 33188,
      "new_path": "java/com/google/gerrit/plugins/codeowners/restapi/GetCodeOwnersForPathInChange.java"
    },
    {
      "type": "modify",
      "old_id": "8d46152e0b05f660809e2b9c92b8aba6986d1452",
      "old_mode": 33188,
      "old_path": "java/com/google/gerrit/plugins/codeowners/testing/OptionalResultWithMessagesSubject.java",
      "new_id": "0f6cf3466b8749a5f08c3b9751a7dc99e6b8942d",
      "new_mode": 33188,
      "new_path": "java/com/google/gerrit/plugins/codeowners/testing/OptionalResultWithMessagesSubject.java"
    },
    {
      "type": "modify",
      "old_id": "febdf6b160b5ba858b01a1b87354c96495ff4a04",
      "old_mode": 33188,
      "old_path": "javatests/com/google/gerrit/plugins/codeowners/backend/CodeOwnerResolverResultTest.java",
      "new_id": "ed1d6c85d93be29560e125e20c83a0afd644d2e0",
      "new_mode": 33188,
      "new_path": "javatests/com/google/gerrit/plugins/codeowners/backend/CodeOwnerResolverResultTest.java"
    },
    {
      "type": "modify",
      "old_id": "ec97a3629dfdedb61166e6a597d533591ddec0e1",
      "old_mode": 33188,
      "old_path": "javatests/com/google/gerrit/plugins/codeowners/backend/CodeOwnerResolverTest.java",
      "new_id": "7fc6cece4d141ea4aa729f9575d87c8c31e188a8",
      "new_mode": 33188,
      "new_path": "javatests/com/google/gerrit/plugins/codeowners/backend/CodeOwnerResolverTest.java"
    }
  ]
}
