-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add delete user, get proof by userID endpoints #3
Conversation
@@ -0,0 +1,17 @@ | |||
package requests | |||
|
|||
import ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
File is not goimports
-ed (goimports)
@@ -0,0 +1,17 @@ | |||
package requests | |||
|
|||
import ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
File is not goimports
-ed (goimports)
@@ -0,0 +1,36 @@ | |||
package handlers | |||
|
|||
import ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
File is not goimports
-ed (goimports)
package handlers | ||
|
||
import ( | ||
"encoding/json" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
File is not goimports
-ed (goimports)
@@ -0,0 +1,16 @@ | |||
package requests | |||
|
|||
import ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
File is not goimports
-ed (goimports)
@@ -0,0 +1,99 @@ | |||
package handlers | |||
|
|||
import ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
File is not goimports
-ed (goimports)
package handlers | ||
|
||
import ( | ||
"fmt" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
File is not goimports
-ed (goimports)
package resources | ||
|
||
type LinksAttributes struct { | ||
CallbackUrl string `json:"callbackUrl"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
var-naming: struct field CallbackUrl should be CallbackURL (revive)
BirthDateUpperBound string `json:"birthDateUpperBound"` | ||
CitizenshipMask string `json:"citizenshipMask"` | ||
EventData string `json:"eventData"` | ||
EventId string `json:"eventId,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
var-naming: struct field EventId should be EventID (revive)
PROOF_PARAMETERS ResourceType = "proof_parameters" | ||
RECEIVE_PROOF ResourceType = "receive_proof" | ||
GET_PROOF_PARAMS ResourceType = "get_proof_params" | ||
USER_STATUS ResourceType = "user_status" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
var-naming: don't use ALL_CAPS in Go names; use CamelCase (revive)
"net/http" | ||
) | ||
|
||
func GetProofParamsByID(r *http.Request) (userId string, err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
var-naming: func result userId should be userID (revive)
expirationDateLowerBound string | ||
} | ||
|
||
func GetProofParamsById(w http.ResponseWriter, r *http.Request) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
var-naming: func GetProofParamsById should be GetProofParamsByID (revive)
return | ||
} | ||
|
||
userIdHash, err := StringToPoseidonHash(req.Data.ID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
var-naming: var userIdHash should be userIDHash (revive)
|
||
} | ||
|
||
func NewProofParamsByIdResponse(user data.VerifyUsers, params GetProofParam) resources.ProofParamsResponse { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
var-naming: func NewProofParamsByIdResponse should be NewProofParamsByIDResponse (revive)
internal/service/router.go
Outdated
r.Route("/public", func(r chi.Router) { | ||
r.Post("/callback/{user_id}", handlers.VerificationCallback) | ||
|
||
r.Route("/v2", func(r chi.Router) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move it to v1
userId = chi.URLParam(r, "user_id") | ||
|
||
err = val.Errors{ | ||
"user_id": val.Validate(userId, val.Required, is.Email), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove isEmail
|
||
import ( | ||
"encoding/json" | ||
val "github.com/go-ozzo/ozzo-validation/v4" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
File is not goimports
-ed (goimports)
"net/http" | ||
) | ||
|
||
func GetProofByUserID(r *http.Request) (userId string, err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
var-naming: func result userId should be userID (revive)
"net/http" | ||
) | ||
|
||
func DeleteUserByID(r *http.Request) (userId string, err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
var-naming: func result userId should be userID (revive)
No description provided.