first pass at draft/AUTHTOKEN support#2385
first pass at draft/AUTHTOKEN support#2385slingamn wants to merge 16 commits intoergochat:masterfrom
Conversation
Includes a backwards-incompatible change to the extjwt configuration format; this is acceptable because we don't think many people are using extjwt right now.
|
Thank you, that was pretty quick! I haven't reviewed the implemenation (yet), this is just to answer the questions in the PR description:
We've discussed this and concluded that
We discussed the pros and cons of having
It is definitely the intent with |
| } | ||
|
|
||
| if len(msg.Params) < 2 { | ||
| rb.Add(nil, server.name, "FAIL", "TOKEN", "INVALID_PARAMS", "VALIDATE", client.t("No token to validate")) |
There was a problem hiding this comment.
Also not a documented fail code for TOKEN.
There was a problem hiding this comment.
True, but I generally don't worry too much about standardizing responses for programming errors (as opposed to runtime errors). Clients should never get INVALID_PARAMS or the equivalent outside of a testing/debugging context, so there's not much point in standardizing it. (Similarly, I've gotten some complaints that Ergo sends ERR_NEEDMOREPARAMS in contexts where the spec technically requires FAIL with INVALID_PARAMS, but it's not something I worry about.)
cc @whitequark @skizzerz
This implements the preliminary version of draft/AUTHTOKEN that I saw. The design here is the planned Ergo implementation: Ergo will GENERATE stateless JWTs, and implement VALIDATE over IRC C2S (and VALIDATE will pull some amount of additional live data to populate claims), but the intent is for Ergo-aware systems to parse and validate the token themselves without calling VALIDATE.
I wrote this code by hand, then had Claude Sonnet 4.6 review it against the spec. It didn't find any sharp edges with the JWT code, but it flagged some discrepancies with the spec:
VALIDATEtake the service as one of its arguments or not? (This implementation assumesVALIDATEwith no service parameter, just the token; the service name is encoded in the token and signed.)GENERATEandSERVICELISTavailable before connection registration?GENERATEseems not useful in that context.SERVICELISTseems potentially useful but would introduce additional security considerations for Ergo (for example, on a password-protected orrequire-sasldeployment we would want to hide it).VALIDATEpre-registration (actually after registration too, but that's not really a concern). The user can enable0.0.0.0/0and::/0if they need to, but I wanted to make sure that restrictions on who canVALIDATEaren't going against the spirit of the spec.Thanks!