Add soju.im/account-required

References: https://github.com/ircv3/ircv3-specifications/pull/492
This commit is contained in:
Simon Ser 2022-06-04 10:52:28 +02:00
parent 3c5e603192
commit 22b235602b
2 changed files with 19 additions and 0 deletions

View file

@ -0,0 +1,12 @@
# account-required
This specification defines the informational `soju.im/account-required`
capability. If present, it indicates that the connection to the server cannot
be completed unless the clients authenticates, typically via SASL. Note, the
absence of this capability does not indicate that connection registration can
be completed without authentication; it may be disallowed due to specific
properties of the connection (e.g. an untrustworthy IP address), which will be
indicated instead by `FAIL * ACCOUNT_REQUIRED`.
Clients MUST NOT request `soju.im/account-required`; servers MUST reject any
`CAP REQ` command including this capability.

View file

@ -240,6 +240,7 @@ var permanentDownstreamCaps = map[string]string{
"soju.im/bouncer-networks-notify": "", "soju.im/bouncer-networks-notify": "",
"soju.im/no-implicit-names": "", "soju.im/no-implicit-names": "",
"soju.im/read": "", "soju.im/read": "",
"soju.im/account-required": "",
} }
// needAllDownstreamCaps is the list of downstream capabilities that // needAllDownstreamCaps is the list of downstream capabilities that
@ -906,6 +907,12 @@ func (dc *downstreamConn) handleCapCommand(cmd string, args []string) error {
break break
} }
if name == "soju.im/account-required" {
// account-required is an informational cap
ack = false
break
}
m[name] = enable m[name] = enable
} }