mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-10-30 18:18:37 -04:00
feat(authguest): fix codacy issues
This commit is contained in:
1 parent
b266546a45
commit
7cfc601ddb
2 files changed
+8
-2
No files matched your search
@@ -178,7 +178,8 @@ Alias: `.../guestLinks/verify/token`
|
||||
|
||||
#### `POST .../guestLinks/renew`
|
||||
|
||||
- **Request body:** `{ "permissionId": "<share-id>", "token": "<previous link token>" }`
|
||||
- **Request body:**
|
||||
`{ "permissionId": "<share-id>", "token": "<previous link token>" }`
|
||||
(`token` optional when the session cookie is sent)
|
||||
- **Authorization:** the share id is required; the body link token or the
|
||||
session cookie must belong to it, the link token takes precedence
|
||||
|
||||
@@ -57,7 +57,12 @@ func TestRenewHandlerWithSessionCookie(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
|
||||
req := httptest.NewRequest(http.MethodPost, "/", strings.NewReader(string(body)))
|
||||
req.AddCookie(&http.Cookie{Name: testCookieName, Value: "session-token"})
|
||||
req.AddCookie(&http.Cookie{
|
||||
Name: testCookieName,
|
||||
Value: "session-token",
|
||||
HttpOnly: true,
|
||||
Secure: true,
|
||||
})
|
||||
|
||||
rr := httptest.NewRecorder()
|
||||
newRenewHandler(t, svcMock)(rr, req)
|
||||
|
||||
Reference in new issue
Block a user