Skip to content
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

Merged
merged 8 commits into from
Sep 2, 2024

Conversation

chabanyknikita
Copy link
Contributor

No description provided.

@@ -0,0 +1,17 @@
package requests

import (

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 (

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 (

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"

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 (

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 (

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"

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"`

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"`

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"

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) {

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) {

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)

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 {

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)

r.Route("/public", func(r chi.Router) {
r.Post("/callback/{user_id}", handlers.VerificationCallback)

r.Route("/v2", func(r chi.Router) {
Copy link
Contributor

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),
Copy link
Contributor

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"
Copy link

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) {
Copy link

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) {
Copy link

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)

@chabanyknikita chabanyknikita merged commit 104a539 into main Sep 2, 2024
1 check passed
@mhrynenko mhrynenko deleted the feature/delete-user branch December 5, 2024 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants