From dcdc02e0a2fe12d40ff0e88819ea25d4b514e3a2 Mon Sep 17 00:00:00 2001 From: Lovisa Lugnegard Date: Wed, 1 Apr 2020 14:37:30 +0200 Subject: [PATCH 1/9] Add endpoints for accept and forward invite --- spec.yaml | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 69 insertions(+), 1 deletion(-) diff --git a/spec.yaml b/spec.yaml index a7ba5cd9..29014308 100644 --- a/spec.yaml +++ b/spec.yaml @@ -355,6 +355,42 @@ paths: type: string schema: $ref: "#/definitions/Error" + /invite/accept: + post: + summary: Accept an invite to a shared document + description: Foo + parameters: + - name: invite + in: body + description: The JSON object to notify OCM that an invite has been accepted. + required: true + schema: + $ref: "#/definitions/AcceptInvite" + responses: + 200: + description: Auth ok! + 400: + description: Invalid token? + schema: + $ref: "#/definitions/Error" + invite/forward: + post: + summary: Forward information from invite to the cloud provider. + description: Foo + parameters: + - name: invite + in: body + description: The JSON object to send to the cloud provider with the invitaiton information. + required: true + schema: + $ref: "#/definitions/Invite" + responses: + 200: + description: Ok! + 400: + description: Invalid token? + schema: + $ref: "#/definitions/Error" definitions: 400: type: object @@ -505,4 +541,36 @@ definitions: href: type: string description: Link to this specific notification. - example: /notifications/9303 \ No newline at end of file + example: /notifications/9303 + AcceptInvite: + type: object + allOf: + - properties: + userId: + type: string # probably uuid? + description: Unique ID to identify the person accepting the invite. + example: 9303 + provider: + type: string # probably uuid? + description: Id to identify the provider + example: abc + token: + type: string # probably some other kind of token + description: Token received in the invite + example: abc-123 + senderProvider: + type: string # probably uuid? + description: Id to identify the provider of the sender + example: ddd + Invite: + type: object + allOf: + - properties: + token: + type: string # probably some other kind of token + description: Token received in the invite + example: abc-123 + senderProvider: + type: string # probably uuid? + description: Id to identify the provider of the sender + example: ddd \ No newline at end of file From 7fe8bc6aa0cae8952715a3a724b03a8fcb90120a Mon Sep 17 00:00:00 2001 From: Hugo Gonzalez Labrador Date: Wed, 15 Apr 2020 09:12:03 +0200 Subject: [PATCH 2/9] ocm: enhance invitation flow --- spec.yaml | 70 +++++++++++++++++++++++++++++++------------------------ 1 file changed, 39 insertions(+), 31 deletions(-) diff --git a/spec.yaml b/spec.yaml index 29014308..4ca24577 100644 --- a/spec.yaml +++ b/spec.yaml @@ -355,42 +355,47 @@ paths: type: string schema: $ref: "#/definitions/Error" - /invite/accept: + invite/forward: post: - summary: Accept an invite to a shared document - description: Foo + summary: Forward an invitation to start sharing + description: Sends an invitation to an end-user (by mail for example) parameters: - name: invite in: body - description: The JSON object to notify OCM that an invite has been accepted. + description: The JSON object representing an invitation to send to an end-user. required: true schema: - $ref: "#/definitions/AcceptInvite" + $ref: "#/definitions/Invite" responses: 200: - description: Auth ok! + description: Invitation sent. 400: - description: Invalid token? + description: | + Bad request due to invalid parameters, e.g. email is not valid. schema: - $ref: "#/definitions/Error" - invite/forward: + $ref: "#/definitions/400" + /invite/accept: post: - summary: Forward information from invite to the cloud provider. - description: Foo + summary: Accept an invititation to start sharing. + description: Accepts an invitation to the shared document so the provider can initiate the OCM share creation. parameters: - name: invite in: body - description: The JSON object to send to the cloud provider with the invitaiton information. + description: The JSON object to notify the OCM provider that an invite has been accepted. required: true schema: - $ref: "#/definitions/Invite" + $ref: "#/definitions/AcceptInvite" responses: 200: - description: Ok! + description: Invitation accepted. 400: - description: Invalid token? + description: The invitation token is invalid. schema: $ref: "#/definitions/Error" + 403: + description: Remote service is not trusted to accept invitations. + schema: + $ref: "#/definitions/Error" definitions: 400: type: object @@ -547,30 +552,33 @@ definitions: allOf: - properties: userId: - type: string # probably uuid? - description: Unique ID to identify the person accepting the invite. + type: string + description: Unique ID to identify the user at the remote provider accepting the invite. example: 9303 provider: - type: string # probably uuid? - description: Id to identify the provider - example: abc + type: string + format: url + description: URL of the receiver OCM service. + example: https://receiver.org/ocm token: - type: string # probably some other kind of token + type: string description: Token received in the invite - example: abc-123 + example: xyz senderProvider: - type: string # probably uuid? - description: Id to identify the provider of the sender - example: ddd + type: string + format: url + description: URL of the OCM sender service. + example: https://sender.org/ocm/ Invite: type: object allOf: - properties: token: - type: string # probably some other kind of token - description: Token received in the invite - example: abc-123 + type: string + description: Token generated by the service sending the invitation. + example: xyz senderProvider: - type: string # probably uuid? - description: Id to identify the provider of the sender - example: ddd \ No newline at end of file + type: string + format: url + description: URL of the OCM sender service. + example: https://sender.org/ocm/ From 634561de6f2e7caf62c2fc4c5759421bd9ce8510 Mon Sep 17 00:00:00 2001 From: Hugo Gonzalez Labrador Date: Wed, 15 Apr 2020 11:09:25 +0200 Subject: [PATCH 3/9] ocm: fix --- spec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.yaml b/spec.yaml index 4ca24577..489e8b6c 100644 --- a/spec.yaml +++ b/spec.yaml @@ -358,7 +358,7 @@ paths: invite/forward: post: summary: Forward an invitation to start sharing - description: Sends an invitation to an end-user (by mail for example) + description: Forwards an invitation received by an out-of-band channel, email for example. parameters: - name: invite in: body From 50540d1d3af0063d42adad4f1e3c69f12ad2327b Mon Sep 17 00:00:00 2001 From: Hugo Gonzalez Labrador Date: Wed, 15 Apr 2020 11:10:28 +0200 Subject: [PATCH 4/9] fix leading slash --- spec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.yaml b/spec.yaml index 489e8b6c..5a6fc6ba 100644 --- a/spec.yaml +++ b/spec.yaml @@ -355,7 +355,7 @@ paths: type: string schema: $ref: "#/definitions/Error" - invite/forward: + /invite/forward: post: summary: Forward an invitation to start sharing description: Forwards an invitation received by an out-of-band channel, email for example. From c57129b4a2c4a121fbd61026db382cdc0b793c60 Mon Sep 17 00:00:00 2001 From: Lovisa Lugnegard Date: Wed, 15 Apr 2020 16:34:10 +0200 Subject: [PATCH 5/9] Smaller copy updates --- spec.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec.yaml b/spec.yaml index 5a6fc6ba..7c89a901 100644 --- a/spec.yaml +++ b/spec.yaml @@ -368,16 +368,16 @@ paths: $ref: "#/definitions/Invite" responses: 200: - description: Invitation sent. + description: Invitation forwarded. 400: description: | - Bad request due to invalid parameters, e.g. email is not valid. + Bad request due to invalid parameters, e.g. provider is not valid. schema: $ref: "#/definitions/400" /invite/accept: post: summary: Accept an invititation to start sharing. - description: Accepts an invitation to the shared document so the provider can initiate the OCM share creation. + description: Accepts an invitation so the user on the sender provider's side can initiate the OCM share creation. parameters: - name: invite in: body From 8fdc1d9295849e177be9727717f112e63c6dbf04 Mon Sep 17 00:00:00 2001 From: Lovisa Lugnegard Date: Fri, 17 Apr 2020 11:15:10 +0200 Subject: [PATCH 6/9] Minor updates in the invites API --- spec.yaml | 43 +++++++++++++++++++------------------------ 1 file changed, 19 insertions(+), 24 deletions(-) diff --git a/spec.yaml b/spec.yaml index 7c89a901..475297cd 100644 --- a/spec.yaml +++ b/spec.yaml @@ -355,7 +355,7 @@ paths: type: string schema: $ref: "#/definitions/Error" - /invite/forward: + /invites/forward: post: summary: Forward an invitation to start sharing description: Forwards an invitation received by an out-of-band channel, email for example. @@ -365,7 +365,7 @@ paths: description: The JSON object representing an invitation to send to an end-user. required: true schema: - $ref: "#/definitions/Invite" + $ref: "#/definitions/ForwardInviteBody" responses: 200: description: Invitation forwarded. @@ -374,7 +374,7 @@ paths: Bad request due to invalid parameters, e.g. provider is not valid. schema: $ref: "#/definitions/400" - /invite/accept: + /invites/accept: post: summary: Accept an invititation to start sharing. description: Accepts an invitation so the user on the sender provider's side can initiate the OCM share creation. @@ -384,14 +384,14 @@ paths: description: The JSON object to notify the OCM provider that an invite has been accepted. required: true schema: - $ref: "#/definitions/AcceptInvite" + $ref: "#/definitions/AcceptInviteBody" responses: 200: description: Invitation accepted. 400: description: The invitation token is invalid. schema: - $ref: "#/definitions/Error" + $ref: "#/definitions/400" 403: description: Remote service is not trusted to accept invitations. schema: @@ -546,39 +546,34 @@ definitions: href: type: string description: Link to this specific notification. - example: /notifications/9303 - AcceptInvite: + example: /notifications/9303 + ForwardInviteBody: type: object allOf: - properties: - userId: - type: string - description: Unique ID to identify the user at the remote provider accepting the invite. - example: 9303 - provider: - type: string - format: url - description: URL of the receiver OCM service. - example: https://receiver.org/ocm token: type: string - description: Token received in the invite + description: Token generated by the service sending the invitation. example: xyz senderProvider: type: string format: url description: URL of the OCM sender service. example: https://sender.org/ocm/ - Invite: + AcceptInviteBody: type: object allOf: - properties: - token: + userID: type: string - description: Token generated by the service sending the invitation. - example: xyz - senderProvider: + description: Unique ID to identify the user at the remote provider accepting the invite. + example: 9303 + recipientProvider: type: string format: url - description: URL of the OCM sender service. - example: https://sender.org/ocm/ + description: URL of the receiver OCM service. + example: https://receiver.org/ocm + token: + type: string + description: Token received in the invite + example: xyz From a840caf8b221fd3bb0c46bf7fb16096197cb00f7 Mon Sep 17 00:00:00 2001 From: Lovisa Lugnegard Date: Fri, 17 Apr 2020 15:59:48 +0200 Subject: [PATCH 7/9] Fix typos --- spec.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec.yaml b/spec.yaml index 475297cd..4b6ef096 100644 --- a/spec.yaml +++ b/spec.yaml @@ -376,7 +376,7 @@ paths: $ref: "#/definitions/400" /invites/accept: post: - summary: Accept an invititation to start sharing. + summary: Accept an invitation to start sharing. description: Accepts an invitation so the user on the sender provider's side can initiate the OCM share creation. parameters: - name: invite @@ -559,7 +559,7 @@ definitions: type: string format: url description: URL of the OCM sender service. - example: https://sender.org/ocm/ + example: https://sender.org AcceptInviteBody: type: object allOf: @@ -572,7 +572,7 @@ definitions: type: string format: url description: URL of the receiver OCM service. - example: https://receiver.org/ocm + example: https://receiver.org token: type: string description: Token received in the invite From 98e8e4d9847d979a45a9ba8b09ce1dd0482492d6 Mon Sep 17 00:00:00 2001 From: Ishank Arora Date: Mon, 27 Apr 2020 17:51:37 +0200 Subject: [PATCH 8/9] Add name and email to invites/accept request --- spec.yaml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/spec.yaml b/spec.yaml index 4b6ef096..92d58b60 100644 --- a/spec.yaml +++ b/spec.yaml @@ -564,10 +564,6 @@ definitions: type: object allOf: - properties: - userID: - type: string - description: Unique ID to identify the user at the remote provider accepting the invite. - example: 9303 recipientProvider: type: string format: url @@ -577,3 +573,15 @@ definitions: type: string description: Token received in the invite example: xyz + userID: + type: string + description: Unique ID to identify the user at the remote provider accepting the invite. + example: 9303 + email: + type: string + description: Email ID of the user accepting the invite. + example: richard@receiver.org + name: + type: string + description: Name of the user accepting the invite. + example: Richard Feynman From f2d17c03f60b8df73b99a6b1b17724ba5a2a8ce2 Mon Sep 17 00:00:00 2001 From: Lovisa Lugnegard Date: Wed, 24 Jun 2020 08:51:42 +0200 Subject: [PATCH 9/9] Improve description --- spec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.yaml b/spec.yaml index 92d58b60..87e5096b 100644 --- a/spec.yaml +++ b/spec.yaml @@ -358,7 +358,7 @@ paths: /invites/forward: post: summary: Forward an invitation to start sharing - description: Forwards an invitation received by an out-of-band channel, email for example. + description: Forwards an invitation received through an out-of-band channel, email for example. parameters: - name: invite in: body