Skip to content
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

fix(signed-request): trigger metadata insert with default value manually #49646

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ArtificialOwl
Copy link
Member

@ArtificialOwl ArtificialOwl added the 3. to review Waiting for reviews label Dec 4, 2024
@ArtificialOwl ArtificialOwl added this to the Nextcloud 31 milestone Dec 4, 2024
Copy link
Member

@nickvergessen nickvergessen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But afterwards Talk's federation still does not work:

{
  "app": "cloud_federation_api",
  "signedRequest": "{\"[object] (OC\\Security\\Signature\\Model\\IncomingSignedRequest)\":{\"OC\\Security\\Signature\\Model\\SignedRequestdigest\":\"SHA-512=b1AhhRfCp1RCUaJm8a/ySVFEskKDiNDuZ5eORQ8xBuBXTMsFd38HCiLe2i3/oS8z3Cmk/e+l8MLXhuVfb8cxYg==\",\"OC\\Security\\Signature\\Model\\SignedRequestdigestAlgorithm\":{\"[object] (NCU\\Security\\Signature\\Enum\\DigestAlgorithm)\":{\"name\":\"SHA512\",\"value\":\"SHA-512\"}},\"OC\\Security\\Signature\\Model\\SignedRequestsigningElements\":{\"keyId\":\"https://localhost:8080/ocm#signature\",\"algorithm\":\"rsa-sha512\",\"headers\":\"(request-target) content-length date digest host\",\"signature\":\"NYz59rpWnZPfU9E8FU/SGVl2irIkduB6gQ1mPyBbgSn52fuSJ4PRveAOcSIXNJ/wnfJQh1VVCCBUmG0mduRSy4I9/jC4+oAf603ji1564cabQqEHauX35YW8gInwP0ygRJogFaXUa5K1e/TNXbbWw7gQZbSpKCxnBKsbc27CRKBYeRETYAVvggTs4DqO9Wp3MyR+CORGw7UqbfHpWIux45HAAR1Dv969vVrNRXNlienzlKXyos68Yj6xLg4gAy8FZZmDKxx/k/Gg5VAK7aPvBw+x60mY5XZA/Y+TDUJBbB+BEdBFOqXIzVq4hITMx0E+EBSYI1earhit1Bk0X0HSuQ==\"},\"OC\\Security\\Signature\\Model\\SignedRequestsignatureData\":[\"(request-target): post /index.php/ocm/notifications\",\"content-length: 941\",\"date: Wed, 04 Dec 2024 14:28:45 GMT\",\"digest: SHA-512=b1AhhRfCp1RCUaJm8a/ySVFEskKDiNDuZ5eORQ8xBuBXTMsFd38HCiLe2i3/oS8z3Cmk/e+l8MLXhuVfb8cxYg==\",\"host: localhost:8180\"],\"OC\\Security\\Signature\\Model\\SignedRequestsignature\":\"NYz59rpWnZPfU9E8FU/SGVl2irIkduB6gQ1mPyBbgSn52fuSJ4PRveAOcSIXNJ/wnfJQh1VVCCBUmG0mduRSy4I9/jC4+oAf603ji1564cabQqEHauX35YW8gInwP0ygRJogFaXUa5K1e/TNXbbWw7gQZbSpKCxnBKsbc27CRKBYeRETYAVvggTs4DqO9Wp3MyR+CORGw7UqbfHpWIux45HAAR1Dv969vVrNRXNlienzlKXyos68Yj6xLg4gAy8FZZmDKxx/k/Gg5VAK7aPvBw+x60mY5XZA/Y+TDUJBbB+BEdBFOqXIzVq4hITMx0E+EBSYI1earhit1Bk0X0HSuQ==\",\"OC\\Security\\Signature\\Model\\SignedRequestsignatory\":{\"[object] (NCU\\Security\\Signature\\Model\\Signatory)\":{\"id\":1,\"OCP\\AppFramework\\Db\\Entity_updatedFields\":[],\"OCP\\AppFramework\\Db\\Entity_fieldTypes\":[],\"*keyId\":\"https://localhost:8080/ocm#signature\",\"*keyIdSum\":\"49c06bce5548b0815c97f6b11e49d467b9c7104059c5dd9843d6eed14de39092\",\"*providerId\":\"ocm\",\"*host\":\"localhost:8080\",\"*publicKey\":\"-----BEGIN PUBLIC KEY-----\\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2pFpYl02ZVrpuzRHisM1\\nLYWFhysy16frEX63t69uFO683wpjcVv55A3VN4eeVr86YFIypu+BkYVlN2xBu6ba\\niOjJ+deN1GtPzz58KGxDI4zQdQ9iHhIOqCNw1Qio2lTuYY6FdQL2AC6kGLdp+qO8\\nl0rIvsjHwRhj4dFlX4fJg4JW7MDe3uRnlRMpgxyxb7Zn8qWWGcBn2dCXiyBxrUk9\\nRRHmNJY6Y2qYyksSYZr9z2drIiR5KjTkZMvMN+pHlj5E7CVcm2XjDGOCDd5e9QbQ\\nUKiG3BWpq6V30BOyPBmuhv2qTbLRcrmCBWWLUuT5/8uuqbo5wBn2Naf6ntSarBQa\\n3wIDAQAB\\n-----END PUBLIC KEY-----\\n\",\"*privateKey\":\"\",\"*account\":\"\",\"*type\":8,\"*status\":0,\"*metadata\":[],\"*creation\":1733322331,\"*lastUpdated\":1733322331,\"NCU\\Security\\Signature\\Model\\Signatorylocal\":false}},\"OC\\Security\\Signature\\Model\\SignedRequestbody\":\"{\\\"notificationType\\\":\\\"MESSAGE_POSTED\\\",\\\"resourceType\\\":\\\"talk-room\\\",\\\"providerId\\\":\\\"133\\\",\\\"notification\\\":{\\\"remoteServerUrl\\\":\\\"http:\\/\\/localhost:8080\\\",\\\"sharedSecret\\\":\\\"oXoNtRdLHDazjC6gMadPzRctMD5mJJgRSoEQPkJzbAimbKYcjHSTFsLeNynbYQzd\\\",\\\"remoteToken\\\":\\\"sqitskb8\\\",\\\"messageData\\\":{\\\"remoteMessageId\\\":1217,\\\"actorType\\\":\\\"users\\\",\\\"actorId\\\":\\\"participant1\\\",\\\"actorDisplayName\\\":\\\"participant1-displayname\\\",\\\"messageType\\\":\\\"system\\\",\\\"systemMessage\\\":\\\"federated_user_added\\\",\\\"expirationDatetime\\\":\\\"\\\",\\\"message\\\":\\\"{actor} invited {federated_user}\\\",\\\"messageParameter\\\":\\\"{\\\\\"actor\\\\\":{\\\\\"type\\\\\":\\\\\"user\\\\\",\\\\\"id\\\\\":\\\\\"participant1\\\\\",\\\\\"name\\\\\":\\\\\"participant1-displayname\\\\\"},\\\\\"federated_user\\\\\":{\\\\\"type\\\\\":\\\\\"user\\\\\",\\\\\"id\\\\\":\\\\\"participant2\\\\\",\\\\\"name\\\\\":\\\\\"participant2-displayname\\\\\",\\\\\"server\\\\\":\\\\\"http:\\\\\\/\\\\\\/localhost:8180\\\\\"}}\\\",\\\"creationDatetime\\\":\\\"2024-12-04T14:28:45+00:00\\\",\\\"metaData\\\":\\\"[]\\\"},\\\"unreadInfo\\\":{\\\"lastReadMessage\\\":1216,\\\"unreadMessages\\\":0,\\\"unreadMention\\\":false,\\\"unreadMentionDirect\\\":false}}}\",\"OC\\Security\\Signature\\Model\\IncomingSignedRequestorigin\":\"localhost:8080\",\"OC\\Security\\Signature\\Model\\IncomingSignedRequestrequest\":{\"[object] (OC\\AppFramework\\Http\\Request)\":{\"*inputStream\":\"php://input\",\"*content\":null,\"*items\":[],\"*allowedKeys\":[],\"*requestId\":\"[object] (OC\\AppFramework\\Http\\RequestId)\",\"*config\":\"[object] (OC\\AllConfig)\",\"*csrfTokenManager\":\"[object] (OC\\Security\\CSRF\\CsrfTokenManager)\",\"*contentDecoded\":true}},\"OC\\Security\\Signature\\Model\\IncomingSignedRequestoptions\":{\"algorithm\":{\"[object] (NCU\\Security\\Signature\\Enum\\SignatureAlgorithm)\":[]},\"digestAlgorithm\":{\"[object] (NCU\\Security\\Signature\\Enum\\DigestAlgorithm)\":[]},\"extraSignatureHeaders\":[],\"ttl\":300,\"dateHeader\":\"D, d M Y H:i:s T\",\"ttlSignatory\":259200,\"bodyMaxSize\":50000}}}",
  "message": "signed request available"
}
[Wed Dec  4 15:31:40 2024] {"app":"spreed","message":"Failed to send notification for share from http:\/\/localhost:8080, received status code 503\n<!DOCTYPE html>\n<html class=\"ng-csp\" data-placeholder-focus=\"false\" lang=\"en\" data-locale=\"en\" translate=\"no\" >\n\t<head\n data-requesttoken=\"\">\n\t\t<meta charset=\"utf-8\">\n\t\t<title>\n\t\t\tNextcloud 31\t\t<\/title>\n\t\t<meta name=\"csp-nonce\" nonce=\"mc2uDNMK\/yODm6aUFlTrgsQHPSE4OG3KCHF7g2k8qTw=\">\n\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, minimum-scale=1.0\">\n\t\t\t\t<meta name=\"apple-itunes-app\" content=\"app-id=1125420102\">\n\t\t\t\t<meta name=\"theme-color\" content=\"#26A269\">\n\t\t<link rel=\"icon\" href=\"\/index.php\/apps\/theming\/favicon?v=602ebaab\">\n\t\t<link rel=\"apple-touch-icon\" href=\"\/index.php\/apps\/theming\/icon?v=602ebaab\">\n\t\t<link rel=\"mask-icon\" sizes=\"any\" href=\"\/core\/img\/favicon-mask.svg\" color=\"#26A269\">\n\t\t<link rel=\"manifest\" href=\"\/index.php\/apps\/theming\/manifest?v=602ebaab\" crossorigin=\"use-credentials\">\n\t\t<link rel=\"stylesheet\" href=\"\/core\/css\/server.css\">\n<link rel=\"stylesheet\" href=\"\/apps\/theming\/css\/default.css\">\n<link rel=\"stylesheet\" href=\"\/core\/css\/guest.css\">\n\t\t<script nonce=\"mc2uDNMK\/yODm6aUFlTrgsQHPSE4OG3KCHF7g2k8qTw=\" defer src=\"\/dist\/core-common.js\"><\/script>\n<script nonce=\"mc2uDNMK\/yODm6aUFlTrgsQHPSE4OG3KCHF7g2k8qTw=\" defer src=\"\/dist\/core-main.js\"><\/script>\n<script nonce=\"mc2uDNMK\/yODm6aUFlTrgsQHPSE4OG3KCHF7g2k8qTw=\" defer src=\"\/apps\/theming\/js\/theming.js\"><\/script>\n<script nonce=\"mc2uDNMK\/yODm6aUFlTrgsQHPSE4OG3KCHF7g2k8qTw=\" defer src=\"\/dist\/files_sharing-main.js\"><\/script>\n\t\t<link rel=\"stylesheet\" media=\"\" href=\"\/index.php\/apps\/theming\/theme\/default.css?plain=1&amp;v=602ebaab\" class=\"theme\"\/><link rel=\"stylesheet\" media=\"(prefers-color-scheme: light)\" href=\"\/index.php\/apps\/theming\/theme\/light.css?plain=1&amp;v=602ebaab\" class=\"theme\"\/><link rel=\"stylesheet\" media=\"(prefers-color-scheme: dark)\" href=\"\/index.php\/apps\/theming\/theme\/dark.css?plain=1&amp;v=602ebaab\" class=\"theme\"\/><link rel=\"stylesheet\" media=\"(prefers-contrast: more)\" href=\"\/index.php\/apps\/theming\/theme\/light-highcontrast.css?plain=1&amp;v=602ebaab\" class=\"theme\"\/><link rel=\"stylesheet\" media=\"(prefers-color-scheme: dark) and (prefers-contrast: more)\" href=\"\/index.php\/apps\/theming\/theme\/dark-highcontrast.css?plain=1&amp;v=602ebaab\" class=\"theme\"\/><link rel=\"stylesheet\" media=\"\" href=\"\/index.php\/apps\/theming\/theme\/light.css?plain=0&amp;v=602ebaab\" class=\"theme\"\/><link rel=\"stylesheet\" media=\"\" href=\"\/index.php\/apps\/theming\/theme\/dark.css?plain=0&amp;v=602ebaab\" class=\"theme\"\/><link rel=\"stylesheet\" media=\"\" href=\"\/index.php\/apps\/theming\/theme\/light-highcontrast.css?plain=0&amp;v=602ebaab\" class=\"theme\"\/><link rel=\"stylesheet\" media=\"\" href=\"\/index.php\/apps\/theming\/theme\/dark-highcontrast.css?plain=0&amp;v=602ebaab\" class=\"theme\"\/><link rel=\"stylesheet\" media=\"\" href=\"\/index.php\/apps\/theming\/theme\/opendyslexic.css?plain=0&amp;v=602ebaab\" class=\"theme\"\/><meta name=\"color-scheme\" content=\"light dark\"\/>\t<\/head>\n\t<body id=\"body-login\">\n\t\t<noscript>\n\t<div id=\"nojavascript\">\n\t\t<div>\n\t\t\tThis application requires JavaScript for correct operation. Please <a href=\"https:\/\/www.enable-javascript.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">enable JavaScript<\/a> and reload the page.\t\t<\/div>\n\t<\/div>\n<\/noscript>\n\t\t<div id=\"initial-state-container\" style=\"display: none;\">\n\t\t\t<input type=\"hidden\" id=\"initial-state-core-versionHash\" value=\"ImM1ZjNjZjc0Ig==\">\n\t\t\t<input type=\"hidden\" id=\"initial-state-theming-data\" value=\"eyJuYW1lIjoiTmV4dGNsb3VkIDMxIiwic2xvZ2FuIjoiYSBzYWZlIGhvbWUgZm9yIGFsbCB5b3VyIGRhdGEiLCJ1cmwiOiJodHRwczpcL1wvbmV4dGNsb3VkLmNvbSIsImltcHJpbnRVcmwiOiIiLCJwcml2YWN5VXJsIjoiIiwicHJpbWFyeUNvbG9yIjoiIzI2QTI2OSIsImJhY2tncm91bmRDb2xvciI6IiMwMDY3OWUiLCJkZWZhdWx0UHJpbWFyeUNvbG9yIjoiIzI2QTI2OSIsImRlZmF1bHRCYWNrZ3JvdW5kQ29sb3IiOiIjMDA2NzllIiwiaW52ZXJ0ZWQiOnRydWUsImNhY2hlQnVzdGVyIjoiNjAyZWJhYWIiLCJlbmFibGVkVGhlbWVzIjpbXSwiY29sb3IiOiIjMjZBMjY5IiwiIjoiY29sb3IgaXMgZGVwcmVjYXRlZCBzaW5jZSBOZXh0Y2xvdWQgMjksIHVzZSBwcmltYXJ5Q29sb3IgaW5zdGVhZCJ9\">\n\t\t\t<input type=\"hidden\" id=\"initial-state-comments-maxAutoCompleteResults\" value=\"MTA=\">\n\t<\/div>\n\t\t<div class=\"wrapper\">\n\t\t\t<div class=\"v-align\">\n\t\t\t\t\t\t\t\t\t<header>\n\t\t\t\t\t\t<div id=\"header\">\n\t\t\t\t\t\t\t<div class=\"logo\"><\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/header>\n\t\t\t\t\t\t\t\t<main>\n\t\t\t\t\t<h1 class=\"hidden-visually\">\n\t\t\t\t\t\tNextcloud 31\t\t\t\t\t<\/h1>\n\t\t\t\t\t<div class=\"guest-box\">\n\t<h2>Error<\/h2>\n\t<ul>\n\t\t\t<li>\n\t\t\t<p>Share not found<\/p>\n\t\t\t\t\t\t\t<p class='hint'>Could not find share<\/p>\n\t\t\t\t\t<\/li>\n\t\t<\/ul>\n<\/div>\n\t\t\t\t<\/main>\n\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t<fo

lib/private/Security/Signature/SignatureManager.php Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants