We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
this leaks the logic of the server into a place where it's whole responsibility is doing
if err:=server.Run(); err!=nil { ... }
It shouldn't bother about the sighandlers or anything else
Condition is wrong, should be ||, it's correctly checked in the cmd/main.go
||
cmd/main.go
check should be if err!=nil
if err!=nil
there's no mechanism to set node to Approved (should allow the farmer to approve the node to be part of their farm)
Does nothing but verify signature, rename to sigverifier.go
const PubKeySize = 32 // ED25519/SR25519 public key size var ( ErrInvalidInput = errors.New("invalid input") ErrVerifyFailed = errors.New("signature verification failed") )
func verifyWithScheme(scheme interface{}, publicKey, challenge, signature []byte) bool { key, err := scheme.FromPublicKey(publicKey) if err != nil { return false } return key.Verify(challenge, signature) }
http.ErrServerClosed
log.Warn().Err(err).Msg("public key decode failed") abortWithError(c, http.StatusBadRequest, "invalid account configuration")
const clockTolerance = 5 * time.Second if time.Since(time.Unix(timestamp, 0)) > (ChallengeValidity + clockTolerance) {
// Farms publicFarmRoutes := v1.Group("farms") publicFarmRoutes.GET("/", s.listFarmsHandler) publicFarmRoutes.GET("/:farm_id", s.getFarmHandler) protectedFarmRoutes := v1.Group("farms", s.AuthMiddleware()) protectedFarmRoutes.POST("/", s.createFarmHandler) protectedFarmRoutes.PATCH("/:farm_id", s.updateFarmsHandler)
return after sending error in the response, because that will incorrectly send 200 ok
check errors with Is or As not ==
==
return after sending the json
name updateFarmsHandler => updateFarmHandler
createFarm, registerNode are missing validations e.g twin ID or farmID
The text was updated successfully, but these errors were encountered:
WIP Addressed most of the points here, but few are left will be addressed separately
Sorry, something went wrong.
Eslam-Nawara
No branches or pull requests
Uh oh!
There was an error while loading. Please reload this page.
main.go
this leaks the logic of the server into a place where it's whole responsibility is doing
It shouldn't bother about the sighandlers or anything else
db.go
Condition is wrong, should be
||
, it's correctly checked in thecmd/main.go
check should be
if err!=nil
db/models.go
there's no mechanism to set node to Approved (should allow the farmer to approve the node to be part of their farm)
util.go
Does nothing but verify signature, rename to sigverifier.go
server.go
http.ErrServerClosed
in ListenAndServeserver/auth middleware
routes
handlers.go
return after sending error in the response, because that will incorrectly send 200 ok
check errors with Is or As not
==
return after sending the json
name updateFarmsHandler => updateFarmHandler
createFarm, registerNode are missing validations e.g twin ID or farmID
The text was updated successfully, but these errors were encountered: