-
Notifications
You must be signed in to change notification settings - Fork 33
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
Expose server's middleware for incoming clients control #55
Conversation
7e55222
to
b07bacd
Compare
password := event.Env["password"] | ||
err := m.authenticateClient(event.ClientID, event.ClientKey, username, password) | ||
if err != nil { | ||
log.Error("Unable to authenticate client:", err) |
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.
Are we just logging the auth problem and not returning an 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.
Did not change this logic. Probably, middleware just logs returning returned errors also.
If you mean returning error to connecting client, it's intentional. Client gets just "wrong username or password"
type middleware struct { | ||
*auth.Middleware |
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.
Why filter
depends on auth
?
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.
Simple inheritances. auth.Middleware
general purpose - subscribes to client status events
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.
There is no inheritance for golang, that is why it looks weird when you are trying to invent it yourself.
|
||
return true, nil | ||
} | ||
func (m *middleware) ConsumeLine(line string) (bool, error) { return false, nil } |
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.
It doesn't consume lines anymore?
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.
Yes, now subscribes for consumer client from auth.Middleware
2471728
to
42b4559
Compare
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.
Comments fixed
42b4559
to
ae74469
Compare
Updates: mysteriumnetwork/node#1838