From 6f6a3938a8fe403a77796a32f0f7d78a01df5e61 Mon Sep 17 00:00:00 2001 From: Alex Ababii Date: Tue, 29 Sep 2026 17:35:49 +0200 Subject: [PATCH 1/4] feat(authguest): added redeem endpoint for auth-guest service --- api/openapi-spec/v1.0.yaml | 146 +++++++++++++++++++++++++++++++++++++ 1 file changed, 146 insertions(+) diff --git a/api/openapi-spec/v1.0.yaml b/api/openapi-spec/v1.0.yaml index 8dcf432..67e4f29 100644 --- a/api/openapi-spec/v1.0.yaml +++ b/api/openapi-spec/v1.0.yaml @@ -193,6 +193,117 @@ paths: name: "secret stuff" default: $ref: '#/components/responses/error' + '/v1beta1/extensions/org.libregraph/guestInvitations/redeem': + post: + tags: + - guestInvitations + summary: Redeem a guest invitation token + description: Redeem a guest invitation token to obtain a guest session. + operationId: RedeemGuestInvitation + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/guestInvitationRedeemRequest' + examples: + redeem token: + value: + token: v1.5d41402abc4b2a76b9719d911017c5923c3a5a1e1f4e5d6c + responses: + '200': + description: "Success" + headers: + Set-Cookie: + description: >- + Host-only, HttpOnly and Secure guest session cookie (default name + `__Host-oc_guest_session`). + schema: + type: string + '400': + description: The request body is malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/guestInvitationError' + examples: + invalid request: + value: + error_type: invalid_request + message: The request body is malformed. + share_id: '' + '401': + description: The token is invalid or has expired. + content: + application/json: + schema: + $ref: '#/components/schemas/guestInvitationError' + examples: + token invalid: + value: + error_type: token_invalid + message: invalid token + share_id: '' + token expired: + value: + error_type: token_expired + message: token expired + share_id: d14f9f65-2e9b-4fd6-bf6b-6748f229f2a2 + '404': + description: The token or the referenced share could not be found. + content: + application/json: + schema: + $ref: '#/components/schemas/guestInvitationError' + examples: + token not found: + value: + error_type: token_not_found + message: record not found + share_id: '' + share not found: + value: + error_type: share_not_found + message: share not found + share_id: d14f9f65-2e9b-4fd6-bf6b-6748f229f2a2 + '409': + description: The token has already been redeemed. + content: + application/json: + schema: + $ref: '#/components/schemas/guestInvitationError' + examples: + token already redeemed: + value: + error_type: token_already_redeemed + message: token already redeemed + share_id: d14f9f65-2e9b-4fd6-bf6b-6748f229f2a2 + '410': + description: The referenced share has expired. + content: + application/json: + schema: + $ref: '#/components/schemas/guestInvitationError' + examples: + share expired: + value: + error_type: share_expired + message: share expired + share_id: d14f9f65-2e9b-4fd6-bf6b-6748f229f2a2 + '500': + description: An internal error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/guestInvitationError' + examples: + internal error: + value: + error_type: internal_error + message: An internal error occurred. + share_id: '' + default: + $ref: '#/components/responses/error' '/v1beta1/me/drives': # $ref is buggy in the openapi-generator v7.0.1 # $ref: '#/paths/~1v1.0~1me~1drives' @@ -4581,6 +4692,41 @@ components: type: array items: type: string + guestInvitationRedeemRequest: + description: Request body for redeeming a guest invitation token. + type: object + required: + - token + properties: + token: + type: string + description: One-time guest invitation token received from the invitation link. + guestInvitationError: + description: Error returned by the guest invitation redeem endpoint. + type: object + required: + - error_type + - message + - share_id + properties: + error_type: + type: string + description: Machine-readable error identifier. + enum: + - token_invalid + - token_not_found + - token_expired + - token_already_redeemed + - share_not_found + - share_expired + - invalid_request + - internal_error + message: + type: string + description: Human-readable error message. + share_id: + type: string + description: Share identifier related to the error, when known. educationSchool: description: Represents a school type: object From e8869d8207db83112404a11533010ee58c122280 Mon Sep 17 00:00:00 2001 From: Alex Ababii Date: Wed, 30 Sep 2026 11:22:18 +0200 Subject: [PATCH 2/4] feat(authguest): upd guest auth redeem endpoint response schema --- api/openapi-spec/v1.0.yaml | 75 +++++++++++++++++++++++--------------- 1 file changed, 46 insertions(+), 29 deletions(-) diff --git a/api/openapi-spec/v1.0.yaml b/api/openapi-spec/v1.0.yaml index 67e4f29..6c673aa 100644 --- a/api/openapi-spec/v1.0.yaml +++ b/api/openapi-spec/v1.0.yaml @@ -220,6 +220,14 @@ paths: `__Host-oc_guest_session`). schema: type: string + content: + application/json: + schema: + $ref: '#/components/schemas/guestInvitationRedeemResponse' + examples: + success: + value: + permissionId: d14f9f65-2e9b-4fd6-bf6b-6748f229f2a2 '400': description: The request body is malformed. content: @@ -229,9 +237,9 @@ paths: examples: invalid request: value: - error_type: invalid_request + errorType: invalidRequest message: The request body is malformed. - share_id: '' + permissionId: '' '401': description: The token is invalid or has expired. content: @@ -241,14 +249,14 @@ paths: examples: token invalid: value: - error_type: token_invalid + errorType: tokenInvalid message: invalid token - share_id: '' + permissionId: '' token expired: value: - error_type: token_expired + errorType: tokenExpired message: token expired - share_id: d14f9f65-2e9b-4fd6-bf6b-6748f229f2a2 + permissionId: d14f9f65-2e9b-4fd6-bf6b-6748f229f2a2 '404': description: The token or the referenced share could not be found. content: @@ -258,14 +266,14 @@ paths: examples: token not found: value: - error_type: token_not_found + errorType: tokenNotFound message: record not found - share_id: '' + permissionId: '' share not found: value: - error_type: share_not_found + errorType: shareNotFound message: share not found - share_id: d14f9f65-2e9b-4fd6-bf6b-6748f229f2a2 + permissionId: d14f9f65-2e9b-4fd6-bf6b-6748f229f2a2 '409': description: The token has already been redeemed. content: @@ -275,9 +283,9 @@ paths: examples: token already redeemed: value: - error_type: token_already_redeemed + errorType: tokenAlreadyRedeemed message: token already redeemed - share_id: d14f9f65-2e9b-4fd6-bf6b-6748f229f2a2 + permissionId: d14f9f65-2e9b-4fd6-bf6b-6748f229f2a2 '410': description: The referenced share has expired. content: @@ -287,9 +295,9 @@ paths: examples: share expired: value: - error_type: share_expired + errorType: shareExpired message: share expired - share_id: d14f9f65-2e9b-4fd6-bf6b-6748f229f2a2 + permissionId: d14f9f65-2e9b-4fd6-bf6b-6748f229f2a2 '500': description: An internal error occurred. content: @@ -299,9 +307,9 @@ paths: examples: internal error: value: - error_type: internal_error + errorType: internalError message: An internal error occurred. - share_id: '' + permissionId: '' default: $ref: '#/components/responses/error' '/v1beta1/me/drives': @@ -4701,32 +4709,41 @@ components: token: type: string description: One-time guest invitation token received from the invitation link. + guestInvitationRedeemResponse: + description: Response body for a successful guest invitation redemption. + type: object + required: + - permissionId + properties: + permissionId: + type: string + description: Identifier of the share (permission) the guest was invited to. guestInvitationError: description: Error returned by the guest invitation redeem endpoint. type: object required: - - error_type + - errorType - message - - share_id + - permissionId properties: - error_type: + errorType: type: string description: Machine-readable error identifier. enum: - - token_invalid - - token_not_found - - token_expired - - token_already_redeemed - - share_not_found - - share_expired - - invalid_request - - internal_error + - tokenInvalid + - tokenNotFound + - tokenExpired + - tokenAlreadyRedeemed + - shareNotFound + - shareExpired + - invalidRequest + - internalError message: type: string description: Human-readable error message. - share_id: + permissionId: type: string - description: Share identifier related to the error, when known. + description: Permission (share) identifier related to the error, when known. educationSchool: description: Represents a school type: object From eb5c14bdd081d5183fd0db30054ffa7098f40312 Mon Sep 17 00:00:00 2001 From: Alex Ababii Date: Thu, 1 Oct 2026 09:27:36 +0200 Subject: [PATCH 3/4] feat(authguest): upd guest links path --- api/openapi-spec/v1.0.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/openapi-spec/v1.0.yaml b/api/openapi-spec/v1.0.yaml index 6c673aa..c0a3ade 100644 --- a/api/openapi-spec/v1.0.yaml +++ b/api/openapi-spec/v1.0.yaml @@ -193,7 +193,7 @@ paths: name: "secret stuff" default: $ref: '#/components/responses/error' - '/v1beta1/extensions/org.libregraph/guestInvitations/redeem': + '/v1beta1/extensions/org.libregraph/guestLinks/redeem': post: tags: - guestInvitations From dde9c033bcab4382332d96a440f74028fdb4c961 Mon Sep 17 00:00:00 2001 From: Alex Ababii Date: Thu, 1 Oct 2026 11:10:35 +0200 Subject: [PATCH 4/4] feat(authguest): renaming guest intivitation to links for consistency --- api/openapi-spec/v1.0.yaml | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/api/openapi-spec/v1.0.yaml b/api/openapi-spec/v1.0.yaml index c0a3ade..74fdb3d 100644 --- a/api/openapi-spec/v1.0.yaml +++ b/api/openapi-spec/v1.0.yaml @@ -196,16 +196,16 @@ paths: '/v1beta1/extensions/org.libregraph/guestLinks/redeem': post: tags: - - guestInvitations - summary: Redeem a guest invitation token - description: Redeem a guest invitation token to obtain a guest session. - operationId: RedeemGuestInvitation + - guestLinks + summary: Redeem a guest link token + description: Redeem a guest link token to obtain a guest session. + operationId: RedeemGuestLink requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/guestInvitationRedeemRequest' + $ref: '#/components/schemas/guestLinkRedeemRequest' examples: redeem token: value: @@ -223,7 +223,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/guestInvitationRedeemResponse' + $ref: '#/components/schemas/guestLinkRedeemResponse' examples: success: value: @@ -233,7 +233,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/guestInvitationError' + $ref: '#/components/schemas/guestLinkError' examples: invalid request: value: @@ -245,7 +245,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/guestInvitationError' + $ref: '#/components/schemas/guestLinkError' examples: token invalid: value: @@ -262,7 +262,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/guestInvitationError' + $ref: '#/components/schemas/guestLinkError' examples: token not found: value: @@ -279,7 +279,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/guestInvitationError' + $ref: '#/components/schemas/guestLinkError' examples: token already redeemed: value: @@ -291,7 +291,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/guestInvitationError' + $ref: '#/components/schemas/guestLinkError' examples: share expired: value: @@ -303,7 +303,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/guestInvitationError' + $ref: '#/components/schemas/guestLinkError' examples: internal error: value: @@ -4700,17 +4700,17 @@ components: type: array items: type: string - guestInvitationRedeemRequest: - description: Request body for redeeming a guest invitation token. + guestLinkRedeemRequest: + description: Request body for redeeming a guest link token. type: object required: - token properties: token: type: string - description: One-time guest invitation token received from the invitation link. - guestInvitationRedeemResponse: - description: Response body for a successful guest invitation redemption. + description: One-time guest link token received from the guest link. + guestLinkRedeemResponse: + description: Response body for a successful guest link redemption. type: object required: - permissionId @@ -4718,8 +4718,8 @@ components: permissionId: type: string description: Identifier of the share (permission) the guest was invited to. - guestInvitationError: - description: Error returned by the guest invitation redeem endpoint. + guestLinkError: + description: Error returned by the guest link redeem endpoint. type: object required: - errorType