Commit 9bff898
committed
feat(collaboration): add UserExtraInfo with avatar and mail to CheckFileInfo
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>1 parent 0c8829c commit 9bff898
File tree
6 files changed
+42
-3
lines changed- services
- collaboration/pkg/connector
- fileinfo
- graph/pkg/middleware
- proxy/pkg/config/defaults
6 files changed
+42
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1302 | 1302 | | |
1303 | 1303 | | |
1304 | 1304 | | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
1305 | 1316 | | |
1306 | 1317 | | |
1307 | 1318 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1994 | 1994 | | |
1995 | 1995 | | |
1996 | 1996 | | |
| 1997 | + | |
| 1998 | + | |
| 1999 | + | |
| 2000 | + | |
1997 | 2001 | | |
1998 | 2002 | | |
1999 | 2003 | | |
| |||
Lines changed: 12 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
3 | 11 | | |
4 | 12 | | |
5 | 13 | | |
| |||
62 | 70 | | |
63 | 71 | | |
64 | 72 | | |
65 | | - | |
| 73 | + | |
| 74 | + | |
66 | 75 | | |
67 | 76 | | |
68 | 77 | | |
| |||
131 | 140 | | |
132 | 141 | | |
133 | 142 | | |
134 | | - | |
| 143 | + | |
| 144 | + | |
135 | 145 | | |
136 | 146 | | |
137 | 147 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
| 116 | + | |
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
44 | 51 | | |
45 | 52 | | |
46 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
273 | 273 | | |
274 | 274 | | |
275 | 275 | | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
276 | 283 | | |
277 | 284 | | |
278 | 285 | | |
| |||
0 commit comments