Skip to content

Commit

Permalink
New function to validate Kerberos Hub connectivity and subscription
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricve committed Jun 23, 2023
1 parent 2b425a2 commit 5c23a62
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions machinery/src/cloud/Cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -542,14 +542,14 @@ func VerifyHub(c *gin.Context) {
err := c.BindJSON(&config)

if err == nil {
hubKey := config.HubKey
hubURI := config.HubURI
publicKey := config.HubKey
privateKey := config.HubPrivateKey

content := []byte(`{"message": "fake-message"}`)
body := bytes.NewReader(content)
req, err := http.NewRequest("POST", hubURI+"/queue/test", body)
req, err := http.NewRequest("POST", hubURI+"/subscription/verify", nil)
if err == nil {
req.Header.Set("X-Kerberos-Cloud-Key", hubKey)
req.Header.Set("X-Kerberos-Hub-PublicKey", publicKey)
req.Header.Set("X-Kerberos-Hub-PrivateKey", privateKey)
client := &http.Client{}

resp, err := client.Do(req)
Expand Down

0 comments on commit 5c23a62

Please sign in to comment.