-
Notifications
You must be signed in to change notification settings - Fork 33
feat: Public sharing via link #2236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: enh/noid/link-share-biz
Are you sure you want to change the base?
Conversation
9f86cfc to
6cc82e6
Compare
6cc82e6 to
7858b90
Compare
aa519cf to
c598627
Compare
0078f8d to
28fa2e9
Compare
1181f56 to
06729a5
Compare
This comment was marked as resolved.
This comment was marked as resolved.
- modifies oc_tables_share structure with two columns, token and password - adds ShareOCSController with a route to create link shares - adds a PageController front route to display the link share - adds a ApiPublicColumnsController to retrieve columns for public links. It was not added to the existing ApiColumnsController, as it requires the userId of the logged-in user and I did not want to weaken this detail. - adds an abstract controller for columns with shared functionality and make ApiColumnsController extend it. - adds a PublicRowOCSController for retrieving rows through link shares - adds a ShareToken value object - adds a ShareControlMiddleware for share token and existance validation. It comes with the AssertShareToken attribute. - extends Share entity with ShareToken and Password properties - extends ShareMapper to find a share by the share token - extends ShareService with a method to easily create link shares - extends ResponseDefinitions with TablesPublicRow and TablesPublicColumn specs. Essentially tableIDs are not exposed and also user ids in lastEditBy and createdBy are not disclosed. - extends RowService and ColumnService with methods to return such ^ formatted result arrays. - extends OpenAPI spec Signed-off-by: Arthur Schiwon <[email protected]>
Signed-off-by: Arthur Schiwon <[email protected]>
ea6afca to
0a12b1b
Compare
- reuses existing logic and templates from server, cf. OCP\AppFramework\AuthPublicShareController Signed-off-by: Arthur Schiwon <[email protected]>
0a12b1b to
fb4223f
Compare
- modifies oc_tables_share structure with two columns, token and password - adds ShareOCSController with a route to create link shares - adds a PageController front route to display the link share - adds a ApiPublicColumnsController to retrieve columns for public links. It was not added to the existing ApiColumnsController, as it requires the userId of the logged-in user and I did not want to weaken this detail. - adds an abstract controller for columns with shared functionality and make ApiColumnsController extend it. - adds a PublicRowOCSController for retrieving rows through link shares - adds a ShareToken value object - adds a ShareControlMiddleware for share token and existance validation. It comes with the AssertShareToken attribute. - extends Share entity with ShareToken and Password properties - extends ShareMapper to find a share by the share token - extends ShareService with a method to easily create link shares - extends ResponseDefinitions with TablesPublicRow and TablesPublicColumn specs. Essentially tableIDs are not exposed and also user ids in lastEditBy and createdBy are not disclosed. - extends RowService and ColumnService with methods to return such ^ formatted result arrays. - extends OpenAPI spec Signed-off-by: Arthur Schiwon <[email protected]>
- modifies oc_tables_share structure with two columns, token and password - adds ShareOCSController with a route to create link shares - adds a PageController front route to display the link share - adds a ApiPublicColumnsController to retrieve columns for public links. It was not added to the existing ApiColumnsController, as it requires the userId of the logged-in user and I did not want to weaken this detail. - adds an abstract controller for columns with shared functionality and make ApiColumnsController extend it. - adds a PublicRowOCSController for retrieving rows through link shares - adds a ShareToken value object - adds a ShareControlMiddleware for share token and existance validation. It comes with the AssertShareToken attribute. - extends Share entity with ShareToken and Password properties - extends ShareMapper to find a share by the share token - extends ShareService with a method to easily create link shares - extends ResponseDefinitions with TablesPublicRow and TablesPublicColumn specs. Essentially tableIDs are not exposed and also user ids in lastEditBy and createdBy are not disclosed. - extends RowService and ColumnService with methods to return such ^ formatted result arrays. - extends OpenAPI spec Signed-off-by: Arthur Schiwon <[email protected]>
Signed-off-by: Enjeck C. <[email protected]>
Signed-off-by: Enjeck C. <[email protected]>
Signed-off-by: Enjeck C. <[email protected]>
Signed-off-by: Enjeck C. <[email protected]>
Signed-off-by: Enjeck C. <[email protected]>
Signed-off-by: Enjeck C. <[email protected]>
Signed-off-by: Enjeck C. <[email protected]>
Signed-off-by: Enjeck C. <[email protected]>
06729a5 to
554bf99
Compare
Signed-off-by: Enjeck C. <[email protected]>
Should be fixed now @blizzz |
blizzz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works! Some cosmetic remarks. I skimmed front-end code only tbh.
| * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors | ||
| * SPDX-License-Identifier: AGPL-3.0-or-later | ||
| */ | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think all the changes in this file are not necessary?
| protected IInitialState $initialState, | ||
| protected ShareService $shareService, | ||
| protected NodeService $nodeService, | ||
| protected IL10N $l, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need it and its use clause here anymore
| $token = $request->getParam('token'); | ||
| if (is_string($token) && $token !== '') { | ||
| $this->shareToken = new ShareToken($token); | ||
| try { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we not have this try block? Or why do we need it? Properties should not be nullable ideally.
| public function isValidToken(): bool { | ||
| $this->shareToken; | ||
| return true; | ||
| return $this->share !== null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yeah, my code was a leftover after refactoring. Before it would fetch it, and succeed, or fail. If we need this than the nullable approach is ok for now.
| * @psalm-type TablesPublicNode = array{ | ||
| * title: string, | ||
| * emoji: string, | ||
| * description: string, | ||
| * createdAt: string, | ||
| * lastEditAt: string, | ||
| * rowsCount: int, | ||
| * } | ||
| * |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
goes away, openapi ci will complain when it is not used in the spec.
|
|
||
| /** | ||
| * Checks if a share is a public link share | ||
| * @param {object} share |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is some jsdoc warning ☝️ 🤷
fb4223f to
f567947
Compare
f567947 to
434fc6a
Compare

part of #67
TODO