clean up some remnant commented out code
This commit is contained in:
@@ -56,21 +56,13 @@ func (l *Listener) HandleEvent(msg []byte) (err error) {
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// // send a challenge to the client to auth if an ACL is active and not authed
|
|
||||||
// if acl.Registry.Active.Load() != "none" && l.authedPubkey.Load() == nil {
|
|
||||||
// log.D.F("sending challenge to %s", l.remote)
|
|
||||||
// if err = authenvelope.NewChallengeWith(l.challenge.Load()).
|
|
||||||
// Write(l); chk.E(err) {
|
|
||||||
// // return
|
|
||||||
// }
|
|
||||||
// // ACL is enabled so return and wait for auth
|
|
||||||
// // return
|
|
||||||
// }
|
|
||||||
// check permissions of user
|
// check permissions of user
|
||||||
accessLevel := acl.Registry.GetAccessLevel(l.authedPubkey.Load())
|
accessLevel := acl.Registry.GetAccessLevel(l.authedPubkey.Load())
|
||||||
switch accessLevel {
|
switch accessLevel {
|
||||||
case "none":
|
case "none":
|
||||||
log.D.F("handle event: sending CLOSED to %s", l.remote)
|
log.D.F(
|
||||||
|
"handle event: sending 'OK,false,auth-required...' to %s", l.remote,
|
||||||
|
)
|
||||||
if err = okenvelope.NewFrom(
|
if err = okenvelope.NewFrom(
|
||||||
env.Id(), false,
|
env.Id(), false,
|
||||||
reason.AuthRequired.F("auth required for write access"),
|
reason.AuthRequired.F("auth required for write access"),
|
||||||
@@ -84,17 +76,20 @@ func (l *Listener) HandleEvent(msg []byte) (err error) {
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
case "read":
|
case "read":
|
||||||
log.D.F("handle event: sending CLOSED to %s", l.remote)
|
log.D.F(
|
||||||
|
"handle event: sending 'OK,false,auth-required:...' to %s",
|
||||||
|
l.remote,
|
||||||
|
)
|
||||||
if err = okenvelope.NewFrom(
|
if err = okenvelope.NewFrom(
|
||||||
env.Id(), false,
|
env.Id(), false,
|
||||||
reason.AuthRequired.F("auth required for write access"),
|
reason.AuthRequired.F("auth required for write access"),
|
||||||
).Write(l); chk.E(err) {
|
).Write(l); chk.E(err) {
|
||||||
// return
|
return
|
||||||
}
|
}
|
||||||
log.D.F("handle event: sending challenge to %s", l.remote)
|
log.D.F("handle event: sending challenge to %s", l.remote)
|
||||||
if err = authenvelope.NewChallengeWith(l.challenge.Load()).
|
if err = authenvelope.NewChallengeWith(l.challenge.Load()).
|
||||||
Write(l); chk.E(err) {
|
Write(l); chk.E(err) {
|
||||||
// return
|
return
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -32,33 +32,11 @@ func (l *Listener) HandleReq(msg []byte) (
|
|||||||
if len(rem) > 0 {
|
if len(rem) > 0 {
|
||||||
log.I.F("extra '%s'", rem)
|
log.I.F("extra '%s'", rem)
|
||||||
}
|
}
|
||||||
// // send a challenge to the client to auth if an ACL is active and not authed
|
|
||||||
// if acl.Registry.Active.Load() != "none" && l.authedPubkey.Load() == nil {
|
|
||||||
// log.D.F("sending challenge to %s", l.remote)
|
|
||||||
// if err = authenvelope.NewChallengeWith(l.challenge.Load()).
|
|
||||||
// Write(l); chk.E(err) {
|
|
||||||
// // return
|
|
||||||
// }
|
|
||||||
// log.D.F("sending CLOSED to %s", l.remote)
|
|
||||||
// if err = closedenvelope.NewFrom(
|
|
||||||
// env.Subscription, reason.AuthRequired.F("auth required for access"),
|
|
||||||
// ).Write(l); chk.E(err) {
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
// // ACL is enabled so return and wait for auth
|
|
||||||
// // return
|
|
||||||
// }
|
|
||||||
// send a challenge to the client to auth if an ACL is active
|
// send a challenge to the client to auth if an ACL is active
|
||||||
if acl.Registry.Active.Load() != "none" {
|
if acl.Registry.Active.Load() != "none" {
|
||||||
// log.D.F("sending CLOSED to %s", l.remote)
|
|
||||||
// if err = closedenvelope.NewFrom(
|
|
||||||
// env.Subscription, reason.AuthRequired.F("auth required for access"),
|
|
||||||
// ).Write(l); chk.E(err) {
|
|
||||||
// // return
|
|
||||||
// }
|
|
||||||
if err = authenvelope.NewChallengeWith(l.challenge.Load()).
|
if err = authenvelope.NewChallengeWith(l.challenge.Load()).
|
||||||
Write(l); chk.E(err) {
|
Write(l); chk.E(err) {
|
||||||
// return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// check permissions of user
|
// check permissions of user
|
||||||
|
|||||||
Reference in New Issue
Block a user