web
web copied to clipboard
feat(ocm): implement WAYF page and enhance invitation workflow
Although this PR is referenced under https://github.com/cs3org/OCM-STA/issues/1, it is not directly part of the STA funded work. However, since the changes are closely related and beneficial to OCM, I decided to port them here as well for consistency.
This PR depends on this PR https://github.com/owncloud/reva/pull/432 to be merged in Reva. This PR depends on this PR https://github.com/owncloud/ocis/pull/11758 to be merged in oCIS.
Description
This PR implements the frontend components for WAYF (Where Are You From) functionality in the OCM web application, enabling users to discover and select their cloud provider when accepting federated invitations. The implementation provides a user friendly interface for OCM provider selection and complements the backend WAYF discovery endpoints.
Technical
Things I've added to the web application:
- WAYF Page: Provider selection interface with federation browsing and manual provider entry
- WAYF is public page: Public access to WAYF page without authentication requirement
- Invitation Acceptance Modal: Component for invitation acceptance workflow from other EFSS WAYF Pages
- Token Management: Multiple copy formats (plain, base64, WAYF link) for outgoing invitations
- Self-Domain Prevention: Prevent users from selecting their own instance
- Shared Composables: Reusable logic for invitation acceptance and WAYF functionality
- Federation list display with automatic grouping
- Manual provider domain entry with OCM discovery
Code Changes
-
New Components:
src/views/Wayf.vue: Main WAYF page with provider selection UI, search functionality, and federation displaysrc/views/InvitationAcceptanceModal.vue: Modal component for accepting invitations with provider validation
-
New Composables:
src/composables/useWayf.ts: Core WAYF logic including federation loading, provider discovery, and self-domain validationsrc/composables/useInvitationAcceptance.ts: Shared invitation acceptance logic with self-generated token detection
-
New Types:
src/types/wayf.ts: TypeScript interfaces for federation and provider data structures
-
Updated Routing (
src/index.ts):- Added
/wayfroute withauthContext: 'anonymous'for public access - Added
/accept-inviteroute for invitation acceptance workflow - Included authentication context documentation
- Added
-
Modified Views:
src/views/OutgoingInvitations.vue: Added three token copy options (plain, base64, WAYF link) with visual improvementssrc/views/IncomingInvitations.vue: Refactored to use shareduseInvitationAcceptancecomposablesrc/views/ConnectionsPanel.vue: Minor UI adjustmentssrc/views/App.vue: Updated to support new routes
-
Store Updates (
web-pkg/src/composables/piniaStores/inviteTokensList.ts):- Extended token objects with
tokenAtProviderandwayfLinkproperties
- Extended token objects with
-
Documentation:
docs/Where Are You From page.md: WAYF usage guide, API endpoints, and testing scenarios
Videos of the changes and general flow of the OCM app
From oCIS to Nextcloud
From Nextcloud to oCIS
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.
