Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

feat: webnotfiers to send topic information #1394

Merged
merged 1 commit into from
Feb 28, 2020

Conversation

sudeshrshetty
Copy link
Contributor

@sudeshrshetty sudeshrshetty commented Feb 27, 2020

  • in previous version, web notifier topics are used for resolving/building
    URLs which was forcing subscribers to support path matching topic names
    (challenge: topic name are private and dynamic based on usecases)
  • changes: web notifiers will send message containing uniquer ID, Topic
    Name and Raw JSON message to given webnotfier endpoint.
  • This fixed issue in JS worker where it wasn't able to find topic of
    incoming messages.
  • closes REST JS wrapper support for notifications #1323

Signed-off-by: sudesh.shetty sudesh.shetty@securekey.com

func main() {
port := os.Getenv("WEBHOOK_PORT")
if port == "" {
panic("port to be passed as ENV variable")
}

router := mux.NewRouter().StrictSlash(true)
router.HandleFunc(connectionsPath, connections).Methods(http.MethodPost)
router.HandleFunc("/", connections).Methods(http.MethodPost)
Copy link
Contributor

Choose a reason for hiding this comment

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

May be we can change the name of handler from connections to handleNotification or something like that. With this refactor, the api will handle generic notification and not just related to connections/didexchange functionality.

- in previous version, web notifier topics are only used for resolving/building
URLs which was forcing subscribers to support path matching topic names
(challenge: topic name is private and dynamic based on usecases)

- changes: web notifiers will send message containing uniquer ID, Topic
Name and Raw JSON message to given webnotfier endpoint.

- This fixed issue in JS worker where it wasn't able to find topic of
incoming messages.
- closes hyperledger-archives#1323

Signed-off-by: sudesh.shetty <sudesh.shetty@securekey.com>
@fqutishat fqutishat merged commit 558720f into hyperledger-archives:master Feb 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

REST JS wrapper support for notifications
3 participants