2022-12-06 08:18:31 +00:00
|
|
|
package handlers
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
|
2023-04-21 06:49:17 +00:00
|
|
|
. "github.com/reiver/greatape/components/api/protobuf"
|
|
|
|
. "github.com/reiver/greatape/components/contracts"
|
2022-12-06 08:18:31 +00:00
|
|
|
. "github.com/xeronith/diamante/contracts/network/http"
|
|
|
|
pipeline "github.com/xeronith/diamante/network/http"
|
|
|
|
)
|
|
|
|
|
|
|
|
type authorizeInteractionHandler struct {
|
|
|
|
}
|
|
|
|
|
|
|
|
func AuthorizeInteractionHandler() IHttpHandler {
|
|
|
|
return &authorizeInteractionHandler{}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (handler *authorizeInteractionHandler) Method() string {
|
|
|
|
return http.MethodGet
|
|
|
|
}
|
|
|
|
|
|
|
|
func (handler *authorizeInteractionHandler) Path() string {
|
|
|
|
return "/authorize_interaction"
|
|
|
|
}
|
|
|
|
|
|
|
|
func (handler *authorizeInteractionHandler) HandlerFunc() HttpHandlerFunc {
|
|
|
|
return func(x IServerDispatcher) error {
|
|
|
|
request := &AuthorizeInteractionRequest{}
|
|
|
|
result := &AuthorizeInteractionResult{}
|
|
|
|
|
|
|
|
onRequestUnmarshalled := func(request *AuthorizeInteractionRequest) {
|
|
|
|
request.Uri = x.Query("uri")
|
|
|
|
}
|
|
|
|
|
|
|
|
return pipeline.Handle(x,
|
|
|
|
AUTHORIZE_INTERACTION_REQUEST,
|
|
|
|
AUTHORIZE_INTERACTION_RESULT,
|
|
|
|
request, result,
|
|
|
|
onRequestUnmarshalled,
|
2023-05-02 17:43:35 +00:00
|
|
|
nil,
|
2022-12-06 08:18:31 +00:00
|
|
|
false,
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|