Skip to content

Commit

Permalink
VerifyPassport connector become deprecated. Change private endpoint f…
Browse files Browse the repository at this point in the history
…or verification to public
  • Loading branch information
Zaptoss committed Mar 27, 2024
1 parent ae058c9 commit b1b3967
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions internal/service/handlers/verify_passport.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ import (
)

func VerifyPassport(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusNoContent)
return

// TODO: New logic. User go to public endpoint with proof that verify passport
// need logic for check proof and accruing points for verification.

req, err := requests.NewVerifyPassport(r)
if err != nil {
Log(r).WithError(err).Debug("Bad request")
Expand Down
2 changes: 1 addition & 1 deletion internal/service/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ func Run(ctx context.Context, cfg config.Config) {
r.Route("/{did}", func(r chi.Router) {
r.Get("/", handlers.GetBalance)
r.Patch("/", handlers.ActivateBalance)
r.Patch("/verifypassport", handlers.VerifyPassport)
r.Get("/withdrawals", handlers.ListWithdrawals)
r.Post("/withdrawals", handlers.Withdraw)
})
Expand All @@ -46,7 +47,6 @@ func Run(ctx context.Context, cfg config.Config) {
})
// must be accessible only within the cluster
r.Route("/private", func(r chi.Router) {
r.Patch("/balances", handlers.VerifyPassport)
r.Patch("/events", handlers.FulfillEvent)
r.Patch("/proofs", handlers.FulfillVerifyProofEvent)
r.Post("/referrals", handlers.EditReferrals)
Expand Down
2 changes: 2 additions & 0 deletions pkg/connector/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ func (c *Client) FulfillVerifyProofEvent(ctx context.Context, req FulfillVerifyP
}

func (c *Client) VerifyPassport(ctx context.Context, req VerifyPassportRequest) error {
// Deprecated: VerifyPassport whould be public endpoint
// and that connector currently not used
if c.disabled {
c.log.Info("Points connector disabled")
return nil
Expand Down

0 comments on commit b1b3967

Please sign in to comment.