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 "Tags" check in POST /signature endpoint #59

Open
Marketen opened this issue May 30, 2024 · 0 comments
Open

Add "Tags" check in POST /signature endpoint #59

Marketen opened this issue May 30, 2024 · 0 comments

Comments

@Marketen
Copy link
Contributor

POST /signatures endpoint doesnt do any check on the "Tag" besides validating that it is not empty. Ideally it should check that is one of the defined ones in tyoes.go:

const (
Obol Tag = "obol"
Diva Tag = "diva"
Ssv Tag = "ssv"
Rocketpool Tag = "rocketpool"
Stakewise Tag = "stakewise"
Stakehouse Tag = "stakehouse"
Solo Tag = "solo"
Stader Tag = "stader"
)

Validation could look like:

func isValidTag(tag types.Tag) bool {
	switch tag {
	case types.Obol, types.Diva, types.Ssv, types.Rocketpool, types.Stakewise, types.Stakehouse, types.Solo, types.Stader:
		return true
	default:
		return false
	}
}
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

No branches or pull requests

1 participant