You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@milagro.apache.org by ki...@apache.org on 2019/09/17 08:31:35 UTC

[incubator-milagro-dta] branch statusRPC created (now 4f77b13)

This is an automated email from the ASF dual-hosted git repository.

kittohoward pushed a change to branch statusRPC
in repository https://gitbox.apache.org/repos/asf/incubator-milagro-dta.git.


      at 4f77b13  status client endpoint

This branch includes the following new commits:

     new b054cd2  client interface for status page
     new 011f605  Merge branch 'develop' into statusRPC
     new 68e6a5e  added status client with token header
     new f884d29  hardcode OIDC for testing purposes
     new 4f77b13  status client endpoint

The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[incubator-milagro-dta] 01/05: client interface for status page

Posted by ki...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kittohoward pushed a commit to branch statusRPC
in repository https://gitbox.apache.org/repos/asf/incubator-milagro-dta.git

commit b054cd2356bbf88e2c22a44bb95ab6d2a73d959c
Author: howardkitto <ki...@gmail.com>
AuthorDate: Fri Sep 13 11:06:25 2019 +0100

    client interface for status page
---
 pkg/api/client.go | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/pkg/api/client.go b/pkg/api/client.go
index 00d336d..fc26acc 100644
--- a/pkg/api/client.go
+++ b/pkg/api/client.go
@@ -22,6 +22,7 @@ package api
 
 import (
 	"context"
+	"fmt"
 	"net/http"
 
 	"github.com/apache/incubator-milagro-dta/libs/logger"
@@ -36,6 +37,7 @@ var (
 type ClientService interface {
 	FulfillOrder(req *FulfillOrderRequest) (*FulfillOrderResponse, error)
 	FulfillOrderSecret(req *FulfillOrderSecretRequest) (*FulfillOrderSecretResponse, error)
+	Status() (*StatusResponse, error)
 }
 
 // MilagroClientService - implements Service Interface
@@ -58,6 +60,11 @@ func ClientEndpoints() transport.HTTPEndpoints {
 			NewRequest:  func() interface{} { return &FulfillOrderSecretRequest{} },
 			NewResponse: func() interface{} { return &FulfillOrderSecretResponse{} },
 		},
+		"Status": {
+			Path:        "/" + apiVersion + "/status",
+			Method:      http.MethodGet,
+			NewResponse: func() interface{} { return &StatusResponse{} },
+		},
 	}
 }
 
@@ -89,3 +96,16 @@ func (c MilagroClientService) FulfillOrderSecret(req *FulfillOrderSecretRequest)
 	r := d.(*FulfillOrderSecretResponse)
 	return r, nil
 }
+
+//Status - Allows a client to see the status of the server that it is connecting too
+func (c MilagroClientService) Status() (*StatusResponse, error) {
+	endpoint := c.endpoints["Status"]
+	
+	s, err := endpoint(context.Background(), nil)
+	if err != nil {
+		return nil, err
+	}
+	r := s.(*StatusResponse)
+	fmt.Println("got status request")
+	return r, nil
+}


[incubator-milagro-dta] 02/05: Merge branch 'develop' into statusRPC

Posted by ki...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kittohoward pushed a commit to branch statusRPC
in repository https://gitbox.apache.org/repos/asf/incubator-milagro-dta.git

commit 011f6051b27a4f131db4e6691db033ba49da4ddb
Merge: b054cd2 3655030
Author: howardkitto <ki...@gmail.com>
AuthorDate: Mon Sep 16 11:04:59 2019 +0100

    Merge branch 'develop' into statusRPC

 go.mod                       |  16 ++-----
 go.sum                       |  33 ++++++++++++++
 libs/transport/authorizer.go |   7 +++
 libs/transport/http.go       | 101 ++++++++++++++++++++++++++++---------------
 pkg/api/client.go            |   8 +++-
 5 files changed, 115 insertions(+), 50 deletions(-)



[incubator-milagro-dta] 05/05: status client endpoint

Posted by ki...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kittohoward pushed a commit to branch statusRPC
in repository https://gitbox.apache.org/repos/asf/incubator-milagro-dta.git

commit 4f77b13bbda7903185b5260ce6ab86ce3b231a2a
Author: howardkitto <ki...@gmail.com>
AuthorDate: Tue Sep 17 09:31:17 2019 +0100

    status client endpoint
---
 pkg/api/client.go | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/pkg/api/client.go b/pkg/api/client.go
index 91c8f31..c3510a3 100644
--- a/pkg/api/client.go
+++ b/pkg/api/client.go
@@ -22,7 +22,6 @@ package api
 
 import (
 	"context"
-	"fmt"
 	"net/http"
 
 	"github.com/apache/incubator-milagro-dta/libs/logger"
@@ -103,7 +102,6 @@ func (c MilagroClientService) FulfillOrderSecret(req *FulfillOrderSecretRequest)
 
 //Status - Allows a client to see the status of the server that it is connecting too
 func (c MilagroClientService) Status(token string) (*StatusResponse, error) {
-	fmt.Printf("\njwtToken: %v\n", token)
 	endpoint := c.endpoints["Status"]
 	ctx := context.Background()
 	ctx = transport.SetJWTAuthHeader(ctx, token)
@@ -113,6 +111,5 @@ func (c MilagroClientService) Status(token string) (*StatusResponse, error) {
 		return nil, err
 	}
 	r := s.(*StatusResponse)
-	fmt.Println("got status request")
 	return r, nil
 }


[incubator-milagro-dta] 03/05: added status client with token header

Posted by ki...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kittohoward pushed a commit to branch statusRPC
in repository https://gitbox.apache.org/repos/asf/incubator-milagro-dta.git

commit 68e6a5eee3a0f94e8c6e10f00124252f348b8c4f
Author: howardkitto <ki...@gmail.com>
AuthorDate: Mon Sep 16 11:08:44 2019 +0100

    added status client with token header
---
 pkg/api/client.go | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/pkg/api/client.go b/pkg/api/client.go
index e16f56e..74fdfdc 100644
--- a/pkg/api/client.go
+++ b/pkg/api/client.go
@@ -102,10 +102,12 @@ func (c MilagroClientService) FulfillOrderSecret(req *FulfillOrderSecretRequest)
 }
 
 //Status - Allows a client to see the status of the server that it is connecting too
-func (c MilagroClientService) Status() (*StatusResponse, error) {
+func (c MilagroClientService) Status(token string) (*StatusResponse, error) {
 	endpoint := c.endpoints["Status"]
-	
-	s, err := endpoint(context.Background(), nil)
+	ctx := context.Background()
+	ctx = transport.SetJWTAuthHeader(ctx, token)
+
+	s, err := endpoint(ctx, nil)
 	if err != nil {
 		return nil, err
 	}


[incubator-milagro-dta] 04/05: hardcode OIDC for testing purposes

Posted by ki...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kittohoward pushed a commit to branch statusRPC
in repository https://gitbox.apache.org/repos/asf/incubator-milagro-dta.git

commit f884d29b8a7a77cf3227374b4b0cd61dfb8ae992
Author: howardkitto <ki...@gmail.com>
AuthorDate: Mon Sep 16 13:18:21 2019 +0100

    hardcode OIDC for testing purposes
---
 pkg/api/client.go     | 3 ++-
 pkg/config/default.go | 4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/pkg/api/client.go b/pkg/api/client.go
index 74fdfdc..91c8f31 100644
--- a/pkg/api/client.go
+++ b/pkg/api/client.go
@@ -37,7 +37,7 @@ var (
 type ClientService interface {
 	FulfillOrder(req *FulfillOrderRequest) (*FulfillOrderResponse, error)
 	FulfillOrderSecret(req *FulfillOrderSecretRequest) (*FulfillOrderSecretResponse, error)
-	Status() (*StatusResponse, error)
+	Status(token string) (*StatusResponse, error)
 }
 
 // MilagroClientService - implements Service Interface
@@ -103,6 +103,7 @@ func (c MilagroClientService) FulfillOrderSecret(req *FulfillOrderSecretRequest)
 
 //Status - Allows a client to see the status of the server that it is connecting too
 func (c MilagroClientService) Status(token string) (*StatusResponse, error) {
+	fmt.Printf("\njwtToken: %v\n", token)
 	endpoint := c.endpoints["Status"]
 	ctx := context.Background()
 	ctx = transport.SetJWTAuthHeader(ctx, token)
diff --git a/pkg/config/default.go b/pkg/config/default.go
index 1ea3ba1..d8baccf 100644
--- a/pkg/config/default.go
+++ b/pkg/config/default.go
@@ -32,8 +32,8 @@ func defaultHTTPConfig() HTTPConfig {
 	return HTTPConfig{
 		ListenAddr:    ":5556",
 		MetricsAddr:   ":5557",
-		OIDCProvider:  "",
-		OIDCClientID:  "",
+		OIDCProvider:  "https://cognito-idp.eu-west-1.amazonaws.com/eu-west-1_m8yeNWVGg",
+		OIDCClientID:  "b6mbvm7sr62f7oc72bu69h6if",
 		OIDCClientKey: "",
 		CorsAllow:     "*",
 	}