feat(collaboration): add UserExtraInfo with avatar and mail to CheckFileInfo#2560
Conversation
…ileInfo
Populate the UserExtraInfo WOPI property in CheckFileInfo so Collabora
Online can display user avatars in the collaborator list during
co-editing sessions.
Note: The avatar URL points to the Graph API photo endpoint, which is
now accessible without authentication for GET requests (proxy route
marked unprotected, graph auth middleware bypassed for photo
GETs) otherwise I was getting auth popups. This follows the same
common user pattern that users expect to.
```json
{
"avatar": "http://url/to/user/avatar",
"mail": "user@server.com"
}
```
https://sdk.collaboraonline.com/docs/advanced_integration.html#userextrainfo
so, after this we get in checkfileinfo the email as part of
UserExtraInfo:
```json
{
"BaseFileName": "Pedro-filled-hazcom.docx",
"UserFriendlyName": "Admin",
"UserId": "346364...39323030",
"UserCanWrite": true,
"UserCanRename": true,
"IsAdminUser": true,
"EnableInsertRemoteImage": true,
"EnableInsertRemoteFile": true,
"EnableOwnerTermination": true,
"UserExtraInfo": {
"avatar": "https://localhost:9200/graph/v1.0/users/4cd4ae16-11f0-408f-881e-a987da96d136/photo/$value",
"mail": "admin@example.org"
},
"PostMessageOrigin": "https://localhost:9200",
"message": "CheckFileInfo: success"
}
I have ran:
```
go test ./services/collaboration/... ./services/graph/... ./services/proxy/...
```
all tests have passed.
Signed-off-by: Pedro Pinto Silva <pedro.silva@collabora.com>
9bff898 to
454dfdc
Compare
|
|
I cannot see what are the specific complains from SonarCloud , I'm not part of the org so, I get some error when attempting to open it in my SonarCloud account. |
Yeah, that is really inconvenient. I took a quick look into the complaints and they all where about to much "Cognitive Complexity" (i.e. too deeply nested if/switch statements). SonarCloud is probably right about that, but I've "accepted" those warning for now, since it isn't your changes that introduced the complexity. Btw, I think you should see the warnings in the annotations here: https://github.com/opencloud-eu/opencloud/pull/2560/changes (I can see them there at least) Thanks for you contributions, I like it. We still need to take a deeper look into the changes before we can merge them. |


Populate the UserExtraInfo WOPI property in CheckFileInfo so Collabora
Online can display user avatars in the collaborator list during
co-editing sessions.
Note: The avatar URL points to the Graph API photo endpoint, which is
now accessible without authentication for GET requests (proxy route
marked unprotected, graph auth middleware bypassed for photo
GETs) otherwise I was getting auth popups. This follows the same
common user pattern that users expect to.
{ "avatar": "http://url/to/user/avatar", "mail": "user@server.com" }https://sdk.collaboraonline.com/docs/advanced_integration.html#userextrainfo
so, after this we get in checkfileinfo the email as part of
UserExtraInfo:
{ "BaseFileName": "Pedro-filled-hazcom.docx", "UserFriendlyName": "Admin", "UserId": "346364...39323030", "UserCanWrite": true, "UserCanRename": true, "IsAdminUser": true, "EnableInsertRemoteImage": true, "EnableInsertRemoteFile": true, "EnableOwnerTermination": true, "UserExtraInfo": { "avatar": "https://localhost:9200/graph/v1.0/users/4cd4ae16-11f0-408f-881e-a987da96d136/photo/$value", "mail": "admin@example.org" }, "PostMessageOrigin": "https://localhost:9200", "message": "CheckFileInfo: success" } I have ran:go test ./services/collaboration/... ./services/graph/... ./services/proxy/...