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

Allow devices to register for push notifications #59

Merged
merged 32 commits into from
Apr 24, 2017

Conversation

nickvergessen
Copy link
Member

@nickvergessen nickvergessen commented Jan 25, 2017

ToDos

@MorrisJobke
Copy link
Member

@nickvergessen What is the status of this? Is there any ETA?

@nickvergessen nickvergessen added this to the Nextcloud 12.0 milestone Mar 1, 2017
@nickvergessen
Copy link
Member Author

Device registration is done, next task is the actual pushing. I plan to do the specs this week and finish the implementation next week.

@MorrisJobke
Copy link
Member

@nickvergessen What is the status of this?

@nickvergessen
Copy link
Member Author

Functionality-wise its done, waiting for feedback from marino

@MorrisJobke
Copy link
Member

Functionality-wise its done, waiting for feedback from marino

@nickvergessen @marinofaggiana What is the feedback? Does it work on your side, @marinofaggiana ?

@marinofaggiana
Copy link
Member

No, this is the error for https://push-notifications.nextcloud.com since 15.03 :

Printing description of error:
Error Domain=NSURLErrorDomain Code=-1200 "Si è verificato un errore SSL ed è impossibile effettuare una connessione sicura con il server." UserInfo={NSURLErrorFailingURLPeerTrustErrorKey=<SecTrustRef: 0x17010f390>, NSLocalizedRecoverySuggestion=Desideri connetterti comunque al server?, _kCFStreamErrorDomainKey=3, _kCFStreamErrorCodeKey=-9802, NSErrorPeerCertificateChainKey=(
"<cert(0x101902600) s: demo.nextcloud.com i: Let's Encrypt Authority X3>",
"<cert(0x101907200) s: Let's Encrypt Authority X3 i: DST Root CA X3>"
), NSUnderlyingError=0x174258960 {Error Domain=kCFErrorDomainCFNetwork Code=-1200 "(null)" UserInfo={_kCFStreamPropertySSLClientCertificateState=0, kCFStreamPropertySSLPeerTrust=<SecTrustRef: 0x17010f390>, _kCFNetworkCFStreamSSLErrorOriginalValue=-9802, _kCFStreamErrorDomainKey=3, _kCFStreamErrorCodeKey=-9802, kCFStreamPropertySSLPeerCertificates=(
"<cert(0x101902600) s: demo.nextcloud.com i: Let's Encrypt Authority X3>",
"<cert(0x101907200) s: Let's Encrypt Authority X3 i: DST Root CA X3>"
)}}, NSLocalizedDescription=Si è verificato un errore SSL ed è impossibile effettuare una connessione sicura con il server.,

Signed-off-by: Joas Schilling <[email protected]>
Signed-off-by: Joas Schilling <[email protected]>
To stay compatible with the Golang implementation here we return raw bytes and also don't hash twice.

Signed-off-by: Joas Schilling <[email protected]>
Signed-off-by: Joas Schilling <[email protected]>
Signed-off-by: Joas Schilling <[email protected]>
Signed-off-by: Joas Schilling <[email protected]>
Signed-off-by: Joas Schilling <[email protected]>
Signed-off-by: Joas Schilling <[email protected]>
Signed-off-by: Joas Schilling <[email protected]>
@nickvergessen
Copy link
Member Author

@marinofaggiana @mario I had a typo, so the URLs changed, it's v2 instead of v3 now. The docs have been changed.

Availability can be checked via capabilities now:
https://github.com/nextcloud/notifications/pull/59/files#diff-dc6eadb50781d481c9f37e3138fca25bR5

@nickvergessen
Copy link
Member Author

I fixed the OCS response, it now correctly contains the ocs and data elements.

@marinofaggiana
Copy link
Member

mmm but the protocol API is the same ... I think ... ?

@nickvergessen
Copy link
Member Author

Yeah, its just:

{
  "ocs": {
    "meta": {
      "status": "ok",
      "statuscode": 201,
      "message": "OK"
    },
    "data": {
      "publicKey": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxzY+\/0F2C1fzVVjHQTaX\nzOYXuT26sEAJmMEx9nUjdU5CNfLN5QsXQigluKHOZn3YV4D8PR\/A5x1394C+PpGG\nEQ0G\/61ATwZi+d+BCP\/Ep4ftmfiZQx9btMY6fG4jqzKUDmEp3iRceBK6WWuPvNvw\nv9m9CqmZoJjgFYtcfMxfG3ZTXYMrArGTYoy6nxLE8aU1Eo8YfNcu12dvBXJemEIF\nd2KNjBfmrY7\/aZ0v2P+PtFCNuSvC2rwm50sOZnfWV6Ve3kJlPu+VHM93mzXjy8ZS\n2zg\/0CA1KKpADg6uEquVMuSMWM6YJmSr7gaGZQowRtdiZQb90bhEIWLko+k1FmmG\nEwIDAQAB\n-----END PUBLIC KEY-----\n",
      "deviceIdentifier": "bX+fVPw0rCUv8QHNjMqrPF1aqKv16UN5QC\/oiC4aq7ChV0vDUcLvAwbmxYmNUYygsxEF6+ddnPpIDaoNlyMqDQ==",
      "signature": "CZgGR+dCpsRBv5qWIjuOW4qCOs13TZJfmbkIs4CUIb92VajpJdl7D4zBZVGzZ7XSDDIBtilATEMuuimuecZ8bZD9v6EQEw7q4ySuvyMJROSeo4OfcRyMpSrkpK8F8br8txm3U6ML\/DtvTzAX8f8mKVe32+0sBEbXI+RmXAeXypYyNPC3KXHjWyQkaPG1c1TQAoJafTZhw1OJav\/vrks9sNG6CqSkyJ3JHcW3+2oqOtEpm7hxW3IzAFTxUCI2nn3mEp7unVzBXwZkpcYP+BX4HD53J74WleRFWUbnx9QrNzXxi457jOH9UXiPfKNLvbn5XVTAOPefpgHnOC+wCc3OkA=="
    }
  }
}

instead of:

{
  "publicKey": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxzY+\/0F2C1fzVVjHQTaX\nzOYXuT26sEAJmMEx9nUjdU5CNfLN5QsXQigluKHOZn3YV4D8PR\/A5x1394C+PpGG\nEQ0G\/61ATwZi+d+BCP\/Ep4ftmfiZQx9btMY6fG4jqzKUDmEp3iRceBK6WWuPvNvw\nv9m9CqmZoJjgFYtcfMxfG3ZTXYMrArGTYoy6nxLE8aU1Eo8YfNcu12dvBXJemEIF\nd2KNjBfmrY7\/aZ0v2P+PtFCNuSvC2rwm50sOZnfWV6Ve3kJlPu+VHM93mzXjy8ZS\n2zg\/0CA1KKpADg6uEquVMuSMWM6YJmSr7gaGZQowRtdiZQb90bhEIWLko+k1FmmG\nEwIDAQAB\n-----END PUBLIC KEY-----\n",
  "deviceIdentifier": "bX+fVPw0rCUv8QHNjMqrPF1aqKv16UN5QC\/oiC4aq7ChV0vDUcLvAwbmxYmNUYygsxEF6+ddnPpIDaoNlyMqDQ==",
  "signature": "CZgGR+dCpsRBv5qWIjuOW4qCOs13TZJfmbkIs4CUIb92VajpJdl7D4zBZVGzZ7XSDDIBtilATEMuuimuecZ8bZD9v6EQEw7q4ySuvyMJROSeo4OfcRyMpSrkpK8F8br8txm3U6ML\/DtvTzAX8f8mKVe32+0sBEbXI+RmXAeXypYyNPC3KXHjWyQkaPG1c1TQAoJafTZhw1OJav\/vrks9sNG6CqSkyJ3JHcW3+2oqOtEpm7hxW3IzAFTxUCI2nn3mEp7unVzBXwZkpcYP+BX4HD53J74WleRFWUbnx9QrNzXxi457jOH9UXiPfKNLvbn5XVTAOPefpgHnOC+wCc3OkA=="
}

Signed-off-by: Joas Schilling <[email protected]>
Signed-off-by: Joas Schilling <[email protected]>
@nickvergessen
Copy link
Member Author

@MorrisJobke any chance you can try to test this?

@MorrisJobke
Copy link
Member

When you give me the rough steps to do so;)

@MorrisJobke
Copy link
Member

@mario @nickvergessen Could you explain how the complete flow works and what needs to be setup to work properly and how the whole setup works.

@nickvergessen
Copy link
Member Author

I sent you a mail

@nickvergessen
Copy link
Member Author

Merging for 12, after speaking to @MorrisJobke

@nickvergessen nickvergessen merged commit af90c15 into master Apr 24, 2017
@nickvergessen nickvergessen deleted the push-notification branch April 24, 2017 13:07
@MorrisJobke
Copy link
Member

Private API usage

🙈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants